Skip to content

Commit

Permalink
improve agd build handling of corepack (#10010)
Browse files Browse the repository at this point in the history
closes: #10009

## Description
Makes sure all packages in the repo use the same yarn version when using corepack
Prevent the `agd build` script from hanging if corepack is enabled but the package manager is not installed.
Fail if autodownload not allowed, install otherwise.

### Security Considerations
None

### Scaling Considerations
None

### Documentation Considerations
We need to review this as part of #9769, but an error is better than a hang. I'm not sure why I started hitting this issue now.

### Testing Considerations
Manually tested. I don't think any CI exercises `agd build`, and even less with `corepack enable`d

### Upgrade Considerations
None
  • Loading branch information
mergify[bot] authored Aug 31, 2024
2 parents 97e3f7b + 42e2b00 commit 45b9216
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion golang/cosmos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"engines": {
"node": "^18.12 || ^20.9"
},
"packageManager": "[email protected].19",
"packageManager": "[email protected].22",
"scripts": {
"test": "exit 0",
"build:all": "make",
Expand Down
3 changes: 3 additions & 0 deletions scripts/agd-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ else
fi

if $need_nodejs; then
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export COREPACK_ENABLE_NETWORK=$($SKIP_DOWNLOAD && echo 0 || echo 1)

# We need to get node at the script top level because it's used by the daemon
# as well.
case $(node --version 2> /dev/null) in
Expand Down

0 comments on commit 45b9216

Please sign in to comment.