electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.71k stars 1.74k forks source link

Appended space to ELECTRON_BUILDER_CACHE #8480

Open ku4ndev opened 2 months ago

ku4ndev commented 2 months ago

Hello there,

I'm trying to set a local cache for electron-builder since I can't connect to GitHub in the network I work in. It seems that an unncessary space is added to the path specified in the environment variable ELECTRON_BUILDER_CACHE, as reported in this issue: https://github.com/electron-userland/electron-builder/issues/5327 .

I have also tried setting a local server and point ELECTRON_BUILDER_BINARIES_MIRROR to it, and the same issue occurs; there is an added space to the path.

Any workaround/fix for this issue? If more information is needed please ask and I will provide it ASAP.

Thank you beforehand.

mmaietta commented 2 months ago

Can you provide logs with env var DEBUG=electron-builder? Curious as to what's failing. There's a few mentions of ELECTRON_BUILDER_CACHE in the code, but nothing that should be causing an extra space AFAICT

ku4ndev commented 2 months ago

Can you provide logs with env var DEBUG=electron-builder? Curious as to what's failing. There's a few mentions of ELECTRON_BUILDER_CACHE in the code, but nothing that should be causing an extra space AFAICT

Sure @mmaietta , here are the logs relevant to electron-builder; just in case, the script I've ran is "set DEBUG=electron-builder && set ELECTRON_BUILDER_CACHE=C:/electronCache && npm run build:prod && electron-builder":

• electron-builder version=25.0.5 os=10.0.22631 • loaded configuration file=package.json ("build" field) • effective config config=directories: output: dist-electron buildResources: build appId: com.yourapp.id files:

ficristo commented 2 months ago

It seems a bad interaction with npm\node. Try a simple package.json with:

{
    "scripts": {
        "test": "set foo=c:/foo && node test.js"
    }
}

where test.js contains only:

console.log("_" + process.env.foo + "_");

This is what it is printed:

_c:/foo _

Then try to remove the space before &&:

{
    "scripts": {
        "test": "set foo=c:/foo&& node test.js"
    }
}

and this is what is printed:

_c:/foo_
ku4ndev commented 2 months ago

Yes, that seems to be the case; although I've tried doing it with yarn and the same space is present, so probably on the node side? Anyway, seems that removing the space before && works fine; thanks!