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

stdenv/darwin: integrate a new CoreFoundation #46704

Merged
merged 1 commit into from Sep 15, 2018

Conversation

copumpkin
Copy link
Member

This also updates the bootstrap tool builder to LLVM 5, but not the ones we actually use for bootstrap. I'll make that change in a subsequent commit so as to provide traceable provenance of the bootstrap tools.

Motivation for this change

We have a horribly out of date CoreFoundation in our stdenv and this should modernize it a bit, allowing us to finally advance some other packages and also remove some workarounds.

Things done

Here's an evaluation of the last state of this prior to me rebasing onto staging. I didn't feel like running a whole new eval after rebasing. Note that I also added the CFFileDescriptor.h stuff to support watchman properly since that eval, so if it complains that watchman is now failing, it's actually healthy again.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@copumpkin copumpkin added the 6.topic: darwin Running or building packages on Darwin label Sep 15, 2018
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
"tcp_open" "tcp_write_queue_order" "tcp_try_write" "tcp_writealot"
"multiple_listen" "delayed_accept"
"shutdown_close_tcp" "shutdown_eof" "shutdown_twice" "callback_stack"
"tty_pty"
"tty_pty" "condvar_5"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was failing a bunch for me locally so I just turned it off. Seems unlikely that I broke that test given how flaky their other tests seem to be.

@copumpkin
Copy link
Member Author

My plan is to merge this, trigger a staging eval, then submit a PR against staging for my LTO-enabled stdenv, merge that, then regenerate bootstrap tools make a new PR using those.

This also updates the bootstrap tool builder to LLVM 5, but not the ones
we actually use for bootstrap. I'll make that change in a subsequent commit
so as to provide traceable provenance of the bootstrap tools.
@copumpkin copumpkin merged commit b91ad0e into NixOS:staging Sep 15, 2018
@copumpkin
Copy link
Member Author

I've merged it but will be around for another week and will happily back it out if someone critical breaks as a result. I think qt4 will break for a bit due to its use of a long-deprecated API in CF, but I opened #46719 in response to that. I'd rather just kill qt4 honestly.

I still welcome feedback on this PR!

@matthewbauer
Copy link
Member

@copumpkin This ends up breaking building on macOS 10.11:

Undefined symbols for architecture x86_64:
  "_os_unfair_lock_lock", referenced from:
      __CFSuddenTerminationDisable in CFUtilities.c.o
      __CFSuddenTerminationEnable in CFUtilities.c.o
      __CFSuddenTerminationExitIfTerminationEnabled in CFUtilities.c.o
      __CFSuddenTerminationExitWhenTerminationEnabled in CFUtilities.c.o
      __CFMachPortCreateWithPort2 in CFMachPort.c.o
      ____CFMachPortCreateWithPort2_block_invoke in CFMachPort.c.o
      ___CFMachPortDeallocate in CFMachPort.c.o
      ...
  "_os_unfair_lock_unlock", referenced from:
      __CFSuddenTerminationDisable in CFUtilities.c.o
      __CFSuddenTerminationEnable in CFUtilities.c.o
      __CFSuddenTerminationExitIfTerminationEnabled in CFUtilities.c.o
      __CFSuddenTerminationExitWhenTerminationEnabled in CFUtilities.c.o
      __CFMachPortCreateWithPort2 in CFMachPort.c.o
      ____CFMachPortCreateWithPort2_block_invoke in CFMachPort.c.o
      ___CFMachPortDeallocate in CFMachPort.c.o
      ...
ld: symbol(s) not found for architecture x86_64

10.12 seems to be fine. Would it be okay to bump our minimum version to 10.12 everywhere?

@copumpkin
Copy link
Member Author

Probably fine for now, maybe with a note that the major blocker is those locks so if someone cares enough and can put in a bit of work, we could probably keep it working.

@LnL7
Copy link
Member

LnL7 commented Oct 9, 2018

There's also an issue with wxmac (CFURLGetFSRef) https://hydra.nixos.org/build/82300955. It sounds familiar, but I can't remember if it's something you already knew about or fixed in another build.

@copumpkin
Copy link
Member Author

I've seen it but haven't done anything about it. If absolutely necessary, we could probably manually resurrect the shitty *FSRef stuff by manually transplanting and adjusting the code from the old CF releases into the new swift one, but I'd really prefer not to if we can avoid it. Apple doesn't want to support it, and I certainly don't if they don't 😄

@LnL7
Copy link
Member

LnL7 commented Oct 24, 2018

Looks like I have a solution using cf-private, not ideal but better than creating and maintaining a whole bunch of patches.

@copumpkin
Copy link
Member Author

Sounds good, thanks! I think I left a long note on cf-private asking people who use it to say what they need it for, so we can progressively rip it out as the situation changes.

@LnL7
Copy link
Member

LnL7 commented Oct 24, 2018

I added some comments to clarify why it's there, #49081.

@veprbl veprbl added this to Infrastructure (stdenv, sandboxing, etc.) in Darwin Oct 31, 2019
@LnL7 LnL7 moved this from Stdenv to Done in Darwin Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Darwin
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants