screepers / screeps-launcher

Launcher for the Screeps Private Server
MIT License
133 stars 34 forks source link

Pinned packages needed to build screeps node packages #34

Open shanemadden opened 1 year ago

shanemadden commented 1 year ago

Currently, pinnedPackages configuration is needed to get the screeps packages built successfully by launcher, due to upstream packages releasing versions that break compatibility with node 12.

Creating this issue as a place to collect the needed pins and add to it as necessary.

Known necessary pins so far (see #33)

pinnedPackages:
  ssri: 8.0.1
  cacache: 16.1.3
  passport-steam: 1.0.17
  minipass-fetch: 3.0.3
ewrt101 commented 1 year ago

while running under windows without docker I needed to add node-gyp: 9.4.0 as a pinnedPackages to get a successful build

bdomars commented 1 year ago

Something else seems to be breaking it again, I have the listed pinnedPackages and still run into a build error.

# This file contains the result of Yarn building a package (isolated-vm@npm:2.1.1)
# Script name: install

gyp info it worked if it ends with ok
gyp info using node-gyp@9.4.0
gyp info using node@12.22.12 | linux | x64
gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack /screeps/node_modules/minipass/dist/cjs/index.js:286
gyp ERR! stack         this.emit('abort', this[SIGNAL]?.reason);
gyp ERR! stack                                         ^
gyp ERR! stack
gyp ERR! stack SyntaxError: Unexpected token '.'
gyp ERR! stack     at wrapSafe (internal/modules/cjs/loader.js:915:16)
gyp ERR! stack     at Module._compile (internal/modules/cjs/loader.js:963:27)
gyp ERR! stack     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
gyp ERR! stack     at Module.load (internal/modules/cjs/loader.js:863:32)
gyp ERR! stack     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
gyp ERR! stack     at Module.require (internal/modules/cjs/loader.js:887:19)
gyp ERR! stack     at require (internal/modules/cjs/helpers.js:74:18)
gyp ERR! stack     at Object.<anonymous> (/screeps/node_modules/minipass-fetch/lib/index.js:6:22)
gyp ERR! stack     at Module._compile (internal/modules/cjs/loader.js:999:30)
gyp ERR! stack     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
gyp ERR! System Linux 6.4.9-200.fc38.x86_64
gyp ERR! command "/screeps/deps/node/bin/node" "/screeps/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "4"
gyp ERR! cwd /screeps/node_modules/isolated-vm
gyp ERR! node -v v12.22.12
gyp ERR! node-gyp -v v9.4.0
gyp ERR! Node-gyp failed to build your package.
gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.

Tried to just pin minipass to an earlier version but seems it is a dependency in some other package that still pulls in the latest version of minipass which breaks the build. Maybe? I'm not familiar enough with npm to keep digging.

TuEye commented 1 year ago

I was successful with the following pinnedPackages:

pinnedPackages:
  ssri: 9.0.1
  cacache: 16.1.3
  minipass: 4.2.8
  tar: 5.0.11
  minipass-fetch: 2.1.2
  make-fetch-happen: 10.2.1
msconstante commented 1 year ago

If I add to config.yml:

pinnedPackages:
  ssri: 9.0.1
  cacache: 16.1.3
  minipass: 4.2.8
  tar: 5.0.11
  minipass-fetch: 2.1.2
  make-fetch-happen: 10.2.1

It seems to successfully build isolated-vm, but now I get the error: 2023/09/05 17:52:15 Exec: yarn ➤ YN0000: ┌ Resolution step ➤ YN0000: └ Completed ➤ YN0000: ┌ Fetch step ➤ YN0000: └ Completed in 0s 483ms ➤ YN0000: ┌ Link step ➤ YN0007: │ @screeps/driver@npm:5.2.1 must be built because it never has been before or the last one failed ➤ YN0009: │ @screeps/driver@npm:5.2.1 couldn't be built successfully (exit code 7, logs can be found here: /tmp/xfs-dea2d0b9/build.log) ➤ YN0000: └ Completed in 0s 940ms ➤ YN0000: Failed with errors in 1s 683ms 2023/09/05 17:52:18 exit status 1

I am using the docker-compose.yml and instructions as found in the github website on a Debian12 container under proxmox.

EDIT: Everything seems to compile if I use the first suggestion:

pinnedPackages:
  ssri: 8.0.1
  cacache: 16.1.3
  passport-steam: 1.0.17
  minipass-fetch: 3.0.3
kalgen432 commented 11 months ago

Some direct dependencies seem to have been pushed with new requirements of their own dependencies, even though versions of the directs didn't change. That resulted in cacache 16.1.3 requiring ssri 9.0.0. And some others started requiring node >= 14. Strange. The following worked for me if anyone is up for reproducing and confirming?

pinnedPackages:
  ssri: 8.0.1
  cacache: 15.3.0
  passport-steam: 1.0.17
  minipass-fetch: 2.1.2
  express-rate-limit: 6.7.0
jsProj commented 10 months ago

Something else seems to be breaking it again, I have the listed pinnedPackages and still run into a build error.

# This file contains the result of Yarn building a package (isolated-vm@npm:2.1.1)
# Script name: install

gyp info it worked if it ends with ok
gyp info using node-gyp@9.4.0
gyp info using node@12.22.12 | linux | x64
gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack /screeps/node_modules/minipass/dist/cjs/index.js:286
gyp ERR! stack         this.emit('abort', this[SIGNAL]?.reason);
gyp ERR! stack                                         ^
gyp ERR! stack
gyp ERR! stack SyntaxError: Unexpected token '.'
gyp ERR! stack     at wrapSafe (internal/modules/cjs/loader.js:915:16)
gyp ERR! stack     at Module._compile (internal/modules/cjs/loader.js:963:27)
gyp ERR! stack     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
gyp ERR! stack     at Module.load (internal/modules/cjs/loader.js:863:32)
gyp ERR! stack     at Function.Module._load (internal/modules/cjs/loader.js:708:14)
gyp ERR! stack     at Module.require (internal/modules/cjs/loader.js:887:19)
gyp ERR! stack     at require (internal/modules/cjs/helpers.js:74:18)
gyp ERR! stack     at Object.<anonymous> (/screeps/node_modules/minipass-fetch/lib/index.js:6:22)
gyp ERR! stack     at Module._compile (internal/modules/cjs/loader.js:999:30)
gyp ERR! stack     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
gyp ERR! System Linux 6.4.9-200.fc38.x86_64
gyp ERR! command "/screeps/deps/node/bin/node" "/screeps/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "4"
gyp ERR! cwd /screeps/node_modules/isolated-vm
gyp ERR! node -v v12.22.12
gyp ERR! node-gyp -v v9.4.0
gyp ERR! Node-gyp failed to build your package.
gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.

Tried to just pin minipass to an earlier version but seems it is a dependency in some other package that still pulls in the latest version of minipass which breaks the build. Maybe? I'm not familiar enough with npm to keep digging.

thats node requiring v14.17.0 for the optional chaining operator, so maybe a slightly earlier version of minipass is needed? Any way to make sure it pulls an earlier version?

martydingo commented 10 months ago

There has been a code change in @screeps/engine^4.2.18 that tries to import a non-existent @screeps/core

I've now gotten past this error by configuring

pinnedPackages:
  - '@screeps/engine^4.2.16'
... 
shanemadden commented 10 months ago

There has been a code change in @screeps/engine^4.2.18 that tries to import a non-existent @screeps/core

I've now gotten past this error by configuring

pinnedPackages:
  - '@screeps/engine^4.2.16'
... 

New version of screeps@4.2.16 has been released that fixes this particular problem