OPENJDK env var not playing well with new build (original) (raw)

David Holmes david.holmes at oracle.com
Thu Jan 24 01:56:10 UTC 2013


On 23/01/2013 10:12 PM, Erik Joelsson wrote:

On 2013-01-23 12:54, David Holmes wrote:

On 23/01/2013 8:58 PM, Erik Joelsson wrote:

On 2013-01-23 11:30, Weijun Wang wrote:

I thought building an OpenJDK or Oracle JDK can be fully controlled by using the --enable-openjdk-only configure option, but it seems the OPENJDK env variable still plays a part. If the variable is set to true and --enable-openjdk-only is not provided, the new build process gets confused and fails. Can you point us at a log? I'd like to see exactly where the confusion arises.

I understand this is my fault and I should not have that variable around. However, it will be nice if the build can deny all external variables like it did with all those ALT*** variables. Are there any other variables I should be aware of?

This is bad, I agree. We initially kept the same variable for controlling if the build was OpenJDK only or not as the old build, because it made it easier during the conversion. The problem with this variable is that it is either set or not, which makes it harder to override in makefiles. The proper solution would be to replace this in the new build with something like OPENJDKONLY=true/false and completely ignore the old OPENJDK. Not sure why the set/unset situation is a problem. If OPENJDK is set then it must be set to true else the sanity checks fail. But we should locate anywhere that the make files still examine the environment for such variables - not that I thought there were such places. The environment variables should only be used to influence how configure runs, and the variables it sets should then be used by the make files. The problem I can imagine is this: Configure creates a configuration without --enable-openjdk-only, which results in a spec.gmk with no OPENJDK=true in it. OPENJDK=true is then set in the environment, which will trigger all ifdef OPENJDK in the makefiles.

Right - sorry. I was mistakenly thinking that make only looks at environment variables if asked via -e.

This was not a problem in the old build as the makefiles were responsible for setting up all the "environment", but now if --enable-openjdk-only influences the setting of other variables, then as you say we get a hybrid effect. :(

This would end up being a hybrid between fully open and a closed build since configure has already done things differently at configure time, but the makefiles will try to behave as if it was an open build. I don't know where this fails, but I'm not surprised that it does, and even if it didn't fail, the resulting bits would be bad. If instead spec.gmk would have a line like OPENJDKONLY=false, this would always override any environment variable.

Maybe we can at least detect this by setting OPENJDK_ONLY=true for --enable-openjdk-only and then doing in spec.gmk:

ifeq ($(OPENJDK_ONLY), false) ifeq ($(OPENJDK), true) error This is not an OPENJDK configuration. Ensure OPENJDK is not set in your environmemt fi fi

David

/Erik



More information about the core-libs-dev mailing list