-
Notifications
You must be signed in to change notification settings - Fork 55
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
Permit installation of dev/test dependencies via Nix #89
base: master
Are you sure you want to change the base?
Permit installation of dev/test dependencies via Nix #89
Conversation
Signed-off-by: Charles Duffy <[email protected]>
046ef38
to
8d16ad8
Compare
@@ -74,7 +74,7 @@ func SpawnBuildkitd(req Request, opts *BuildkitdOpts) (*Buildkitd, error) { | |||
if os.Getuid() == 0 { | |||
cmd = exec.Command("buildkitd", buildkitdFlags...) | |||
} else { | |||
cmd = exec.Command("rootlesskit", append([]string{"buildkitd"}, buildkitdFlags...)...) | |||
cmd = exec.Command("rootlesskit", append([]string{"buildkitd", "--rootless"}, buildkitdFlags...)...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this one related or is it a bug left from before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly NixOS-specific, and certainly reasonable to separate out into a different PR to be individually evaluated. While debugging, it came up that buildkit (or at least, the version shipped in NixOS 21.11) has a --rootless
which is documented to enable configuration changes for better compatibility with rootlesskit -- but that said, I didn't go back after getting other issues ironed out to confirm that we were unable to run tests without it.
I'll do that now and follow up with findings.
@@ -1,4 +1,4 @@ | |||
#!/bin/bash | |||
#!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you give some info about this line? Thx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. NixOS doesn't have a /bin/bash
; the only executables with hardcoded locations are /bin/sh
and /usr/bin/env
; everything else comes from a generated PATH with pointers into /nix/store/<hash>-<application>-<version>/bin
(allowing NixOS to have different versions of the same application, or differently-compiled versions of the same application version, simultaneously installed; similarly, dynamic library linkage all uses explicit rpaths with a hash component, so applications only link the specific library versions they were compiled and tested against, even if some newer or differently-patched version of the library is installed for a different application's use).
Using #!/usr/bin/env bash
causes a PATH lookup to be used to find the shell interpreter.
Lets folks on NixOS (or other Linux distros with Nix installed on top) run
./scripts/test
by first runningnix-shell
ornix-develop
to enter an environment with a Go compiler, buildkit, rootlesskit, and runc in their PATH.