Verible: compile on Linux and Darwin.#214797
Conversation
|
@ofborg build verible |
|
Attempting to compile on Darwin fails on Arm and x86. The compiler fails to find the
Adding @aherrmann @ylecornec who are bazel on nix maintainers. |
|
This looks like #150655 |
|
CC: @NixOS/bazel |
There was a problem hiding this comment.
Note that the hashes are per architecture, not per platform, is that correct? If so can you specify them by arch? That way if it becomes per platform later on it's more obviously a regression.
There was a problem hiding this comment.
I am not sure, but you're right, it does look like only the architecture is influencing the hash as the derivation worked up to that point (the compile failed afterwards).
The objective of this change is foremost to get Darwin to compile (which it does not quite yet, which seems to be a bazel issue), then I might simplify that to extract the arch first and make the hashes depend on the arch. One step at a time: Initially I only want to change the minimum to introduce Darwin.
What is the best way to get the architecture ? I am thinking of something like
arch = lib.elemAt (lib.splitString "-" stdenv.hostPlatform.system) 0;
There was a problem hiding this comment.
Something like:
if stdenv.isx86_64 then ...
else if stdenv.isAarch64 then ...
else throw "Unsupported architecture";
|
Did you manage to get the info you needed from #150655 and the PRs that reference it? I think you're right to think that's the issue, let me know if you need pointers on how to work around it. |
Widening the scope of compiled platforms to include Darwin (was: Linux only). Signed-off-by: Henner Zeller <h.zeller@acm.org>
36e1224 to
b50da2c
Compare
|
I am now trying the workaround from #145149 |
|
@ofborg build verible |
|
The workaround to tell the compiler that we compile c++ here seems to get things a bit further but ultimately still fail. C++ files compile (headers are found this time), but then the resulting binaries fail to execute with the following error:
Probably someone knowing how the compiler-set-up on Darwin is can help here. From what I gather, this is dynamically linked binaries not working. |
|
I could repro it locally, notice the difference between the linting binary built outside of nixpkgs and inside nixpkgs: Outside: Inside: It looks like it's missing a couple of libraries that the default toolchain links to automatically, but the nixpkgs one doesn't. |
|
Closing for now, looks like Darwin builds with bazel don't work yet, and I don't have any Darwin machine to test locally. |
|
i don't have much experience in fixing nix package builds but i have a mac, is there any way i can help to fix this? @hzeller |
|
I don't know - I think a big problem is that clang and bazel on nixos don't work together well, but since I don't have a Mac, I don't fully understand what is broken. Suspicion is, that #216047 and #150655 might have something to do with it. I guess a good start for you would be to |
Widening the scope of compiled platforms to include Darwin (was: Linux only).
Description of changes
Widen the systems to compile on by adding necessary derivation hashes.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes