fix: point get-kernel-check at the built variant - #802
Open
drbh wants to merge 2 commits into
Open
Conversation
danieldk
reviewed
Sep 1, 2026
| # The build host may not expose the accelerator being targeted (e.g. Metal is | ||
| # undetectable inside the sandboxed macOS build), so point the resolver at the | ||
| # derivation's single variant instead of relying on backend auto-detection. | ||
| [variant] = (p.parent for p in Path(out).glob("*/metadata.json")) |
Member
There was a problem hiding this comment.
Hmmm, I don't think we should rely on a wildcard. It weakens the test.
At any rate, what I think we should do:
- Add a
variantargument to thearch.nixs andno-arch.nix. - Expose
variantthrough theenvattribute. - Validate in this hook that
variantis set and then use it. - Where the build derivations (arch/no-arch) is called, pass something like
variant = buildSet.variants.kernelVariant kernelConfig;
Then we are not only testing the correct variant, but would also nicely get CI errors if the build is generating another variant than what is expected (which a wildcard would happily pass).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this pr fixes the macos ci failures where
get-kernel-checkrejects a kernel that built fine. first hit on the einops port in huggingface/kernels-community#1092tldr; the check handed
$outto the resolver and let it pick a variant by detecting the backend at runtime. metal is the only backend detected from live hardware (torch.backends.mps.is_available(), everything else is baked into the torch build). the sandboxed macos build cannot see the gpu, so thetorch-metalvariant is never selected and the check fails even though the artifact is finerepro (no kernel build needed)
on a mac with a visible gpu the variant is selected fine (it gets as far as reading the empty
metadata.json). same command inside a seatbelt sandboxsandbox-execis the same seatbelt mechanism the nix darwin sandbox uses. denying iokit hides the gpu,mps.is_available()returns false, and the same directory no longer resolvesnote* this is also why only some metal builds fail in ci. arch metal builds set
__noChroot = metalSupportsince they need the host metal toolchain, so the gpu is still visible during the check. noarch metal builds like einops run fully sandboxed and always fail. the first command also fails on linux since there is no mps at allthe check now globs
$outfor*/metadata.jsonand points the resolver at that exact variant dir instead of auto detecting from the build host. each extension derivation produces exactly one variant, so zero or multiple variants still fail the check