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
dmd & ldc: Fix bootstrap dmd to build with sandboxing of nixUnstable and fix dmd to build on Darwin; Disable check phases of dmd and ldc because of sandboxing problem #29469
Conversation
It might be a local problem, but I repeatedly get:
but it seems the same before this PR as well... |
Haven't seen that one before. My wild guess is that the call to gethostbyaddr (https://github.com/dlang/phobos/blob/v2.067.1/std/socket.d#L839) is failing.
|
I have NixOS with sandboxing on, version: roughly master/staging from two weeks ago. There's no unusual network AFAIK, but sandboxing is supposed to block/isolate networking anyway. Sandboxing is causing this failure, probably. |
I forgot to write I'm using |
I don't see how I install nixUnstable the most comfortable way. |
You don't need to. It's in nixpkgs under attribute name |
Ok didn't know that it's just a name inside nixpkgs. This way I was able to reproduce the problem. |
sandboxing enabled
sandboxing enabled
I was right in #29469 (comment) gethostbyaddr returns null. I decided to just disable the check phase for now. Everything is building with sandboxing of Nix 1.12 including ldc. I came to the conclusion that the check phase isn't the right place to test the packages because of the minimal environment given by the sandbox. |
The main intention of network sandboxing is to avoid impurities like trying to download additional stuff during the build. Working with "localhost" is not a problem theoretically, due to each build living in its own network namespace, but apparently something is currently too different in there. BTW, nix sandboxing has no idea about phases – it just invokes the builder which can do anything. It's a matter of nixpkgs that we typically use bash with the stdenv scripts that do the phases. gethostbyaddr: I'm afraid it's not clear to me from the documentation whether the function is supposed to try getting some name for the address. That might as simple as missing |
The socket unittest of phobos is doing more than just this localhost test. That's also the reason I saw no point in trying to dig deeper for now because it clearly shows that check phase isn't what I need it to be. |
I think there were some similar ideas at least, but nothing really got implemented. One could also simulate that simply by splitting into multiple derivations – first would do the build and output the intermediate files, then you could run the checks in another one. (That would also have the advantage of not having to rebuild if you just want to tweak something in the check phase.) |
And why is one derivation build with another sandbox in this scenario? Or is it configurable per derivation input somehow? It would also be very comfortable if it would be possible to disable the check phases when running a build via nix-build if one just needs a quick result. |
Fixed-output derivations have full access to the network. The "testing derivation" may e.g. just output a single empty file and nothing else (or fail). |
Ah that's already available that's cool thanks. Can you give me an example of such an fixed output derivation? |
See the manual. The primary intended use is for downloaders, e.g. |
Ok since the CI infrastructure is days behind it makes no sense in waiting on it especially because the build is currently in a broken state anyway and can only get better with this PR. |
Motivation for this change
Fixing the problems which appeared because of the merge of #28635.
The sandboxing problem is also discussed in #29443.
Disabled check phases of dmd and ldc to get them to build with the sandboxing of Nix 1.12.
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)CC @Mic92