question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use `electron_config_cache` env var to search for cached downloads

See original GitHub issue

Electron docs say that one can override path to cached electron downloads via the electron_config_cache environment variable, but it doesn’t seem to be the case with electron-get - the env var is ignored and, as far as I understand, cache path is unconditionally resolved to something like $XDG_CACHE_HOME/electron/sanitazed_url/electron.zip: https://github.com/electron/get/blob/f2c625377c758c8348a5432e22a5a9ac0ef98889/src/Cache.ts#L17-L22 electron-downoad did respect electron_config_cache.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16

github_iconTop GitHub Comments

1reaction
CMCDragonkaicommented, Mar 7, 2021

The problem is this…

The electron-packager exposes a packager default export. This is used by electron-forge in the packages/api/core/src/api/package.ts.

Specifically where it calls const outputPaths = await packager(packageOpts);. Through several series of magic, it will eventually call the downloadArtifact function in @electron/get.

At no point is the cacheRoot ever acquired from an environment variable.

The packageOpts defined in packages/api/core/src/api/package.ts has no mention about download options that would specify the cacheRoot.

So currently there is no way to set the cacheRoot via an enviroment variable in the latest electron-forge.

EXCEPT…

through the forge.packagerConfig.

0reactions
CMCDragonkaicommented, Mar 7, 2021

The message above corresponds to this line: https://github.com/electron/get/blob/v1.12.4/src/index.ts#L71

We are using 1.12.4.

Which means artifactDetails.cacheRoot is undefined.

What could cause that to be undefined?

Read more comments on GitHub >

github_iconTop Results From Across the Web

cmd/go: add GOMODCACHE · Issue #34527 · golang/go
Summary Add GOMODCACHE to control where the module download cache lives. Its default can continue to be GOPATH[0]/pkg/mod, and the variable ...
Read more >
Cache management — datasets 1.12.0 documentation
The cache allows Datasets to avoid re-downloading or processing the entire dataset every time you use it. This guide will show you how...
Read more >
How to cache downloaded PIP packages - Stack Overflow
You can use a specific environment variable PIP_DOWNLOAD_CACHE and make it point to a directory where your packages will be stored.
Read more >
Environment Variable caching in Power Automate
In this blog post, I will explain the current problem with Environment Variable caching in Power Automate flows and how to work around...
Read more >
Environment variables — MIT Kerberos Documentation
KRB5CCNAME: Default name for the credentials cache file, in the form type:residual. The type of the default cache may determine the availability of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found