-
Notifications
You must be signed in to change notification settings - Fork 213
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
Warn if the environment of the client does not match the environment of the daemon #122
Comments
The java version used to build is determined by the
|
Ok setting GRAALVM_HOME on JAVA_HOME works fine !! |
I think this is a general problem with environment variables that we should document at least. The daemon is inheriting the env from the first client that starts it. The env of any subsequent
Thus the following does not work:
But the following should work
|
I wonder whether the daemon (or client?) should compare the current environment to the initial one and issue a warning in case there are differences? Or even fail? |
I'd say a warning is enough, because not every change in the env matters. |
We could also pass the environment to the daemon and try to set it after displaying a warning. Alternatively, we could create a strategy so that the user can choose between various strategies : ignore (do not care about any differences) / warnAndSet (display a warning if there are some changes and try to override the JVM environment) / reject (creates a new daemon). The following code snippet should change the JVM environment. It should be conveyed to child processes started using the
|
I do not think the issue is critical enough for trying to change the env of a running daemon using reflection. I vote for present this as a limitation given by how the daemon works. |
I don't have any objection. However the hard part is the detection of the mismatch : we'd need to either store the daemon's environment in the library, or preferably, have the client send it to the daemon so that the daemon can detect mismatches and display warnings. |
Yes, I am in favor of this. |
Display warning in case of environment mismatch #122
#125 adds a warning - that's all we can do. |
@ppalaga Haven't tried it myself but is there one daemon per...hm...project path? |
No, only the Java version must match.
The behavior is described above. We have recently added a warning if the environments of the client and daemon are different. |
So that means that you cannot use What happens if you have multiple |
What kind of MAVEN_OPTS ? Like configuring memory ? Currently, those are not passed to the daemon anyway. The selection of a daemon is currently based only on the JAVA_HOME environment variable. You can very well build two different projects with the same daemon, the environment variables usually don't matter much, but if you have any specific thoughts, let me know.
There should be no problem in using different installations of |
I think we could handle |
JVM memory settings should be made confiurable, but I don't think we should pass them to the daemon. System properties are sent. If environment variables seem to be an issue, we now already send them, so it would be easy to override the environment instead. I'd like to better understand the real use case before implementing anything here. |
With stock Maven, the content of Our Our I guess users may expect |
I do not say that's necessarily a good idea, but we should at least consider having a mechanism for starting the daemon with custom JVM args. |
Hello, I have 3 different versions of graalvm install on my linux machine (RHEL 8).
while usen mvn, it takes the version in $GRAALVM_HOME.
But when I use mvnd, it uses a different version. Is it an issue, or do I need to configure something? How can I switch to another version of GraalVm ?
FYI, I was compiling the quarkus way!!
The text was updated successfully, but these errors were encountered: