-
Notifications
You must be signed in to change notification settings - Fork 13
WIP: feat: hermetic build for enola #1730 (dumb build) #1795
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,12 @@ | |
| # NB: This doesn't actually use tools/version/version-out.bash (like the non-Nix build does) | ||
| gitRev = toString (self.shortRev or self.dirtyShortRev or self.lastModified or "DEVELOPMENT"); | ||
|
|
||
| bazel-central-registry = pkgs.fetchFromGitHub { | ||
| owner = "bazelbuild"; | ||
| repo = "bazel-central-registry"; | ||
| rev = "4fcc47180cfe24915dae5705074c3994c60dc6b7"; | ||
| hash = "sha256-Th7gamXEzJnoA65VKVfARCDnLup5URJT0R1g2Jw3S/0="; | ||
| }; | ||
| in | ||
| { | ||
| # TODO: for https://nix-bazel.build, replace with mkShellNoCC. | ||
|
|
@@ -113,7 +119,7 @@ | |
| bash tools/protoc/protoc.bash | ||
|
|
||
| export HOME=$TMPDIR | ||
| bazel build //java/dev/enola/cli:enola_deploy.jar | ||
| bazel build --registry=file://${bazel-central-registry} //java/dev/enola/cli:enola_deploy.jar | ||
| ''; | ||
|
|
||
| installPhase = '' | ||
|
|
@@ -122,6 +128,8 @@ | |
| makeWrapper ${jdk'}/bin/java $out/bin/enola \ | ||
| --add-flags "-jar $out/share/java/enola_deploy.jar" | ||
| ''; | ||
|
|
||
| outputHash = "sha256-hHa+tqNDxe3+Tl190xPWiNiCq0HWU5qcc52rjo3Ncl0="; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using a fixed To improve maintainability for future contributors, it would be very helpful to add a comment explaining why this hash is necessary and how to update it. This will save others time when they encounter a hash mismatch error. |
||
| }; | ||
| }; | ||
|
|
||
|
|
||
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.
While using
fetchFromGitHubworks, a more idiomatic approach with Nix Flakes is to declare this dependency as a flake input. This improves clarity by centralizing external dependencies in theinputssection and leverages theflake.lockfile for pinning.You could achieve this by:
bazel-central-registryto yourinputsinflake.nix:bazel-central-registryas an argument to theoutputsfunction.letbinding and using thebazel-central-registryvariable from the function arguments directly in yourbazel buildcommand.This change would make your flake's dependency management more robust and easier to follow.