This repository was archived by the owner on Apr 6, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,10 +52,8 @@ We also provide Docker containers for CI builds. For a quick build:
5252# Using the prebuilt container
5353cd examples/activation
5454docker run --rm \
55- -v $( pwd) :/app \
56- -w /app \
57- ghcr.io/huggingface/kernel-builder:{SHA} \
58- build
55+ --mount type=bind,source=$( pwd) ,target=/kernelcode \
56+ -w /kernelcode ghcr.io/huggingface/kernel-builder:main build
5957```
6058
6159See [ dockerfiles/README.md] ( ./dockerfiles/README.md ) for more options, including a user-level container for CI/CD environments.
Original file line number Diff line number Diff line change 1- FROM nixos/nix:2.18.8
1+ FROM nixos/nix:2.30.3
22
33# default build args
44ARG MAX_JOBS=4
@@ -100,21 +100,15 @@ function build_extension {
100100 # Make sure the build is up to date
101101 nix run github:huggingface/kernel-builder#update-build -- build.toml
102102
103- # only do the following if flake.lock exists
104-
105- # if the lock file exists
103+ # Determine override from flake.nix only
106104 override=""
107- if [ -f flake.lock ]; then
108- # check the type of kernel-builder in flake.lock
109- kernel_url_type=$(cat flake.lock | jq -r '.nodes["kernel-builder"].locked.type' )
110- echo "Kernel URL type: $kernel_url_type"
111-
112- # If the type is "path", compute the nar hash and set override
113- if [ "$kernel_url_type" = "path" ]; then
114- kernel_url_path=$(cat flake.lock | jq -r '.nodes["kernel-builder"].locked.path' )
115- nar_hash=$(nix-hash --type sha256 --base64 "$kernel_url_path" )
116- override="--override-input kernel-builder path:../..?narHash=sha256-$nar_hash"
117- fi
105+ # check if using a local path for kernel-builder
106+ is_using_path=$(grep -q 'kernel-builder.url *= *"path:' flake.nix && echo "yes" || echo "no" )
107+ if [ "$is_using_path" = "yes" ]; then
108+ override="--override-input kernel-builder github:huggingface/kernel-builder"
109+ echo "Detected local path for kernel-builder in flake.nix, overriding to use GitHub source."
110+ else
111+ echo "No local path for kernel-builder detected in flake.nix."
118112 fi
119113
120114 echo "Building with Nix..."
Original file line number Diff line number Diff line change 1- FROM nixos/nix:2.18.8
1+ FROM nixos/nix:2.30.3
22
33# default build args
44ARG MAX_JOBS=1
@@ -120,6 +120,17 @@ function build_extension {
120120 # Make sure the build is up to date
121121 nix run github:huggingface/kernel-builder#update-build -- build.toml
122122
123+ # Determine override from flake.nix only
124+ override=""
125+ # check if using a local path for kernel-builder
126+ is_using_path=$(grep -q 'kernel-builder.url *= *"path:' flake.nix && echo "yes" || echo "no")
127+ if [ "$is_using_path" = "yes" ]; then
128+ override="--override-input kernel-builder github:huggingface/kernel-builder"
129+ echo "Detected local path for kernel-builder in flake.nix, overriding to use GitHub source."
130+ else
131+ echo "No local path for kernel-builder detected in flake.nix."
132+ fi
133+
123134 # Pure bundle build
124135 # TODO: remove the "bundle" after resolving
125136 echo "Building with Nix..."
You can’t perform that action at this time.
0 commit comments