Skip to content
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

crabz: fix darwin build #143861

Merged
merged 1 commit into from
Nov 6, 2021
Merged

crabz: fix darwin build #143861

merged 1 commit into from
Nov 6, 2021

Conversation

figsoda
Copy link
Member

@figsoda figsoda commented Oct 30, 2021

Motivation for this change
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@r-burns
Copy link
Contributor

r-burns commented Oct 30, 2021

Hmm, this is still failing for me with the same error:

   Compiling crabz v0.7.2 (/private/tmp/nix-build-crabz-0.7.2.drv-0/source)
error: linking with `/nix/store/s5yid9p7xgdn2bnh6yys2817y1a71jpr-clang-wrapper-7.1.0/bin/cc` fa
  |
  = note: "/nix/store/s5yid9p7xgdn2bnh6yys2817y1a71jpr-clang-wrapper-7.1.0/bin/cc" "-m64" "-arc
  = note: ld: framework not found System
          clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `crabz` due to previous error

@figsoda
Copy link
Member Author

figsoda commented Oct 31, 2021

hmm... How do I get the System framework then 🤔

@r-burns
Copy link
Contributor

r-burns commented Oct 31, 2021

Weird, couldn't find it anywhere in nixpkgs. There's an entry here: https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/OSX_Technology_Overview/SystemFrameworks/SystemFrameworks.html

System.framework first available 10.0, "do not use"

@figsoda
Copy link
Member Author

figsoda commented Oct 31, 2021

added an ugly patch to make it compile, can you confirm that it works?

@r-burns
Copy link
Contributor

r-burns commented Oct 31, 2021

lol. surely there should be an easier way to do this? I feel like patching the cargo vendor tarball should not be this difficult. Is there a rust maintainer team we can ping?

@figsoda
Copy link
Member Author

figsoda commented Oct 31, 2021

I don't think there is a rust maintainer team, I hope there is a easier way to patch vendored sources but I couldn't find any

@happysalada
Copy link
Contributor

I checked a bit, that https://github.com/Elzair/core_affinity_rs crate is 4 years old, with very little updates, that is why it is relying on an outdated framework.
Regarding patching the vendored source, I only know about cargoPatches but it's for a different purpose (patching the cargo file). I checked as well if there was no way to influence compilation with a feature flag, but it doesn't seem so.
Sorry I couldn't be of more help.

@r-burns
Copy link
Contributor

r-burns commented Oct 31, 2021

No worries, really appreciate you taking a look.

In that case, this looks good to me as a stopgap. It might be a good idea to pester upstream to remove this outdated crate from their dependency graph.

@happysalada
Copy link
Contributor

Agreed about talking to upstream if possible.

@figsoda
Copy link
Member Author

figsoda commented Oct 31, 2021

I opened an issue upstream to remove the dependency on core_affinity

@domenkozar domenkozar merged commit 4c23c40 into NixOS:master Nov 6, 2021
@figsoda figsoda deleted the crabz-fix-darwin branch November 10, 2021 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants