I’m trying to package Quarkus. So I tried:
# This method is the simplest, but not the cleanest (download the whole maven dependency in one output)
# https://nixos.org/manual/nixpkgs/stable/#maven
{ stdenv, maven, lib, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "quarkus-${version}";
version = "2.10.1.Final";
src = fetchFromGitHub {
owner = "quarkusio";
repo = "quarkus";
rev = "${version}";
sha256 = "sha256-OUxVkKFqAEwWQiwvVJfetHC0nEPARvYXpeu8bKSVu7M=";
};
buildInputs = [ maven ];
buildPhase = ''
export MAVEN_OPTS="-Xmx4g"
mvn package -Dmaven.repo.local=$out -Dquickly # also tried with -Dmaven.test.skip=true -DskipTests
'';
# keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside
installPhase = ''
find $out -type f \
-name \*.lastUpdated -or \
-name resolver-status.properties -or \
-name _remote.repositories \
-delete
'';
# don't do any fixup
dontFixup = true;
outputHashAlgo = "sha256";
outputHashMode = "recursive";
# replace this with the correct SHA256
outputHash = lib.fakeSha256;
}
Unfortunately the compilation fails with No such file or directory
on a binary file… which makes me wonder if NixOs has not again bitten me with its purity:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Quarkus - Parent pom 2.10.1.Final:
[INFO]
[INFO] Quarkus - IDE/Tools - Config ....................... SUCCESS [ 59.572 s]
[INFO] Quarkus - Revapi Configuration ..................... SUCCESS [ 2.980 s]
[INFO] ArC - Parent pom ................................... SUCCESS [ 16.616 s]
[INFO] ArC - Runtime ...................................... SUCCESS [ 5.279 s]
[INFO] ArC - Processor .................................... SUCCESS [ 5.247 s]
[INFO] ArC - Tests ........................................ SUCCESS [ 1.983 s]
[INFO] Quarkus - Bootstrap - Parent ....................... SUCCESS [ 0.019 s]
[INFO] Quarkus - Bootstrap - BOM .......................... SUCCESS [ 0.015 s]
[INFO] Quarkus - Bootstrap - Test BOM ..................... SUCCESS [ 0.014 s]
[INFO] Quarkus - Bootstrap - App Model .................... SUCCESS [ 1.176 s]
[INFO] Quarkus - Bootstrap - Maven Resolver ............... SUCCESS [ 4.765 s]
[INFO] Quarkus - Bootstrap - Gradle Resolver .............. SUCCESS [ 8.947 s]
[INFO] Quarkus - Bootstrap - Core ......................... SUCCESS [ 2.002 s]
[...]
[INFO] Quarkus - REST Client Config - Runtime ............. SUCCESS [ 1.146 s]
[INFO] Quarkus - REST Client .............................. SUCCESS [ 0.029 s]
[INFO] Quarkus - REST Client - Runtime .................... SUCCESS [ 1.942 s]
[INFO] Quarkus - Undertow ................................. SUCCESS [ 0.016 s]
[INFO] Quarkus - Undertow - Runtime ....................... SUCCESS [ 1.153 s]
[INFO] Quarkus - gRPC parent .............................. SUCCESS [ 0.020 s]
[INFO] Quarkus - gRPC - API ............................... SUCCESS [ 0.569 s]
[INFO] Quarkus - gRPC Common .............................. SUCCESS [ 0.028 s]
[INFO] Quarkus - gRPC Common - Runtime .................... SUCCESS [ 1.933 s]
[INFO] Quarkus - SmallRye Stork Integration ............... SUCCESS [ 0.018 s]
[INFO] Quarkus - SmallRye Stork - Runtime ................. SUCCESS [ 0.728 s]
[INFO] Quarkus - gRPC - Protoc Plugin ..................... SUCCESS [ 2.126 s]
[INFO] Quarkus - gRPC - Code Gen .......................... SUCCESS [ 7.716 s]
[INFO] Quarkus - gRPC - Stubs for health and reflection ... FAILURE [ 4.464 s]
[INFO] Quarkus - gRPC - Runtime ........................... SKIPPED
[INFO] Quarkus - Micrometer ............................... SKIPPED
[INFO] Quarkus - Micrometer - Runtime ..................... SKIPPED
[INFO] Quarkus - Micrometer Registry - Prometheus - Parent SKIPPED
[INFO] Quarkus - Micrometer Registry - Prometheus Runtime . SKIPPED
[INFO] Quarkus - RESTEasy - Common - SPI .................. SKIPPED
[INFO] Quarkus - RESTEasy Reactive - SPI .................. SKIPPED
[INFO] Quarkus - Undertow - SPI ........................... SKIPPED
[INFO] Quarkus - JSON-P - Deployment ...................... SKIPPED
[INFO] Quarkus - RESTEasy - Common - Deployment ........... SKIPPED
[INFO] Quarkus - JAX-RS SPI - Parent ...................... SKIPPED
[INFO] Quarkus - JAX-RS - SPI - Deployment ................ SKIPPED
[...]
[INFO] Quarkus - Integration Tests - gRPC - Hibernate ..... SKIPPED
[INFO] Quarkus - Integration Tests - gRPC - Hibernate Reactive SKIPPED
[INFO] Quarkus - Integration Tests - Helper project containing packaging a proto file for grpc-external-proto-test SKIPPED
[INFO] Quarkus - Integration Tests - gRPC - External proto Test SKIPPED
[INFO] Quarkus - Integration Tests - gRPC with Stork - gathering response times SKIPPED
[INFO] Quarkus - Integration Tests - Google Cloud Functions HTTP SKIPPED
[INFO] Quarkus - Integration Tests - Google Cloud Function SKIPPED
[INFO] Quarkus - Documentation ............................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:13 min
[INFO] Finished at: 2022-07-02T07:51:53Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (compile) on project quarkus-grpc-stubs: An error occurred while invoking protoc: Error while executing process.: Cannot run program "/build/source/extensions/grpc/stubs/target/protoc-plugins/protoc-3.19.3-linux-x86_64.exe": error=2, No such file or directory -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :quarkus-grpc-stubs
any idea how to make this work?