Open snowe2010 opened 1 year ago
/cc @Karm (mandrel), @galderz (mandrel), @glefloch, @matejvasek (amazon-lambda), @patriot1burke (amazon-lambda), @quarkusio/devtools, @zakkak (mandrel)
@snowe2010 I'm having the same issue! Can you please share how you solved or worked around it?
@HipsterZipster I did not solve it nor work around it. I just can't use the build-cache until this is fixed.
@snazy Looking at the code you added, the integration would seem to take care of this and so the native runner should be included? https://github.com/quarkusio/quarkus/blame/main/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildCacheableAppParts.java#L43. Can you look into this?
@HipsterZipster @snowe2010 You could try debugging the builder code with the IDE and see what is going. The above comment hints at some areas that takes care of this.
@galderz I did debug, that's how I found the problem area and the PR.
Same issue here.
@geoand @gsmet @aloubyansky Can someone help with this?
My knowledge of Gradle is too limited to be of any help here
Describe the bug
./gradlew build --build-cache
cachesquarkusBuild
task, but does not restore nativefunction.zip
output, resulting in a build that does not work (native build outputs nothing)Expected behavior
When running
./gradlew build --build-cache
, I would expect gradle to either restore everything that was cached and result in a short build with the correct outputs, or to run tasks that weren't able to be cached, resulting in the correct outputs.Actual behavior
Testing locally and in CI using the steps detailed in the gradle docs.
I build the project (with the build cache flag enabled), it runs the native graalvm build using docker. I then run a clean to wipe the build directory I then rerun the exact same command as the initial build.
I would expect to see the
function.zip
populate in thebuild
directory, but nothing populates there. Looking at the log, gradle is marking thequarkusBuild
task asFROM CACHE
which is fine since I didn't change anything, but it should be restoring the function.zip then. But if it can't restore thefunction.zip
(per this PR, this is on purpose) then it should not mark the task as up to date. It is causing complete failure in our CI, since gradle refuses to run thequarkusBuild
task, but is also refusing to restore the zip we need to actually deploy.How to Reproduce?
You can reproduce this with any brand new amazon-lambda project, but here is an attached one just in case you don't want to build a new one.
quarkus-bug-oct-31-2023.zip
Steps:
./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true --build-cache
function.zip
is in thebuild
folder./gradlew clean --quiet
and verifybuild
folder is gone./gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true --build-cache
function.zip
will not be present,quarkusBuild
will be marked asUP TO DATE
even though the outputs are incorrect.Output of
uname -a
orver
Darwin SR-MB-502963 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:41:28 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_ARM64_T6000 arm64
Output of
java -version
openjdk version "18" 2022-03-22 OpenJDK Runtime Environment (build 18+36-2087) OpenJDK 64-Bit Server VM (build 18+36-2087, mixed mode, sharing)
Mandrel or GraalVM version (if different from Java)
No response
Quarkus version or git rev
both 2.16.4 and 3.5.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.3
Additional information
No response