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

ROOT doesn't compile on Big Sur but the binary cache works #128576

Closed
yipengsun opened this issue Jun 29, 2021 · 5 comments
Closed

ROOT doesn't compile on Big Sur but the binary cache works #128576

yipengsun opened this issue Jun 29, 2021 · 5 comments
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin

Comments

@yipengsun
Copy link
Contributor

Describe the bug
I'm trying to get my colleagues (bosses, really) to start using nix. Both are on macOS; one on Big Sur, the other Catalina.

Because we need to apply patches to root, we need to compile it on both platforms. On Big Sur, I got the following error message when trying to compile root that comes straight from nixpkgs:

Scanning dependencies of target Cling
[ 79%] Linking CXX shared library ../../../lib/libCling.so
[ 79%] Built target Cling
[ 79%] Built target G__Core
Scanning dependencies of target Core
[ 79%] Linking CXX shared library ../lib/libCore.so
ld: framework not found CoreSymbolication
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [core/CMakeFiles/Core.dir/build.make:502: lib/libCore.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:24441: core/CMakeFiles/Core.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
error: builder for '/nix/store/qvh9x3wys8lvw6lp02agr8qbcppd3bgw-root-6.24.00.drv' failed with exit code 2;
       last 10 log lines:
       > [ 79%] Linking CXX shared library ../../../lib/libCling.so
       > [ 79%] Built target Cling
       > [ 79%] Built target G__Core
       > Scanning dependencies of target Core
       > [ 79%] Linking CXX shared library ../lib/libCore.so
       > ld: framework not found CoreSymbolication
       > clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
       > make[2]: *** [core/CMakeFiles/Core.dir/build.make:502: lib/libCore.so] Error 1
       > make[1]: *** [CMakeFiles/Makefile2:24441: core/CMakeFiles/Core.dir/all] Error 2
       > make: *** [Makefile:171: all] Error 2
       For full logs, run 'nix log /nix/store/qvh9x3wys8lvw6lp02agr8qbcppd3bgw-root-6.24.00.drv'.

But the binary cache works on Big Sur. On Catalina, both compilation and binary cache work fine.

To Reproduce
Steps to reproduce the behavior:

  1. nix-build --check -A root '<nixpkgs>'

Expected behavior
root should build and link w/o problem.

Notify maintainers

@veprbl

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

This is on macOS Big Sur.

  • system: "x86_64-darwin"
  • host os: Darwin 20.3.0, macOS 10.16
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.4pre20210604_8e6ee1b
  • channels(root): "nixpkgs-21.11pre295670.189a1368878"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixpkgs

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@yipengsun yipengsun added the 0.kind: bug Something is broken label Jun 29, 2021
@veprbl
Copy link
Member

veprbl commented Jun 29, 2021

Seems like it is coming from
https://github.com/root-project/root/blob/a89eb12f83228833842813c4b690a2033778316b/core/CMakeLists.txt#L150
I suppose you should also have /System/Library/PrivateFrameworks/CoreSymbolication.framework edit: I see you've already investigated this.
Would be nice to see compilation logs of root.overrideAttrs (_: { NIX_DEBUG=1; })

@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Jun 29, 2021
@veprbl
Copy link
Member

veprbl commented Jun 29, 2021

cc @NixOS/darwin-maintainers @thefloweringash for suggestions

@thefloweringash
Copy link
Member

It looks like it should be an easy fix: use the framework stub for CoreSymbolication. I've opened a PR (#128581) but have run out of time to test it right now.

domenkozar pushed a commit that referenced this issue Jun 29, 2021
The current build works by linking against CoreSymbolication in
/System/Library/PrivateFrameworks. This is impure and doesn't work in
newer versions of macOS.

See #128576
github-actions bot pushed a commit that referenced this issue Jun 29, 2021
The current build works by linking against CoreSymbolication in
/System/Library/PrivateFrameworks. This is impure and doesn't work in
newer versions of macOS.

See #128576

(cherry picked from commit 55dcd99)
@yipengsun
Copy link
Contributor Author

I put some of your changes to an overlay and it now is compiling fine on Big Sur. Many Thanks!

BTW, how'd I override the apple_sdk attribute for the darwin package? I tried the following:

final: prev:

{
  darwin = prev.darwin // { 
    apple_sdk_10_12 = prev.callPackage ./apple-sdk {
      inherit (prev.buildPackages.darwin) print-reexports;
      inherit (prev.darwin) darwin-stubs;
    };
  };
  root = prev.callPackage ./root {
    python = final.python3;
    inherit (final.darwin.apple_sdk.frameworks) Cocoa CoreSymbolication OpenGL;
    noSplash = true;
  };
}

But nix still complains about CoreSymbolication not found.

jonringer pushed a commit that referenced this issue Jul 1, 2021
The current build works by linking against CoreSymbolication in
/System/Library/PrivateFrameworks. This is impure and doesn't work in
newer versions of macOS.

See #128576

(cherry picked from commit 55dcd99)
@vcunat vcunat closed this as completed Jul 5, 2021
@yipengsun
Copy link
Contributor Author

Just want to report back that with latest unstable branch, ROOT compiles fine on Big Sur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

4 participants