Improper passing of variables to submake
Martin Buchholz
martinrb at google.com
Wed Jun 4 23:08:47 UTC 2008
This is a bug report with patch.
Tim or Kelly, please file a bug on my behalf, and review my fix.
In OpenJDK7,
If you do "make sanity" from the root of the forest, I get
PREVIOUS_JDK_FILE = jdk--linux-i586.tar.gz
ALT_PREVIOUS_JDK_FILE =
PREVIOUS_JRE_FILE = jre--linux-i586.tar.gz
ALT_PREVIOUS_JRE_FILE =
If I do this from jdk/make, I get:
PREVIOUS_JDK_FILE = jdk-6-linux-i586.tar.gz
ALT_PREVIOUS_JDK_FILE =
PREVIOUS_JRE_FILE = jre-6-linux-i586.tar.gz
ALT_PREVIOUS_JRE_FILE =
Why the difference? It's the same code generating these messages
in both cases?!?!
Analyzing the twisty maze of Makefiles,
I see the "6" comes from PREVIOUS_JDK_UNDERSCORE_VERSION,
which in turn comes from PREVIOUS_MINOR_VERSION.
which is in turn initialized here:
ifndef JDK_MINOR_VERSION
JDK_MINOR_VERSION = 7
PREVIOUS_MINOR_VERSION = 6
endif
The above code assumes that JDK_MINOR_VERSION is set if and only if
PREVIOUS_MINOR_VERSION is set. However, that invariant
is violated by the way makefile variables are passed to submakes
via COMMON_BUILD_ARGUMENTS
# Common make arguments (supplied to all component builds)
COMMON_BUILD_ARGUMENTS = \
JDK_TOPDIR=$(ABS_JDK_TOPDIR) \
JDK_MAKE_SHARED_DIR=$(ABS_JDK_TOPDIR)/make/common/shared \
EXTERNALSANITYCONTROL=true \
TARGET_CLASS_VERSION=$(TARGET_CLASS_VERSION) \
MILESTONE=$(MILESTONE) \
BUILD_NUMBER=$(BUILD_NUMBER) \
JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) \
FULL_VERSION=$(FULL_VERSION) \
PREVIOUS_JDK_VERSION=$(PREVIOUS_JDK_VERSION) \
JDK_VERSION=$(JDK_VERSION) \
JDK_MKTG_VERSION=$(JDK_MKTG_VERSION) \
JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) \
JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) \
JDK_MICRO_VERSION=$(JDK_MICRO_VERSION)
which in turn makes the fix obvious
(but we had better make sure to audit all the above variables
for occurences of the same bug)
(Note also that more serious consequences could come
from the incorrect assignments to variables)
# HG changeset patch
# User martin
# Date 1212620758 25200
# Node ID 33721e5e42170723d2ac66ed1d5929e688ea1404
# Parent 56652b46f328937f6b9b5130f1e4cd80f48868ef
[mq]: MakeVariables.patch
diff --git a/make/Defs-internal.gmk b/make/Defs-internal.gmk
--- a/make/Defs-internal.gmk
+++ b/make/Defs-internal.gmk
@@ -225,7 +225,10 @@
JDK_MKTG_VERSION=$(JDK_MKTG_VERSION) \
JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) \
JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) \
- JDK_MICRO_VERSION=$(JDK_MICRO_VERSION)
+ JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) \
+ PREVIOUS_MAJOR_VERSION=$(PREVIOUS_MAJOR_VERSION) \
+ PREVIOUS_MINOR_VERSION=$(PREVIOUS_MINOR_VERSION) \
+ PREVIOUS_MICRO_VERSION=$(PREVIOUS_MICRO_VERSION)
ifdef ARCH_DATA_MODEL
COMMON_BUILD_ARGUMENTS += ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)
More information about the build-dev
mailing list