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
racket: on darwin, use libiconv #35429
Conversation
Without libiconv, racket doesn't support UTF-16, and this breaks one of the tests. Closes NixOS#34576
@GrahamcOfBorg build racket racket-minima |
@GrahamcOfBorg build racket racket-minimal |
Failure on aarch64-linux (full log) Partial log (click to expand)
|
Failure on aarch64-linux (full log) Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Partial log (click to expand)
|
Failure on x86_64-linux (full log) Partial log (click to expand)
|
Success on x86_64-linux (full log) Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Partial log (click to expand)
|
Guess I'll try it in sandbox. |
Oh. What do I do to fix this? I set
NixOS/nix#759 seems to say this is a problem that was fixed two years ago. Has it come back or am I doing something wrong? It may be relevant that |
Sandboxing requires nix 2.0 and the relaxed mode isn't really supported anymore. |
Ok! Time to upgrade then. |
That wasn't a roaring success.
|
@LnL7 It seems to me that nixpkgs/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh Lines 38 to 42 in 3bae302
nixpkgs/pkgs/os-specific/darwin/apple-sdk/default.nix Lines 136 to 137 in 3bae302
Probably
|
Yeah, there are still some problems with sandboxing and frameworks. FYI the darwin builders don't run with sandboxing enabled anymore. |
I already noticed it, when |
Ok. Any suggestions how I can fix this? glib is in the libPath expression, but I noticed that LD_LIBRARY_PATH isn't in the environment when building. And on MacOS maybe we should set DYLD_LIBRARY_PATH instead? |
I think that's equivalent. There are also a bunch of other DYLD_* environment variables described in |
See NixOS/nixpkgs#35429 . It's not good enough to merge into nixpkgs, but it's good enough for us. Solution: On Nix/Darwin, make racket use GNU libiconv.
See NixOS/nixpkgs#35429 . It's not good enough to merge into nixpkgs, but it's good enough for us. Solution: On Nix/Darwin, make racket use GNU libiconv.
See NixOS/nixpkgs#35429 . It's not good enough to merge into nixpkgs, but it's good enough for us. Solution: On Nix/Darwin, make racket use GNU libiconv.
See NixOS/nixpkgs#35429 . It's not good enough to merge into nixpkgs, but it's good enough to build. Solution: On Nix/Darwin, make racket use GNU libiconv. Now pkgs.fractalide builds. Known issues: ``` $ $(nix-build --no-out-link -A pkgs.fractalide)/bin/hyperflow [ . . . ] ffi-lib: couldn't open "libX11.6.dylib" (dlopen(libX11.6.dylib, 6): image not found) context...: /nix/store/i4lc5qygg6jzdy5p0fam7s7p700c6agj-racket-6.12/share/racket/pkgs/gui-lib/mred/private/wx/gtk/x11.rkt: [running body] ``` ``` $ DYLD_LIBRARY_PATH=$(nix-build --no-out-link -A pkgs.xorg.libX11)/lib:$DYLD_LIBRARY_PATH $(nix-build --no-out-link -A pkgs.fractalide)/bin/hyperflow [ . . . ] Segmentation fault: 11 ``` ``` $ DYLD_LIBRARY_PATH=$(nix-build --no-out-link -A pkgs.xorg.libX11)/lib:$DYLD_LIBRARY_PATH $(nix-build --no-out-link -A pkgs.fractalide)/bin/hyperflow racket(11288,0x7fffda7df3c0) malloc: *** error for object 0x10e430d68: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug Abort trap: 6 ``` But it builds!
This will time out every time. If we want to test on darwin, we have a few options: - Solve NixOS/nixpkgs#35429 Get racket into nixpkgs, so we can pull down racket from hydra. - Solve fractalide/racket2nix#94 Make racket2nix competent enough that we don't get the empty.zip sources for core packages, and can build on racket-minimal. - Massage the catalogs If we make sure that the core packages come from the release catalog instead of the live catalog, it should work. This is probably as easy as a union between two hashes. We could even cheat and just manually add only typed-map to the release catalog. Solution: Disable darwin for now.
Re: Full Racket doesn't build on darwin even with libiconv (the fix in this PR), but at least it would help us remove our local patch in racket2nix. With racket2nix on darwin today, with this fix, we can build racket-minimal plus the drracket package and all its dependencies, and run drracket with a whole bunch of caveats. It's not ready to replace full racket yet. The next step to make full racket and drracket work on Nix darwin would be to get the racket derivation a |
@qknight this is mergable, mind taking a quick review please. |
@GrahamcOfBorg build racket racket-minimal |
Success on aarch64-linux (full log) Attempted: racket-minimal The following builds were skipped because they don't evaluate on aarch64-linux: racket Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: racket, racket-minimal Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Attempted: racket, racket-minimal Partial log (click to expand)
|
nixpkgs-unstable has darwin racket depending on libiconv as of: NixOS/nixpkgs#35429 d59307e54c63daf42d98288ba4c7132ccc02daf2 Solution: Remove racket-minimal override.
nixpkgs-unstable has darwin racket depending on libiconv as of: NixOS/nixpkgs#35429 d59307e54c63daf42d98288ba4c7132ccc02daf2 Solution: Remove racket-minimal override. Closes fractalide#230
Without libiconv, racket doesn't support UTF-16, and this breaks one
of the tests.
Closes #34576
Motivation for this change
Make racket build on Darwin.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)The binaries that require
libX11.6.dylib
in the library path for dynamic loading don't run, but I think that's in scope for another commit.On Linux side this commit introduces zero change to derivations.