Skip to content

Commit

Permalink
fix: Force arch when running in a bun postinstall process (moonrepo#1258
Browse files Browse the repository at this point in the history
)

* chore: detects when postinstall is being ran via moon on arm64

* chore: yarn versioning

* chore: bump core packages

* chore: comments following pr
  • Loading branch information
elmpp authored Jan 6, 2024
1 parent 41a6085 commit eb608b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .yarn/versions/baeeda33.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
releases:
"@moonrepo/cli": patch
"@moonrepo/core-linux-arm64-gnu": patch
"@moonrepo/core-linux-arm64-musl": patch
"@moonrepo/core-linux-x64-gnu": patch
"@moonrepo/core-linux-x64-musl": patch
"@moonrepo/core-macos-arm64": patch
"@moonrepo/core-macos-x64": patch
"@moonrepo/core-windows-x64-msvc": patch
3 changes: 2 additions & 1 deletion packages/cli/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const isMacos = process.platform === 'darwin';
const isWindows = process.platform === 'win32';

const platform = isWindows ? 'windows' : isMacos ? 'macos' : process.platform;
const parts = [platform, process.arch];
const arch = process.env['npm_config_user_agent'] && process.env['npm_config_user_agent'].match(/^bun.*arm64$/) ? 'arm64' : process.arch; // https://github.com/moonrepo/moon/issues/1103
const parts = [platform, arch];

if (isLinux) {
const { familySync } = require('detect-libc');
Expand Down

0 comments on commit eb608b9

Please sign in to comment.