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
Fix Flutter's reference to the arch
binary on macOS
#295650
Conversation
Sorry about causing the issue. I don’t know how that worked for me when the binary clearly isn’t there. |
Wait, how can this work? |
Yeah, you're completely correct, I overlooked that the other places where this is used, the replaced command is I'm not sure what the best way to fix this is then? Is there some other place where Nix provides an |
I am not aware of any. It should theoretically reside in |
Instead of packaging a separate one, can we fix the system_cmds derivation to provide the missing command? At worst, it ignores the Xcode project and builds the command directly. I plan to update the _cmds derivations eventually (once I can recover my Meson build files but also after the SDK and other stuff I need to do), but that should be an easy fix. |
There's a trivial fix, without Rosetta support (apple-oss-distributions/system_cmds@8579bd4), though. diff --git a/arch.tproj/arch.c b/arch.tproj/arch.c
index 4152bf0..c2c24b5 100644
--- a/arch.tproj/arch.c
+++ b/arch.tproj/arch.c
@@ -75,9 +75,10 @@ static const CPUTypes knownArchs[] = {
#if defined(__i386__) || defined(__x86_64__)
{"i386", CPU_TYPE_I386},
{"x86_64", CPU_TYPE_X86_64},
+#elif defined(__arm64__)
+ {"arm64", CPU_TYPE_ARM64},
#elif defined(__arm__)
{"arm", CPU_TYPE_ARM},
-#endif
#else
#error "Unsupported architecture"
#endif
@@ -99,10 +100,12 @@ extern char **environ;
#if defined(__i386__) || defined(__x86_64__)
#define NATIVE_32 "i386"
#define NATIVE_64 "x86_64"
+#elif defined(__arm64__)
+#define NATIVE_64 "arm64"
+#define NATIVE_32 NULL
#elif defined(__arm__)
#define NATIVE_32 "arm"
#define NATIVE_64 NULL
-#endif
#else
#error "Unsupported architecture"
#endif
|
I was able to recover my work on updating system_cmds to 970.0.4. I’m going to open an update PR this weekend once I confirm the stdenv bootstrap builds for both Darwin platforms. I was hoping to wait until after the newer SDKs were added, but it would be better to land it now instead of adding workarounds that are fixed with an update. |
#296321 is the PR to update system_cmds. It builds |
26d3828
to
95520e1
Compare
I've gotten the project cloned locally, but just running Would you mind a lot if I just changed this PR to use |
That PR was landed on staging, it'll take weeks for it to land on master.
I'm OK with that. |
The `arch` binary is not available in `darwin.adv_cmds`, it is provided via. `darwin.system_cmds` instead, but support for this is still experimental.
95520e1
to
04ef11c
Compare
Ah, makes sense.
Cool, I've done that then. |
Description of changes
darwin.adv_cmds
contains noarch
binary, the correct binary is instead provided via.stdenv.hostPlatform.darwinArch
, for an example of how this is done elsewhere see moarvm. This mistake was introduced in #286750 (comment), CC @reckenrode.I'm with limited internet today, so have done this through the GitHub UI and haven't tested this locally (as I'd have to clone the
nixpkgs
repo). Feel free to squash the changes with a proper Git commit message, I think I failed to follow the guidelines on that.Pinging package maintainers @babariviere @ericdallo @FlafyDev @hacker1024.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)