-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
nesting: init at 0.2.1 #338281
base: master
Are you sure you want to change the base?
nesting: init at 0.2.1 #338281
Conversation
Darwin build is broken. [nix-shell:~/workplace/nixpkgs]$ nix-build -A nesting
this derivation will be built:
/nix/store/zxsgqfri89chpxkw6vafz6z7s9l0z34a-nesting-0.2.1.drv
building '/nix/store/zxsgqfri89chpxkw6vafz6z7s9l0z34a-nesting-0.2.1.drv'...
install: skipping file '/dev/fd/63', as it was replaced while being copied
Running phase: unpackPhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
unpacking source archive /nix/store/365hh320g3ck900mvnb0zjd7jinkywp2-source
source root is source
Running phase: patchPhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
Running phase: updateAutotoolsGnuConfigScriptsPhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
Running phase: configurePhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
Running phase: buildPhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
Building subPackage ./cmd/nesting
package gitlab.com/gitlab-org/fleeting/nesting/cmd/nesting
imports gitlab.com/gitlab-org/fleeting/nesting/cmd/nesting/serve
imports gitlab.com/gitlab-org/fleeting/nesting/hypervisor/virtualizationframework
imports github.com/Code-Hex/gvisor-vmnet
imports gvisor.dev/gvisor/pkg/tcpip/adapters/gonet
imports gvisor.dev/gvisor/pkg/tcpip/stack
imports gvisor.dev/gvisor/pkg/sync/locking
imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /private/tmp/nix-build-nesting-0.2.1.drv-0/source/vendor/gvisor.dev/gvisor/pkg/gohacks
Running phase: checkPhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
package gitlab.com/gitlab-org/fleeting/nesting/cmd/nesting
imports gitlab.com/gitlab-org/fleeting/nesting/cmd/nesting/serve
imports gitlab.com/gitlab-org/fleeting/nesting/hypervisor/virtualizationframework
imports github.com/Code-Hex/gvisor-vmnet
imports gvisor.dev/gvisor/pkg/tcpip/adapters/gonet
imports gvisor.dev/gvisor/pkg/tcpip/stack
imports gvisor.dev/gvisor/pkg/sync/locking
imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /private/tmp/nix-build-nesting-0.2.1.drv-0/source/vendor/gvisor.dev/gvisor/pkg/gohacks
Running phase: installPhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
Running phase: fixupPhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
checking for references to /private/tmp/nix-build-nesting-0.2.1.drv-0/ in /nix/store/xgqgmksvxyckm479mja1wl7ca96drl12-nesting-0.2.1...
patching script interpreter paths in /nix/store/xgqgmksvxyckm479mja1wl7ca96drl12-nesting-0.2.1
/nix/store/xgqgmksvxyckm479mja1wl7ca96drl12-nesting-0.2.1
[nix-shell:~/workplace/nixpkgs]$ tree /nix/store/xgqgmksvxyckm479mja1wl7ca96drl12-nesting-0.2.1
/nix/store/xgqgmksvxyckm479mja1wl7ca96drl12-nesting-0.2.1
0 directories, 0 files Likely the same cause as this issue in colima: abiosoft/colima#401 There was a subsequent commit after the v0.2.1 release which upgrades the gvisor version used by nesting. https://gitlab.com/gitlab-org/fleeting/nesting/-/merge_requests/14/commits Need to ask upstream to create a new release. |
Building with the current latest commit ( [nix-shell:~/workplace/nixpkgs]$ nix-build -A nesting
these 2 derivations will be built:
/nix/store/n09msfjia44p0y3mrd5zy1vflb2nbs9b-nesting-0.2.2-dev-go-modules.drv
/nix/store/v8w7w7acgbif2sda0w8bffdm0rxz697r-nesting-0.2.2-dev.drv
...
Running phase: buildPhase
install: skipping file '/dev/fd/63', as it was replaced while being copied
Building subPackage ./cmd/nesting
# github.com/Code-Hex/vz/v3
In file included from vendor/github.com/Code-Hex/vz/v3/audio.go:6:
In file included from ./virtualization_11.h:9:
./virtualization_helper.h:25:9: warning: macOS 12.3 API has been disabled [-W#pragma-messages]
#pragma message("macOS 12.3 API has been disabled")
^
./virtualization_helper.h:32:9: warning: macOS 13 API has been disabled [-W#pragma-messages]
#pragma message("macOS 13 API has been disabled")
^
In file included from vendor/github.com/Code-Hex/vz/v3/audio.go:6:
./virtualization_11.h:10:9: fatal error: 'Virtualization/Virtualization.h' file not found
#import <Virtualization/Virtualization.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
error: builder for '/nix/store/v8w7w7acgbif2sda0w8bffdm0rxz697r-nesting-0.2.2-dev.drv' failed with exit code 1;
last 10 log lines:
> #pragma message("macOS 12.3 API has been disabled")
> ^
> ./virtualization_helper.h:32:9: warning: macOS 13 API has been disabled [-W#pragma-messages]
> #pragma message("macOS 13 API has been disabled")
> ^
> In file included from vendor/github.com/Code-Hex/vz/v3/audio.go:6:
> ./virtualization_11.h:10:9: fatal error: 'Virtualization/Virtualization.h' file not found
> #import <Virtualization/Virtualization.h>
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 2 warnings and 1 error generated.
For full logs, run 'nix log /nix/store/v8w7w7acgbif2sda0w8bffdm0rxz697r-nesting-0.2.2-dev.drv'. For reference, this is on an Apple MacBook Pro with an M2 Pro on macOS Sonoma 14.6.1. It's likely because I'm missing Xcode as a build input. Probably need to follow one of the existing language and framework guides in the Nixpkgs manual: |
8d724ba
to
2db575d
Compare
Looking around at some other packages for reference: Looks like I need to add a This is likely the one I need:
With this in the package: {
lib,
darwin,
stdenv,
# ...
}:
buildGoModule rec {
pname = "nesting";
version = "0.2.2-dev";
src = fetchFromGitLab {
owner = "gitlab-org/fleeting";
repo = "nesting";
rev = "72e7d53e8567d950e4d29fd1f2e94507e92b482e";
hash = "sha256-p9al3N5DdNC/e/DF5M9RgJgYOnNfHTyt47vP2rTe7I8=";
};
vendorHash = "sha256-3c2qemiBwiXTHIu52YOr9yAZLDQuhdthvvhMgfK7EZc=";
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk_12_3.frameworks.Virtualization ];
# ...
} We get further again, but still run into an error.
|
Stepping down to Might need to get a newer version of Xcode into Nix? |
Using
|
Some of these symbols seem to require Xcode 13. In particular, a quick search for https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes#New-Features
Likewise a quick search for
For |
Newer To summarize, this package will need the following to work on Darwin:
Neither exist yet. Once they do, however, we can update the package definition and potentially move this PR out of draft. Edit: PR tracking for the |
07ea8fd
to
1db08bd
Compare
1db08bd
to
8225e86
Compare
8225e86
to
a78b483
Compare
{
lib,
# Need macOS 15+ for nested virtualization.
apple-sdk_15,
buildGoModule,
fetchFromGitLab,
nix-update-script,
stdenv,
versionCheckHook,
}:
buildGoModule rec {
pname = "nesting";
version = "0.2.2-dev";
src = fetchFromGitLab {
owner = "gitlab-org/fleeting";
repo = "nesting";
rev = "72e7d53e8567d950e4d29fd1f2e94507e92b482e";
hash = "sha256-p9al3N5DdNC/e/DF5M9RgJgYOnNfHTyt47vP2rTe7I8=";
};
vendorHash = "sha256-3c2qemiBwiXTHIu52YOr9yAZLDQuhdthvvhMgfK7EZc=";
subPackages = [ "cmd/nesting" ];
# See https://gitlab.com/gitlab-org/fleeting/nesting/-/blob/v0.2.1/Makefile?ref_type=tags#L22-24.
#
# Needed for "nesting version" to not show "dev".
ldflags =
let
# See https://gitlab.com/gitlab-org/fleeting/nesting/-/blob/v0.2.1/Makefile?ref_type=tags#L18.
#
# Couldn't find a way to substitute "go list ." into "ldflags".
ldflagsPackageVariablePrefix = "gitlab.com/gitlab-org/fleeting/nesting";
in
[
"-X ${ldflagsPackageVariablePrefix}.NAME=nesting"
"-X ${ldflagsPackageVariablePrefix}.VERSION=v${version}"
"-X ${ldflagsPackageVariablePrefix}.REVISION=${src.rev}"
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_15 ];
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${builtins.placeholder "out"}/bin/${meta.mainProgram}";
versionCheckProgramArg = "version";
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Basic and opinionated daemon that sits in front of virtualization platforms";
homepage = "https://gitlab.com/gitlab-org/fleeting/nesting";
license = lib.licenses.mit;
mainProgram = "nesting";
# TODO: Find maintainer(s).
maintainers = with lib.maintainers; [ ];
};
}
The minimum required Apple SDK version isn't documented for https://github.com/cirruslabs/tart/blob/3fb8069edd2fcd4e881d42000e3de1188af8d695/CONTRIBUTING.md Granted, that doesn't really have any bearing on Code-Hex/vz (used by https://github.com/Code-Hex/vz/tree/8aa9759a535a4648035a5dba5cee844ba1dfcaa0 At least 15.0 is required for nested virtualization though. This is because nested virtualization was introduced in macOS 15. Need to ask upstream to bump |
Issue to upstream: https://gitlab.com/gitlab-org/fleeting/nesting/-/issues/7 |
477d5e2
to
acd668d
Compare
07ec4fe
to
0e0ba5e
Compare
0e0ba5e
to
ece908c
Compare
MR to upstream for bumping versions: https://gitlab.com/gitlab-org/fleeting/nesting/-/merge_requests/15 |
ece908c
to
b10bede
Compare
b10bede
to
835e9fc
Compare
835e9fc
to
f3212f0
Compare
f3212f0
to
31f75b3
Compare
31f75b3
to
be572ad
Compare
Description of changes
Initialize nesting at 0.2.1.
This is used by GitLab Runner for nested virtualization (example).
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.