Skip to content
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

Runtime property being resolved at build time #44246

Closed
rodcheater opened this issue Nov 1, 2024 · 5 comments · Fixed by #44572
Closed

Runtime property being resolved at build time #44246

rodcheater opened this issue Nov 1, 2024 · 5 comments · Fixed by #44572
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@rodcheater
Copy link
Contributor

Describe the bug

Some configuration properties which are supposed to be resolved at runtime are being resolved at build time, resulting in build errors when referencing runtime properties such as user.home. This appears to be a regression on main and does not affect the released version 3.15.1.

Expected behavior

quarkus.log.file.path is resolved at runtime.

Actual behavior

quarkus.log.file.path is resolved at build time.

How to Reproduce?

Reproducer: quarkus-reproducer.zip

Steps to reproduce

Add or edit this line in application.properties:

quarkus.log.file.path=${user.home}/quarkus-reproducer.log

Run ./gradlew quarkusAppPartsBuild.

The following error is reported:

> Task :quarkusAppPartsBuild FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':quarkusAppPartsBuild'.
> There was a failure while executing work items
   > A failure occurred while executing io.quarkus.gradle.tasks.worker.BuildWorker
      > Configuration validation failed:
                java.util.NoSuchElementException: SRCFG00011: Could not expand value user.home in property quarkus.log.file.path

Output of uname -a or ver

Darwin Rods-MacBook-Pro.local 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:35:10 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T6031 arm64

Output of java -version

openjdk version "21.0.4" 2024-07-16 OpenJDK Runtime Environment Homebrew (build 21.0.4) OpenJDK 64-Bit Server VM Homebrew (build 21.0.4, mixed mode, sharing)

Quarkus version or git rev

e81fa0c

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 8.9

Additional information

No response

@rodcheater rodcheater added the kind/bug Something isn't working label Nov 1, 2024
@gsmet
Copy link
Member

gsmet commented Nov 18, 2024

@cdsap @radcortez not sure if it's a Gradle or SmallRye Config regression but it looks serious.

@radcortez
Copy link
Member

I'll have a look.

@cdsap
Copy link
Contributor

cdsap commented Nov 18, 2024

@radcortez can you reproduce it?
I tried building the reproducer but the settings.gradle include:

libs {
  version('quarkus', '999-SNAPSHOT')
  library('quarkus-bom', 'io.quarkus', 'quarkus-bom').versionRef('quarkus')
}

Pointing to 3.16.3 works and the build is not failing.
What am I missing?

@rodcheater
Copy link
Contributor Author

It’s subtle, but the OP mentions that it’s a regression on main; i.e., you’ll need to build Quarkus locally so that 999-SNAPSHOT points to the version in Maven local.

@gsmet
Copy link
Member

gsmet commented Nov 20, 2024

Thanks a lot for reporting this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants