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

cabal2nix broken on darwin #49781

Closed
MaxDaten opened this issue Nov 3, 2018 · 9 comments
Closed

cabal2nix broken on darwin #49781

MaxDaten opened this issue Nov 3, 2018 · 9 comments
Labels
6.topic: darwin Running or building packages on Darwin

Comments

@MaxDaten
Copy link

MaxDaten commented Nov 3, 2018

I'm fairly new to nix, not sure if it the right place. I did a fresh install of nix via curl https://nixos.org/nix/install | sh.

And then right after the (single-user) installation, I did nix-env -i cabal2nix, and it fails with:

In file included from lib/osxcode.cpp:30:
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:140:81: error: expected function body after function declarator
CFBundleRef _CFBundleCreateUnique(CFAllocatorRef allocator, CFURLRef bundleURL) API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
                                                                                ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:146:84: error: expected function body after function declarator
CFBundleRef _CFBundleCreateIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url) API_DEPRECATED("Use CFBundleCreate instead", macos(10.6,10.10), ios(2.0,8.0), watchos(2.0,2.0), tvos(9.0,9.0));
                                                                                   ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:156:59: error: expected function body after function declarator
CFURLRef _CFBundleCopyResourceForkURL(CFBundleRef bundle) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos);
                                                          ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:194:175: error: expected function body after function declarator
CF_EXPORT CFStringRef CFBundleCopyLocalizedStringForLocalization(CFBundleRef bundle, CFStringRef key, CFStringRef value, CFStringRef tableName, CFStringRef localizationName) API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
                                                                                                                                                                              ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:222:52: error: expected function body after function declarator
Boolean _CFBundleGetHasChanged(CFBundleRef bundle) API_DEPRECATED("Function no longer supported", macos(10.0,10.13), ios(2.0,11.0), watchos(2.0,4.0), tvos(9.0,11.0));
                                                   ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:225:33: error: expected function body after function declarator
void _CFBundleFlushCaches(void) API_DEPRECATED("Function no longer supported", macos(10.0,10.8), ios(2.0,6.0), watchos(2.0,2.0), tvos(9.0,9.0));
                                ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:228:47: error: expected function body after function declarator
void _CFBundleFlushCachesForURL(CFURLRef url) API_DEPRECATED("Function no longer supported", macos(10.0,10.8), ios(2.0,6.0), watchos(2.0,2.0), tvos(9.0,9.0));
                                              ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:255:59: error: expected function body after function declarator
CFStringRef _CFDoubledStringCreate(CFStringRef theString) API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));
                                                          ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:258:63: error: expected function body after function declarator
CFStringRef _CFAccentuatedStringCreate(CFStringRef theString) API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));
                                                              ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:261:99: error: expected function body after function declarator
CFStringRef _CFAffixedStringCreate(CFStringRef theString, CFStringRef prefix, CFStringRef suffix) API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));
                                                                                                  ^
/nix/store/8v9xplbvxm2ddxv4nhbj21iryb4vmbjc-swift-corefoundation-private/Library/Frameworks/CoreFoundation.framework/Headers/CFBundlePriv.h:264:66: error: expected function body after function declarator
CFStringRef _CFRLORightToLeftStringCreate(CFStringRef theString) API_AVAILABLE(macosx(10.13), ios(11.0), watchos(4.0), tvos(11.0));
                                                                 ^
17 warnings and 11 errors generated.
make[3]: *** [/nix/store/204lvxmsigkgkdv2c0fvkqalxmg4fik5-gnustep-make-2.7.0/share/GNUstep/Makefiles/rules.make:499: obj/security_utilities.obj/lib/osxcode.cpp.o] Error 1
make[2]: *** [/nix/store/204lvxmsigkgkdv2c0fvkqalxmg4fik5-gnustep-make-2.7.0/share/GNUstep/Makefiles/Instance/library.make:278: internal-library-all_] Error 2
make[1]: *** [/nix/store/204lvxmsigkgkdv2c0fvkqalxmg4fik5-gnustep-make-2.7.0/share/GNUstep/Makefiles/Master/rules.make:297: security_utilities.all.library.variables] Error 2
make: *** [/nix/store/204lvxmsigkgkdv2c0fvkqalxmg4fik5-gnustep-make-2.7.0/share/GNUstep/Makefiles/Master/library.make:37: internal-all] Error 2
builder for '/nix/store/xxja1zlr9xqvl4vij85lcf30h5s6yyi5-libsecurity_utilities-osx-10.7.5.drv' failed with exit code 2
cannot build derivation '/nix/store/g2i0xac4g4173561i5lsgn7pncswzmqd-SecurityTool-55115.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/wp5jxbn1gma862cfdkdzcpnncxj487dz-x509-system-1.6.6.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/8ziwh0sxqmvnw8xzd3ibmqpi1sr2xsh2-connection-0.2.8.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/kfs315qrnbmd3qhbldl3fp03qg9mniwn-http-client-tls-0.3.5.3.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/zwfk2676pj2bz6d3m70a44z3x03sq3zs-hpack-0.31.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/gk3vkmc038m1mcfc2rgrbp4nki6dgh2v-cabal2nix-2.11.1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/gk3vkmc038m1mcfc2rgrbp4nki6dgh2v-cabal2nix-2.11.1.drv' failed

Any ideas how to solve this?

@MaxDaten MaxDaten changed the title Build fails macOS 10.14.2 Beta (18C31g) Build fails on macOS 10.14.2 Beta (18C31g) Nov 3, 2018
@peti
Copy link
Member

peti commented Nov 5, 2018

Personally, I have no idea what those errors mean. Pinging @shlevy and @domenkozar, who might be able to help. In any case, this bug is probably better reported at https://github.com/nixos/nixpkgs since it doesn't look like it's related to cabal2nix itself.

@domenkozar
Copy link
Member

Most probably needs a bump of swift-corefoundation-private.

@domenkozar domenkozar transferred this issue from NixOS/cabal2nix Nov 5, 2018
@wildsebastian
Copy link
Contributor

We discussed the issue on the nix-darwin irc yesterday. This should be fixed by #49768. It not only happens on the latest beta of macOS, but also 10.13 as well as the stable 10.14 and 10.14.1.

@MaxDaten
Copy link
Author

MaxDaten commented Nov 5, 2018

Okay, thanks for the clarification and moving the issue to the correct place. I will try the fix as soon it landed.

@LnL7 LnL7 changed the title Build fails on macOS 10.14.2 Beta (18C31g) cabal2nix broken on darwin Nov 5, 2018
@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Nov 13, 2018
@pshemass
Copy link

I'm interested in fix for that however I don't really have enough knowledge about Nix to know what is the process of release fixes like that.
I see that PR been merged but what next? should this be available in unstable channel already?

@MaxDaten
Copy link
Author

I'm interested in fix for that however I don't really have enough knowledge about Nix to know what is the process of release fixes like that.
I see that PR been merged but what next? should this be available in unstable channel already?

Let's find out together ;) I'm a completly novice to the nix eco-system, but I found some parts:

  1. http://howoldis.herokuapp.com/ You can see here, how old the corresponding channels are. For example nixpkgs-unstable is currently 2 hours ago. What does this mean? Let's investigate and click the channel.
  2. https://releases.nixos.org/nixpkgs/nixpkgs-19.03pre158299.efe6322ce4c You can see the git commit the channel is based on and the corresponding hydra evaluation
  3. https://hydra.nixos.org/eval/1488172 Here you see the evaluation of the current channel version. What does this mean? Hydra is building packages continuously based on new git commits and this will update channels regularly. (not sure about the rules when exactly, but there are some test matrices)
  4. When search for cabal2nix, I will recieve following for the current nixpkg-unstable channel evaluation: https://hydra.nixos.org/eval/1488172?filter=cabal2nix&compare=1488136&full=#tabs-still-succeed

So I assume it should be possible to install cabal2nix (because hydra was able to build it successfully). But maybe hydra differs in the macOS version.

I did following:

$ nix-channel --list
nixpkgs-unstable
$ nix-channel --update
$ nix-env -i cabal2nix

But this was unsuccessful on my machine.

I'm currently still in the build progress of:

$ nix-env -iA 'nixpkgs.haskellPackages.cabal2nix'

Not sure what the exact difference between cabal2nix and nixpkgs.haskellPackages.cabal2nix is.

After clicking here https://hydra.nixos.org/build/83848234 hydra offers a possibility to install from binary cache:

nix-env -i /nix/store/ksasgf87kk7289hx4k6fs8xm3n51l0r2-cabal2nix-2.11.1 --option binary-caches https://cache.nixos.org

I will try this next.

@pshemass
Copy link

it's already in unstable channel.

@LnL7
Copy link
Member

LnL7 commented Nov 17, 2018

@MaxDaten The output of nix-channel --list isn't complete. But if you named the channel nixpkgs-unstable you then have to use that as the prefix.

$ nix-env -iA nixpkgs-unstable.cabal2nix

And with this you can query the current version of channels on your system.

$ nix-env -p ~/.nix-defexpr/channels -q
nixpkgs-unstable-19.03pre159144.0249f7d48af
$ nix-env -p /nix/var/nix/profiles/per-user/root/channels -q  # only for multi-user
nixos-18.09.1228.a4c4cbb613c

@MaxDaten
Copy link
Author

MaxDaten commented Nov 23, 2018

Hi,

currently still problems:

$ nix-channel --list                                                                                                                                                                                                
nixpkgs https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --update
$ nix-env -p ~/.nix-defexpr/channels -q                                                                                                                                                                             
nixpkgs-19.03pre159739.3ae0407d3c9

and calling:

$ nix-env -iA nixpkgs.cabal2nix

Results:

running test tests/nix-copy-ssh.sh... [PASS]
2 out of 53 tests failed 
make: *** [mk/tests.mk:12: installcheck] Error 1
builder for '/nix/store/4j4v6iw5fbddjh1nq7w9i1cq7s7l2wb3-nix-2.1.3.drv' failed with exit code 2
cannot build derivation '/nix/store/11yc51mgp1sazp20ajra5h0frw5r4pby-cabal2nix-2.11.1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/11yc51mgp1sazp20ajra5h0frw5r4pby-cabal2nix-2.11.1.drv' failed

See the attached log:
log.txt

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

No branches or pull requests

6 participants