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

Warning "Build time property cannot be changed at runtime: quarkus.native.builder-image.pull" #36291

Closed
yrodiere opened this issue Oct 4, 2023 · 4 comments · Fixed by #36322
Labels
area/config kind/bug Something isn't working
Milestone

Comments

@yrodiere
Copy link
Member

yrodiere commented Oct 4, 2023

Describe the bug

I set the following environment variable on my laptop, because I don't want Quarkus to download GraalVM/Mandrel container images every two weeks when the floating tags get updated (see #33749):

# Avoid unnecessary pulls caused by tag updates
export QUARKUS_NATIVE_BUILDER_IMAGE_PULL=missing

It works just fine, but now every time I run a recent Quarkus application (even the quarkus CLI!), I get this warning:

2023-10-04 15:51:49,954 WARN  [io.qua.run.con.ConfigRecorder] (main) Build time property cannot be changed at runtime:
 - quarkus.native.builder-image.pull is set to 'missing' but it is build time fixed to 'always'. Did you change the property quarkus.native.builder-image.pull after building the application?

Obviously the warning is irrelevant here, since I'm not trying to build an application.

Expected behavior

I would rather not get a warning (or worse, a failure for applications that set quarkus.configuration.build-time-mismatch-at-runtime = fail).

Actual behavior

I get a warning (or worse, a failure for applications that set quarkus.configuration.build-time-mismatch-at-runtime = fail).

How to Reproduce?

Assuming you have the quarkus CLI installed:

export QUARKUS_NATIVE_BUILDER_IMAGE_PULL=missing
quarkus --help

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

One workaround would be for me to also set the following environment variable:

QUARKUS_CONFIGURATION_BUILD_TIME_MISMATCH_AT_RUNTIME=ignore

... if only ignore was supported. It's not.

But even if it was supported, I don't think it would be a good idea, as I would effectively ignore all such problems in all applications I work on, which is taking too much risk.

I wonder if the solution would not be simply to change the phase of configuration property quarkus.native.builder-image.pull, and make it BUILD instead of BUILD_AND_RUNTIME_FIXED? I don't see a good reason to have that property available at runtime. The main problem with this is that I would need to move the property to a whole different config mapping... seems messy.

Any opinion @radcortez ?

@yrodiere yrodiere added the kind/bug Something isn't working label Oct 4, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 4, 2023

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel)

@yrodiere
Copy link
Member Author

yrodiere commented Oct 4, 2023

By the way, this makes me think that we probably end up with unnecessary information in native executables... why would such an executable need to know that it was built with quarkus.native.builder-image.pull=always?

@radcortez
Copy link
Member

It works just fine, but now every time I run a recent Quarkus application (even the quarkus CLI!), I get this warning:

2023-10-04 15:51:49,954 WARN  [io.qua.run.con.ConfigRecorder] (main) Build time property cannot be changed at runtime:
 - quarkus.native.builder-image.pull is set to 'missing' but it is build time fixed to 'always'. Did you change the property quarkus.native.builder-image.pull after building the application?

Correct, but the Quarkus CLI, is a Quarkus application, subject to the same validations of any Quarkus app. Maybe we need to ignore such validations for the Quarkus CLI.

I wonder if the solution would not be simply to change the phase of configuration property quarkus.native.builder-image.pull, and make it BUILD instead of BUILD_AND_RUNTIME_FIXED? I don't see a good reason to have that property available at runtime. The main problem with this is that I would need to move the property to a whole different config mapping... seems messy.

The config is already BUILD. Any configuration in the BUILD or the BUILD_AND_RUNTIME_FIXED is validated against the runtime configuration to report to the user that he may be changing something that is not going to have an effect. Since you set that up as an environment variable, it is always going to be part of the runtime config.

If it makes sense for this property, you can produce a SuppressNonRuntimeConfigChangedWarningBuildItem to suppress the warning.

@yrodiere
Copy link
Member Author

yrodiere commented Oct 6, 2023

If it makes sense for this property, you can produce a SuppressNonRuntimeConfigChangedWarningBuildItem to suppress the warning.

I tend to think it makes sense for all properties that are very clearly only relevant when building... Which I suspect is a lot.

Thanks for the suggestion, I'll look into adding that build item.

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
2 participants