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

Docker wine container gives error:0308010C:digital envelope routines::unsupported when building with yarn dist #8070

Closed
gravelld opened this issue Feb 21, 2024 · 5 comments

Comments

@gravelld
Copy link

gravelld commented Feb 21, 2024

  • Electron-Builder Version: 24.9.1
  • Docker tag: wine
  • Node Version: 18 (that which comes with the wine tag)
  • Electron Version: 12.2.3
  • Electron Type (current, beta, nightly):
  • Target: Windows (using the wine builder)

When I run:

docker run electronuserland/builder:wine /bin/bash -c yarn && yarn dist

I get:

$ electron-webpack --production
<s> [webpack.Progress] 0% [0] compiling
<s> [webpack.Progress] 5% [0] building 0/0 modules 0 active 
<s> [webpack.Progress] 5% [0] building 0/1 modules 1 active multi /project/main.js
<s> [webpack.Progress] 5% [0] building 1/1 modules 0 active 
<s> [webpack.Progress] 5% [1] compiling
<s> [webpack.Progress] 10% [1] building 0/0 modules 0 active 
<s> [webpack.Progress] 10% [1] building 0/1 modules 1 active multi /project/main.js
<s> [webpack.Progress] 10% [1] building 1/1 modules 0 active 
<s> [webpack.Progress] 10% [1] building 1/2 modules 1 active /project/node_modules/babel-loader/lib/index.js??ref--4!/project/main.js
<s> [webpack.Progress] 10% [0] building 1/2 modules 1 active /project/node_modules/babel-loader/lib/index.js??ref--4!/project/main.js
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/project/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/project/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/project/node_modules/webpack/lib/NormalModule.js:471:10)
    at /project/node_modules/webpack/lib/NormalModule.js:503:5
    at /project/node_modules/webpack/lib/NormalModule.js:358:12
    at /project/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/project/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/project/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /project/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at /project/node_modules/loader-runner/lib/LoaderRunner.js:127:6
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

It looks like this relates to something SSL-y in Node >=17.

Trouble is, if I downgrade to Node 14 by using electronuserland/builder:14-wine I get an error because some of the dependencies require Node 18:

yarn install v1.22.19
warning Skipping preferred cache folder "/home/user/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
error isbinaryfile@5.0.2: The engine "node" is incompatible with this module. Expected version ">= 18.0.0". Got "14.21.3"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

As a workaround, I have gone to 14-wine and I force the use of an older version of isbinaryfile in my package.json:

  "resolutions": {
    "isbinaryfile": "4.0.10"
  }  
@mmaietta
Copy link
Collaborator

Hmmm, I'm not familiar with electron-webpack. Is that part of the electron-builder pipeline? Not sure if this is the correct project to report in

@gravelld
Copy link
Author

Apologies - I got to the containers from the docs here: https://www.electron.build/multi-platform-build#docker - I thought they were this project.

@mmaietta
Copy link
Collaborator

Oh interesting, yes the docker images are. But it looks like your build is compiling with electron-webpack, before electron-builder is actually executing.
Can you try and run with env var DEBUG=electron-builder and report back the logs as to where the build process is stalling?

@gravelld
Copy link
Author

I tried that, but if webpack is running first and failing, is there any point in setting anything for electron-builder? There isn't much output anyway:

yarn install v1.22.19
warning Skipping preferred cache folder "/home/user/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 60.79s.
yarn run v1.22.19
warning Skipping preferred cache folder "/home/user/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
$ yarn compile --production && electron-builder -w --ia32 --dir
warning Skipping preferred cache folder "/home/user/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
$ electron-webpack --production
<s> [webpack.Progress] 0% [0] compiling
<s> [webpack.Progress] 5% [0] building 0/0 modules 0 active 
<s> [webpack.Progress] 5% [0] building 0/1 modules 1 active multi /project/main.js
<s> [webpack.Progress] 5% [0] building 1/1 modules 0 active 
<s> [webpack.Progress] 5% [1] compiling
<s> [webpack.Progress] 10% [1] building 0/0 modules 0 active 
<s> [webpack.Progress] 10% [1] building 0/1 modules 1 active multi /project/main.js
<s> [webpack.Progress] 10% [1] building 1/1 modules 0 active 
<s> [webpack.Progress] 10% [1] building 1/2 modules 1 active /project/node_modules/babel-loader/lib/index.js??ref--4!/project/main.js
<s> [webpack.Progress] 10% [0] building 1/2 modules 1 active /project/node_modules/babel-loader/lib/index.js??ref--4!/project/main.js
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:69:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (/project/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/project/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/project/node_modules/webpack/lib/NormalModule.js:471:10)
    at /project/node_modules/webpack/lib/NormalModule.js:503:5
    at /project/node_modules/webpack/lib/NormalModule.js:358:12
    at /project/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/project/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/project/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /project/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at /project/node_modules/loader-runner/lib/LoaderRunner.js:127:6
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.un
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@mmaietta
Copy link
Collaborator

Ahh, yeah... this isn't something I can solve for then. If you need to set an env var before running webpack, try this approach (webpack/webpack#14532 (comment)) or by using docker's -e env var argument.

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

2 participants