Skip to content
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

Changing ELECTRON_BUILDER_CACHE between builds causes error #4955

Closed
adam-lynch opened this issue May 12, 2020 · 1 comment · Fixed by #4958
Closed

Changing ELECTRON_BUILDER_CACHE between builds causes error #4955

adam-lynch opened this issue May 12, 2020 · 1 comment · Fixed by #4958

Comments

@adam-lynch
Copy link
Contributor

  • Version: 22.6.0
  • Electron Version: 8.x
  • Electron Type (current, beta, nightly): current
  • Target: Windows NSIS and MSI

In trying to workaround #1850:

  1. Before a build, I set ELECTRON_BUILDER_CACHE to a newly created directory with a randomly generated name.
  2. After the build, delete the directory.

If I run two builds right after each other, I get the following error:

Error: Exit code: ENOENT. spawn MY_CACHE_DIRECTORY\winCodeSign\winCodeSign-2.6.0\windows-10\x64\signtool.exe ENOENT
    at MY_PROJECT_DIRECTORY\node_modules\builder-util\src\util.ts:129:16
    at exithandler (child_process.js:302:5)
    at ChildProcess.errorhandler (child_process.js:314:5)
    at ChildProcess.emit (events.js:203:13)
    at ChildProcess.EventEmitter.emit (domain.js:476:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
From previous event:
    at processImmediate (internal/timers.js:439:21)
    at process.topLevelDomainCallback (domain.js:131:23)
From previous event:
    at WinPackager.signApp (MY_PROJECT_DIRECTORY\node_modules\app-builder-lib\src\winPackager.ts:357:27)
    at WinPackager.doPack (MY_PROJECT_DIRECTORY\node_modules\app-builder-lib\src\platformPackager.ts:244:16)
    at WinPackager.pack (MY_PROJECT_DIRECTORY\node_modules\app-builder-lib\src\platformPackager.ts:115:5)
    at Packager.doBuild (MY_PROJECT_DIRECTORY\node_modules\app-builder-lib\src\packager.ts:444:9)
    at executeFinally (MY_PROJECT_DIRECTORY\node_modules\builder-util\src\promise.ts:12:14)
    at Packager._build (MY_PROJECT_DIRECTORY\node_modules\app-builder-lib\src\packager.ts:373:31)
    at Packager.build (MY_PROJECT_DIRECTORY\node_modules\app-builder-lib\src\packager.ts:337:12)
    at Object.build [as default] (MY_PROJECT_DIRECTORY\built\server\build.js:164:29)
    at Object.receiveAppData [as default] (MY_PROJECT_DIRECTORY\built\server\receiveAppData.js:30:27)
    at Worker.queue [as fn] (MY_PROJECT_DIRECTORY\built\server\index.js:136:36)

I think what's happening is that binDownload.ts' promise cache is never broken/invalidated.

I imagine the fix would be to check if the environment variable has changed and reset the map before it's used here. I can make a pull-request.

adam-lynch added a commit to adam-lynch/electron-builder that referenced this issue May 12, 2020
adam-lynch added a commit to adam-lynch/electron-builder that referenced this issue May 12, 2020
adam-lynch added a commit to adam-lynch/electron-builder that referenced this issue May 12, 2020
develar pushed a commit that referenced this issue May 14, 2020
@adam-lynch
Copy link
Contributor Author

Thanks

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

Successfully merging a pull request may close this issue.

1 participant