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

go get breaks with "ld: framework not found CoreFoundation" #80177

Closed
r-darwish opened this issue Feb 15, 2020 · 5 comments
Closed

go get breaks with "ld: framework not found CoreFoundation" #80177

r-darwish opened this issue Feb 15, 2020 · 5 comments
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin

Comments

@r-darwish
Copy link

Describe the bug
Using macOS 10.15.3 for starting with go development. I installed Go 1.13.7 using nix and followed these instructions. However, go get breaks with:

/nix/store/fws3qldkjn3mc183sa7ny1pk469z9w9a-go-1.13.7/share/go/pkg/tool/darwin_amd64/link: running /nix/store/2mf11yf4ggz39f1ryhwg528qfn9g5mbj-clang-wrapper-7.1.0/bin/cc failed: exit status 1
ld: framework not found CoreFoundation
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

I've seen #9329 and #10263 but I'm not sure if they're relevant as they are old and closed.

Compilation worked when I used Go 1.13.8 from Homebrew

To Reproduce
Steps to reproduce the behavior:

  1. nix-env -i go
  2. export GO111MODULE=on
  3. go get github.com/micro/micro/v2

Expected behavior
Compilation should work

Metadata

 - system: `"x86_64-darwin"`
 - host os: `Darwin 19.3.0, macOS 10.15.3`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.2`
 - channels(roey): `"nixpkgs-20.03pre212770.cc1ae9f21b9"`
 - channels(root): `"nixpkgs-20.03pre212770.cc1ae9f21b9"`
 - 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:
@r-darwish r-darwish added the 0.kind: bug Something is broken label Feb 15, 2020
@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Feb 16, 2020
@LnL7
Copy link
Member

LnL7 commented Feb 17, 2020

It looks like this is during the build rather not the download. In which case this is expected, "installing" built time dependencies doesn't really work with nix. Compilers and interpreters generally need a build environment, see https://nixos.wiki/wiki/FAQ/I_installed_a_library_but_my_compiler_is_not_finding_it._Why%3F for more details.

@r-darwish
Copy link
Author

Makes sense. However, I'm not sure which library should I add to buildInputs as CoreFoundation is a macOS system library, isn't it?

Also, should I close this issue if it's not really a bug?

@stale
Copy link

stale bot commented Aug 16, 2020

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 16, 2020
@clord
Copy link

clord commented Apr 19, 2021

his could be related to the changes made to macos dynamic loader, system libs are no longer present in the file system and can only be found with dlopen. solution would be to not stat before dlopen.

New in macOS Big Sur 11.0.1, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to dlopen() the path, which will correctly check for the library in the cache. (62986286)

@toonn
Copy link
Contributor

toonn commented Apr 20, 2021

I believe thefloweringash has made these changes in #105026.
Nixpkgs does provide darwin.CF which is the swift-corelibs-foundation implementation of CoreFoundation.

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 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

No branches or pull requests

5 participants