-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore(release): stop publishing prebuilt macos x64 binaries #12702
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,6 @@ if [ "$PUBLISH_PLATFORM_PACKAGES" != "0" ]; then | |
| linux-x64 | ||
| linux-arm64 | ||
| linux-armv7 | ||
| macos-x64 | ||
| macos-arm64 | ||
| ) | ||
| for platform in "${platforms[@]}"; do | ||
|
|
@@ -100,6 +99,11 @@ function installArchSpecificPackage(version) { | |
| var platform = process.platform == 'win32' ? 'windows' : process.platform; | ||
| var arch = platform == 'windows' && process.arch == 'ia32' ? 'x86' : process.arch; | ||
|
|
||
| if (platform == 'darwin' && arch == 'x64') { | ||
| console.error('mise does not provide prebuilt binaries for Intel macOS'); | ||
| return process.exit(1); | ||
| } | ||
|
Comment on lines
+102
to
+105
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Node runs under Rosetta on Apple Silicon, Knowledge Base Used: Packaging and release automation
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| var cp = spawn(platform == 'windows' ? 'npm.cmd' : 'npm', ['install', '--no-save', ['$NPM_PLATFORM_PREFIX', platform, arch].join('-') + '@' + version], { | ||
| stdio: 'inherit', | ||
| shell: true | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -621,6 +621,9 @@ impl SelfUpdate { | |
| } | ||
|
|
||
| pub(crate) fn is_available() -> bool { | ||
| if cfg!(all(target_os = "macos", target_arch = "x86_64")) { | ||
| return false; | ||
| } | ||
|
cursor[bot] marked this conversation as resolved.
Comment on lines
+624
to
+626
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Do not let
Proposed fix impl SelfUpdate {
pub(crate) async fn run(self) -> Result<()> {
+ if cfg!(all(target_os = "macos", target_arch = "x86_64")) {
+ bail!("self-update is unavailable on native macOS x86_64");
+ }
if !Self::is_available() && !self.force {🤖 Prompt for AI Agents |
||
| if let Some(b) = *env::MISE_SELF_UPDATE_AVAILABLE { | ||
| return b; | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: jdx/mise
Length of output: 188
🏁 Script executed:
Repository: jdx/mise
Length of output: 20147
🌐 Web query:
Node.js process.arch x64 architecture of Node.js binary Apple Rosetta process.platform darwin sysctl.proc_translated💡 Result:
In Node.js, process.arch returns the architecture for which the Node.js binary itself was compiled, not the underlying CPU architecture [1]. On macOS systems with Apple Silicon, if you are running an x64 version of Node.js via the Rosetta 2 translation layer, process.arch will return 'x64' [2][3][4]. To programmatically determine if a process is currently being translated by Rosetta 2 on macOS, you can query the sysctl variable sysctl.proc_translated [2][5][6]. A value of 1 indicates the process is running under Rosetta translation, while 0 indicates a native process [2][5][6]. On Intel-based Macs or non-macOS platforms, this sysctl key does not exist, and attempting to query it may result in an error (e.g., ENOENT) if not handled properly [2][6][7]. Recommended approach for checking Rosetta status: const { spawnSync } = require('child_process'); function isRunningUnderRosetta { if (process.platform!== 'darwin') return false; try { // Queries the sysctl value. Returns 1 for Rosetta, 0 for native. const result = spawnSync('sysctl', ['-in', 'sysctl.proc_translated'], { encoding: 'utf8' }); return result.stdout.trim === '1'; } catch (err) { // Handle cases where sysctl command might not be available or fails return false; } } When building native Node.js dependencies, it is important to be aware of the environment's architecture, as running a translated x64 binary can lead to architecture mismatches during compilation [6][8]. Developers often use tools like cpu-arch or similar utilities to reliably distinguish between the process architecture and the host system's hardware architecture [3][9][10][8].
Citations:
Preserve Apple Silicon support under Rosetta.
When npm uses an x86_64 Node.js process under Rosetta,
process.platformisdarwinandprocess.archisx64. This guard exits before selecting the availabledarwin-arm64package. Detectsysctl.proc_translated == 1and setarchtoarm64before rejecting native Intel macOS.🤖 Prompt for AI Agents