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

The ELECTRON_BUILDER_BINARIES_MIRROR variable doesn't effect winCodeSign #4217

Closed
huxiaoxi1992 opened this issue Sep 6, 2019 · 4 comments
Closed
Labels

Comments

@huxiaoxi1992
Copy link

  • Version: 21.2.0
  • Target: win x64 nsis

  • Environment: gitlab-ce CI/CD -> image: electronuserland/builder:wine-mono

The electron-builder-binaries download slowly, I have hosted my own binaries mirror and added some environment variables due to #3761.
image

winCodeSign seems to be not effected by this variable.
image

Sometimes, it runs successful with the default url, is it possible to make winCodeSign download from the mirror variable?
image

@OutgoingOpossum
Copy link

OutgoingOpossum commented Oct 1, 2019

I can confirm this does not work with electron-builder@20.44.4 for target platform=win32 arch=x64 electron=2.0.14

I think this because the windows code sign routine uses getBin() directly

export function getSignVendorPath() {
return getBin("winCodeSign")
}

while other processes use getBinFromUrl()

const vendorPath = await getBinFromUrl("wix", "4.0.0.5512.2", "/X5poahdCc3199Vt6AP7gluTlT1nxi9cbbHhZhCMEu+ngyP1LiBMn+oZX7QAZVaKeBMc2SjVp7fJqNLqsUnPNQ==")

const nsisResourcePathPromise = new Lazy(() => getBinFromUrl("nsis-resources", "3.4.1", "Dqd6g+2buwwvoG1Vyf6BHR1b+25QMmPcwZx40atOT57gH27rkjOei1L0JTldxZu4NFoEmW4kJgZ3DlSWVON3+Q=="))

return getBinFromUrl("nsis", "3.0.4", "MNETIF8tex6+oiA0mgBi3/XKNH+jog4IBUp/F+Or7zUEhIP+c7cRjb9qGuBIofAXQ51z3RpyCfII4aPadsZB5Q==")

which seems to be a wrapper around getBin() adding support for the configuration variables in question

export function getBinFromUrl(name: string, version: string, checksum: string): Promise<string> {
const dirName = `${name}-${version}`
let url: string
if (process.env.ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL) {
url = process.env.ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL + "/" + dirName + ".7z"
}
else {
const baseUrl = process.env.NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR ||
process.env.npm_config_electron_builder_binaries_mirror ||
process.env.npm_package_config_electron_builder_binaries_mirror ||
process.env.ELECTRON_BUILDER_BINARIES_MIRROR ||
"https://github.com/electron-userland/electron-builder-binaries/releases/download/"
const middleUrl = process.env.NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR ||
process.env.npm_config_electron_builder_binaries_custom_dir ||
process.env.npm_package_config_electron_builder_binaries_custom_dir ||
process.env.ELECTRON_BUILDER_BINARIES_CUSTOM_DIR ||
dirName
const urlSuffix = dirName + ".7z"
url = `${baseUrl}${middleUrl}/${urlSuffix}`
}
return getBin(dirName, url, checksum)
}

This might also affect #3954

@stale
Copy link

stale bot commented Nov 30, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Nov 30, 2019
@stale stale bot closed this as completed Dec 7, 2019
@ghost
Copy link

ghost commented Dec 16, 2019

FWIW this is also occuring for me using "electron-builder": "^21.2.0"

I can work around the problem by by pointing ELECTRON_BUILDER_CACHE to a manually downloaded copy of winCodeSign, but having winCodeSign download same as e.g. nsis would be better.

@hausenism
Copy link

^22.0.0 fix this.

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

No branches or pull requests

3 participants