Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Commit 7fc1507

Browse files
authored
Let kernel-builder determine the kernel revision (#221)
This allows us to use date-based revisions and thus ops identifiers in the future.
1 parent a496ac9 commit 7fc1507

11 files changed

Lines changed: 33 additions & 13 deletions

File tree

dockerfiles/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ function ensure_flake_exists {
5959
};
6060
outputs = { self, kernel-builder, }:
6161
kernel-builder.lib.genFlakeOutputs {
62+
inherit self;
6263
path = ./.;
63-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
6464
};
6565
}
6666
FLAKE_EOF

dockerfiles/Dockerfile.user

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ function ensure_flake_exists {
8383

8484
outputs = { self, kernel-builder, }:
8585
kernel-builder.lib.genFlakeOutputs {
86+
inherit self;
8687
path = ./.;
87-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
8888
};
8989
}
9090
FLAKE_EOF
@@ -234,4 +234,4 @@ RUN chmod +x /home/nixuser/bin/cli.sh && \
234234
USER nixuser
235235

236236
# Use the cli.sh script directly
237-
ENTRYPOINT ["/home/nixuser/bin/cli.sh"]
237+
ENTRYPOINT ["/home/nixuser/bin/cli.sh"]

docs/nix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ the kernel's `flake.nix` to use the `pythonCheckInputs` option:
117117
kernel-builder,
118118
}:
119119
kernel-builder.lib.genFlakeOutputs {
120+
inherit self;
120121
path = ./.;
121-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
122122
123123
# The einops and numpy test dependencies are added here:
124124
pythonCheckInputs = pkgs: with pkgs; [ einops numpy ];

examples/activation/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}:
1313

1414
kernel-builder.lib.genFlakeOutputs {
15+
inherit self;
1516
path = ./.;
16-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
1717
};
1818
}

examples/cutlass-gemm/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
kernel-builder,
1212
}:
1313
kernel-builder.lib.genFlakeOutputs {
14+
inherit self;
1415
path = ./.;
15-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
1616
};
1717
}

examples/relu-backprop-compile/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
kernel-builder,
1212
}:
1313
kernel-builder.lib.genFlakeOutputs {
14+
inherit self;
1415
path = ./.;
15-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
1616
};
1717
}

examples/relu-specific-torch/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
kernel-builder,
1212
}:
1313
kernel-builder.lib.genFlakeOutputs {
14+
inherit self;
1415
path = ./.;
15-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
1616
torchVersions = defaultVersions: [
1717
{
1818
torchVersion = "2.7";

examples/relu/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
kernel-builder,
1212
}:
1313
kernel-builder.lib.genFlakeOutputs {
14+
inherit self;
1415
path = ./.;
15-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
1616
};
1717
}

examples/silu-and-mul-universal/flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
kernel-builder,
1212
}:
1313
kernel-builder.lib.genFlakeOutputs {
14+
inherit self;
1415
path = ./.;
15-
rev = self.shortRev or self.dirtyShortRev or self.lastModifiedDate;
1616
};
1717
}

flake.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
genFlakeOutputs =
7171
{
7272
path,
73-
rev,
73+
rev ? null,
74+
self ? null,
7475

7576
# This option is not documented on purpose. You should not use it,
7677
# if a kernel cannot be imported, it is non-compliant. This is for
@@ -97,6 +98,7 @@
9798
system
9899
path
99100
rev
101+
self
100102
doGetKernelCheck
101103
pythonCheckInputs
102104
pythonNativeCheckInputs

0 commit comments

Comments
 (0)