johnny101m has quit [Quit: -a- Connection Timed Out]
johnny101m has joined #nix-darwin
<aterius>
I asked this on #NixOS:matrix.org but I realize this is probably the better forum. Has anyone had success getting remote builds for darwin running on nixos? I've set up my remote builder, but am getting an error
<aterius>
```
<aterius>
```
<aterius>
a 'x86_64-darwin' with features {} is required to build '/nix/store/jpraymhpsqh48gps6c78z64sf2a4iwds-libstartup-notification-0.12.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}
<LnL>
looks like it's still trying to build locally
<dhess>
the easiest way to use it is to pull in my dhess-nix as an overlay, but you can just steal the code and rip out the dhess-nix-specific bits if you don't want to pull the rest in
<dhess>
I think one or two of the types and the dhess-nix.keychain.keys bits are the only things that won't work without the overlay
<aterius>
LnL: Why do you say that? I thought given the fact that it is failing because the build host is am a 'x86_64-linux' with features would indicate it's building remotely and failing
<aterius>
dhess: Thank you! I had seen your earlier gist on github, and tried combing through your repo but missed this
<aterius>
I don't see what you're doing differently though... Does anything special need to be configured on the remote host?
<dhess>
aterius: That means it needs an x86_64-darwin but can't find one
<LnL>
run nix-build with some -vvv flags and look for decline
<LnL>
an indication as to why the host you configured was skipped should be in there somehwereee
<dhess>
I'm leaving the office now so I won't be around for a bit. I'll check in later and see how you're getting along.
<aterius>
dhess: Sorry, I'm confused, can the remote nixOS machine not cross-compile for darwin?
<dhess>
it cannot
<dhess>
it needs a remote Mac running nix-daemon so that it can give it jobs to run on its behalf.
<LnL>
cross compiling is something completely different and would build other output paths
<dhess>
I should say, maybe Linux->Darwin cross compiles work in nixpkgs but I haven't tried it and it requires other machinery in your default.nix to specifically ask for that
<dhess>
and I'll bet a lot of stuff breaks, e.g., Haskell cross-compiles
<LnL>
because some of the dependencies (like gcc) will be linux binaries instead of native ones
<aterius>
Thank you! I'll play around with it. I assumed the subset of packages that would cross-compile would still be built
<dhess>
not unless you specifcally ask that cross-compiled builds are performed. The nixpkgs cross-compiling section of the documentation should explain how.
<aterius>
got it
<aterius>
thank you
<dhess>
np
<LnL>
linux->darwin also needs some extra setup since it needs xcode (unfree) which you'll have to download and import yourself
Chiliparrot has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<LnL>
but if you want to look into it, here's how you cross compile hello for arm for example
<eraserhd>
Hmm, so this isn't quite nix-darwin, but ... AFAICT, -F options aren't added to $NIX_LDFLAGS for framework build inputs. Do packages just do this manually?
<eraserhd>
-iframework flags _are_ added to $NIX_BUILD_CFLAGS ... this isn't an oversight or something, is it?
<LnL>
packages only add -framework Foo themselves
<eraserhd>
In this case (plan9port), it adds like `-framework Cocoa`, but since it doesn't add `-F/nix/store/...` it can't be found.
<eraserhd>
It was using gcc as the linker, but that seems recently broken.
<eraserhd>
So, I'm trying to figure out if I should extract all the -iframework options from NIX_BUILD_CFLAGS and add corresponding -F options to $NIX_LDFLAGS, or if there should be a setup hook.
<LnL>
not sure how frameworks are resolved exactly, but I've never seen any issues with what we do now
<LnL>
why is it using gcc?
<eraserhd>
uh, terrible terrible reasons ...
<eraserhd>
9l is the plan9 linker, and in plan9port, it is a big shell script that pokes all over the system to figure out what it should do.