-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
ocamlPackages.ocaml: build fails on aarch64-apple-darwin #144785
Comments
I reran the build with |
Last successful build: https://hydra.nixos.org/build/151577668 The latter provides the range of changes: c12858..f16e0e. Bisecting with Which is great. we can find the first broken build there: https://hydra.nixos.org/build/157648264 This needs a bit more bisecting to figure out, but it definitely used to work. |
#133008 looks like it could be the reason, cc @symphorien |
It fails in master branch while configuring like this:
With the following change it compiles: diff --git a/pkgs/development/compilers/ocaml/generic.nix b/pkgs/development/compilers/ocaml/generic.nix
index e4cec4cf52e..ae6acfe0195 100644
--- a/pkgs/development/compilers/ocaml/generic.nix
+++ b/pkgs/development/compilers/ocaml/generic.nix
@@ -64,7 +64,6 @@ stdenv.mkDerivation (args // {
"-target ${stdenv.targetPlatform.config}"
];
dontAddStaticConfigureFlags = lib.versionOlder version "4.08";
- configurePlatforms = lib.optionals (lib.versionAtLeast version "4.08") [ "host" "target" ];
# x86_64-unknown-linux-musl-ld: -r and -pie may not be used together
hardeningDisable = lib.optional (lib.versionAtLeast version "4.09" && stdenv.hostPlatform.isMusl) "pie";
Hopefully this gives somebody a clue on how to fix this properly. |
I could build all of |
cc @vbgl |
Describe the bug
Building OCaml 4.12.0 fails on aarch64-apple-darwin (Apple Silicon). It fails most of the way through the build process. According to the build output, it runs the following:
I checked the
nix log
of ocaml on my x86_64-apple-darwin machine, here's the corresponding commands there:So the x86-64 build runs
clang -arch x86_64
as its assembler, but the aarch64 build runsaarch64-apple-darwin-clang
instead, which doesn't exist. One might assumeclang -arch aarch64
would have worked.Running
nix-shell -A ocaml '<nixpkgs>' --run env
on both machines shows that the only reference toAS
on the x86-64 machine is the lineAS=as
, but on the aarch64 machine it also has apreConfigure
hook has an interesting definition:nixpkgs/pkgs/development/compilers/ocaml/generic.nix
Lines 79 to 82 in 6f6f476
Of course, the build log shows
aarch64-apple-darwin-clang
is being invoked, notcc
, and the x86-64 version isn't runningas
either, so I don't know how this leads to the attempted invocation ofaarch64-apple-darwin-clang
.This preConfigure hook change was added in #114525, and I would assume it worked at that point, so I don't know why it's broken now.
Steps To Reproduce
Steps to reproduce the behavior:
nix-build -A ocaml '<nixpkgs>'
Expected behavior
It should build correctly
Notify maintainers
@bobrik
Metadata
Maintainer information:
The text was updated successfully, but these errors were encountered: