Skip to content

Commit

Permalink
Fix compilation of buildpack on ARM64 (#359)
Browse files Browse the repository at this point in the history
Previously it wasn't possible to compile the Rust parts of the
buildpack on ARM64 (such as when using an M1 Macbook),
since the compile failed with:

```
error[E0425]: cannot find value `ARCH` in this scope
  --> common/nodejs-utils/src/inv.rs:45:45
   |
45 |         let platform = format!("{}-{}", OS, ARCH);
   |                                             ^^^^ not found in this scope
   |
help: consider importing this constant
   |
1  | use std::env::consts::ARCH;
   |
```

This makes contributing to the buildpack from an M1 machine
frustrating, since one has to comment out the architecture
conditional every time, then remember not to include it in
the commit with the other changes.

At such time as the Node.js buildpack fully supports ARM64
Docker images, conditionals can be added back with the
appropriate platform values.

GUS-W-11817789.
  • Loading branch information
edmorley authored Sep 27, 2022
1 parent a6a4601 commit 7863181
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion common/nodejs-utils/src/inv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub const OS: &str = "darwin";
pub const OS: &str = "linux";

/// Default/assumed architecture for node release lookups
#[cfg(target_arch = "x86_64")]
pub const ARCH: &str = "x64";

/// Represents a software inventory with releases.
Expand Down

0 comments on commit 7863181

Please sign in to comment.