Skip to content

Can't use cache to bypass downloading electron #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AlirezaBKHN opened this issue May 11, 2025 · 0 comments
Open

Can't use cache to bypass downloading electron #334

AlirezaBKHN opened this issue May 11, 2025 · 0 comments

Comments

@AlirezaBKHN
Copy link

Even after putting the cache inside the user AppData i still get this error.
also my agent is not connected to the internet and i need to verify the checksum offline.
both zip and checksum are placed together.

> Packaging for x64 on win32
> Copying files
> Preparing native dependencies
> Finalizing package
2025-05-11T11:47:50.052Z @electron/get:index Checking the cache (undefined) for electron-v36.0.0-win32-x64.zip (https://github.com/electron/electron/releases/download/v36.0.0/electron-v36.0.0-win32-x64.zip)
2025-05-11T11:47:50.055Z @electron/get:index Cache hit
2025-05-11T11:47:50.057Z @electron/get:index Downloading https://github.com/electron/electron/releases/download/v36.0.0/SHASUMS256.txt to C:\Users\TESTAU~1\AppData\Local\Temp\1\electron-download-rT2lFT\SHASUMS256.txt with options: undefined

electron: v36.0.0
electron-forge: v7.8.1
I don't have any idea of how to use forge.packagerConfig, it doesn't seem to have any property for cache root.

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.

Originally posted by @CMCDragonkai in #160

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant