yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.41k stars 1.11k forks source link

[Bug?]: GH action CI - `enableInlineBuilds: true` does nothing #5189

Closed frichtarik closed 1 month ago

frichtarik commented 1 year ago

Self-service

Describe the bug

we have a monorepo with SPA react application in single workspace which have husky enabled (git hook tool, v8.0.3)

"scripts": {
        "postinstall": "husky install"
}

as a part of GH action, i setup config file

yarn config set -H npmAuthIdent ${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_TOKEN }}
yarn config set -H npmAlwaysAuth true

which works properly as the build fetch packages from private repository

and then i run yarn workspaces focus --all --production

which tries to build only dependencies (confirmed by different package count)

BUT it fails for me every time on link step, running postinstall script with following log in GHA

Run yarn workspaces focus --production --all
➤ YN0000: ┌ Resolution step
Resolution step
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
Fetch step
➤ YN0000: └ Completed in 12s 987ms
➤ YN0000: ┌ Link step
Link step
  ➤ YN0007: │ product-ui@workspace:. must be built because it never has been before or the last one failed
  ➤ YN0007: │ browser-tabs-lock@npm:1.2.15 must be built because it never has been before or the last one failed
  ➤ YN0007: │ core-js@npm:3.[26].1 must be built because it never has been before or the last one failed
  ➤ YN0000: │ product-ui@workspace:. STDERR command not found: husky
  ➤ YN0009: │ product-ui@workspace:. couldn't be built successfully (exit code 127, logs can be found here: /tmp/xfs-affee001/build.log)
  ➤ YN0000: │ browser-tabs-lock@npm:1.2.15 STDOUT Thank you for using browser-tabs-lock ( https://github.com/supertokens/browser-tabs-lock ).
  ➤ YN0000: │ browser-tabs-lock@npm:1.2.15 STDOUT 
  ➤ YN0000: │ browser-tabs-lock@npm:1.2.15 STDOUT This library was created as a part of a larger project, SuperTokens( https://supertokens.io ) - an open source auth solution.
  ➤ YN0000: │ browser-tabs-lock@npm:1.2.15 STDOUT You can also check out our other projects on https://github.com/supertokens
  ➤ YN0000: │ browser-tabs-lock@npm:1.2.15 STDOUT 
➤ YN0000: └ Completed in 4s 998ms
➤ YN0000: Failed with errors in 18s 142ms
Error: Process completed with exit code 1.

docs says that postinstall is run even when scripts are disabled via enableScripts: false, which is unfortunate

and my problem is in the log message couldn't be built successfully (exit code 127, logs can be found here: /tmp/xfs-affee001/build.log)

the issue is that tmp folder is not accessible on GH-hosted runner, and enabling enableInlineBuilds: true did nothing for me ... any ideas ?

To reproduce

WIP

Environment

WIP

Additional context

No response

merceyz commented 1 year ago

The build output was inlined and is inlined by default on the CI, the line right above the line you quoted contains the output.

  ➤ YN0000: │ product-ui@workspace:. STDERR command not found: husky
  ➤ YN0009: │ product-ui@workspace:. couldn't be built successfully (exit code 127, logs can be found here: /tmp/xfs-affee001/build.log)
frichtarik commented 1 year ago

The build output was inlined and is inlined by default on the CI, the line right above the line you quoted contains the output.

  ➤ YN0000: │ product-ui@workspace:. STDERR command not found: husky
  ➤ YN0009: │ product-ui@workspace:. couldn't be built successfully (exit code 127, logs can be found here: /tmp/xfs-affee001/build.log)

does that mean that one message is the whole content of build.log file ? i didn't notice any change on GHA, obviously because it's TRUE by default on CI, but why does it have no difference when i enable disable inline option on my local Mac?

frichtarik commented 1 month ago

not replicable, not saying it's fixed