Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ site

.be
.bazelbsp
.built
.cache
.direnv
.eclipse
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ web/web-out/
# Maven
java/.mvn/wrapper/maven-wrapper.jar
java/target
.built/.m2

# https://jbang.dev
.jbang/

tools/version/VERSION

# LinkML
# Miscellaneous generated/output varia (incl. LinkML, .m2, HOME, VENDOR, etc.)
.built

# https://github.com/VirtusLab/bazel-steward/issues/424
Expand Down
54 changes: 50 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,49 @@
# $ nix build .#enola
# $ result/bin/enola --help
default = enola;
# Testing https://github.com/enola-dev/enola/issues/1875 ...
bazel-vendor-dir = pkgs.stdenv.mkDerivation {
pname = "bazel-vendor-dir";
version = gitRev;

nativeBuildInputs = [
pkgs.bazel_8
pkgs.protobuf
pkgs.protoc-gen-grpc-java
pkgs.which
jdk'
];
src = ./.;
buildPhase = ''
runHook preBuild

bash tools/protoc/protoc.bash

# https://github.com/enola-dev/enola/issues/1876
export HOME=.built/HOME
mkdir -p $HOME

export VENDOR=.built/VENDOR
mkdir -p $VENDOR
bazel vendor --vendor_dir=$VENDOR //...

runHook postBuild
'';
installPhase = ''
runHook preInstall

tar czvf $out \
--sort=name \
--mtime='UTC 2080-02-01' \
--owner=0 \
--group=0 \
--numeric-owner $VENDOR

runHook postInstall
'';
# outputHash = pkgs.lib.fakeHash;
outputHash = "sha256-ExeaXCtvUJa27pDQPixoGQH1Vu1Nh8NzciAqPOJJwRE=";
};
enola = pkgs.stdenv.mkDerivation {
pname = "enola";
version = gitRev;
Expand All @@ -100,13 +143,19 @@
src = ./.;

buildPhase = ''
# This currently only serves to force a dependency to above
ls -al ${bazel-vendor-dir}

# class dev.enola.common.Version reads VERSION
echo -n "${gitRev}" >tools/version/VERSION

# See https://github.com/NixOS/nix/issues/14024
bash tools/protoc/protoc.bash

export HOME=$TMPDIR
# https://github.com/enola-dev/enola/issues/1876
export HOME=.built/HOME
mkdir -p $HOME

bazel build //java/dev/enola/cli:enola_deploy.jar
'';

Expand All @@ -116,9 +165,6 @@
makeWrapper ${jdk'}/bin/java $out/bin/enola \
--add-flags "-jar $out/share/java/enola_deploy.jar"
'';

# TODO https://github.com/enola-dev/enola/issues/1730
# outputHash = "sha256-hHa+tqNDxe3+Tl190xPWiNiCq0HWU5qcc52rjo3Ncl0=";
};
};

Expand Down
Loading