Skip to content

Commit

Permalink
8031567: Better model for storing source revision information
Browse files Browse the repository at this point in the history
8170385: JDK-8031567 broke source bundles
8170392: JDK-8031567 broke builds from source bundles

Reviewed-by: sgehwolf
Backport-of: 27b7ab8b27a5548ed4cd823d35c8190a594bfdd1
  • Loading branch information
gnu-andrew committed May 26, 2022
1 parent 2194c53 commit e3b9a06
Show file tree
Hide file tree
Showing 13 changed files with 222 additions and 77 deletions.
3 changes: 1 addition & 2 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
^dist/
nbproject/private/
^webrev
^.hgtip
^.bridge2
^.src-rev$
.DS_Store
# Default ignored files
.idea/workspace.xml
Expand Down
38 changes: 26 additions & 12 deletions common/autoconf/generated-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4278,7 +4278,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"


#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -4304,7 +4304,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"

################################################################################
# The order of these defines the priority by which we try to find them.
VALID_VS_VERSIONS="2010 2012 2013 2015 2017"
VALID_VS_VERSIONS="2010 2012 2013 2015 2017 2019"

VS_DESCRIPTION_2010="Microsoft Visual Studio 2010"
VS_VERSION_INTERNAL_2010=100
Expand Down Expand Up @@ -4362,6 +4362,20 @@ VS_SDK_INSTALLDIR_2017=
VS_VS_PLATFORM_NAME_2017="v141"
VS_SDK_PLATFORM_NAME_2017=

VS_DESCRIPTION_2019="Microsoft Visual Studio 2019"
VS_VERSION_INTERNAL_2019=141
VS_MSVCR_2019=vcruntime140.dll
VS_MSVCP_2019=msvcp140.dll
VS_ENVVAR_2019="VS160COMNTOOLS"
VS_USE_UCRT_2019="true"
VS_VS_INSTALLDIR_2019="Microsoft Visual Studio/2019"
VS_EDITIONS_2019="BuildTools Community Professional Enterprise"
VS_SDK_INSTALLDIR_2019=
VS_VS_PLATFORM_NAME_2019="v142"
VS_SDK_PLATFORM_NAME_2019=
VS_SUPPORTED_2019=false
VS_TOOLSET_SUPPORTED_2019=false

################################################################################


Expand Down Expand Up @@ -4403,7 +4417,7 @@ VS_SDK_PLATFORM_NAME_2017=
#CUSTOM_AUTOCONF_INCLUDE

# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1648806331
DATE_WHEN_GENERATED=1652838310

###############################################################################
#
Expand Down Expand Up @@ -25874,7 +25888,7 @@ $as_echo "$as_me: Valid Visual Studio versions: $VALID_VS_VERSIONS." >&6;}
VS_BASE="$unix_path"
fi

# In VS 2017, the default installation is in a subdir named after the edition.
# In VS 2017 and VS 2019, the default installation is in a subdir named after the edition.
# Find the first one present and use that.
if test "x$VS_EDITIONS" != x; then
for edition in $VS_EDITIONS; do
Expand Down Expand Up @@ -25931,7 +25945,7 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal
VS_BASE="$unix_path"
fi

# In VS 2017, the default installation is in a subdir named after the edition.
# In VS 2017 and VS 2019, the default installation is in a subdir named after the edition.
# Find the first one present and use that.
if test "x$VS_EDITIONS" != x; then
for edition in $VS_EDITIONS; do
Expand Down Expand Up @@ -26004,7 +26018,7 @@ $as_echo "$as_me: directory within the Visual Studio installation" >&6;}
VS_BASE="$unix_path"
fi

# In VS 2017, the default installation is in a subdir named after the edition.
# In VS 2017 and VS 2019, the default installation is in a subdir named after the edition.
# Find the first one present and use that.
if test "x$VS_EDITIONS" != x; then
for edition in $VS_EDITIONS; do
Expand Down Expand Up @@ -26063,7 +26077,7 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal
VS_BASE="$unix_path"
fi

# In VS 2017, the default installation is in a subdir named after the edition.
# In VS 2017 and VS 2019, the default installation is in a subdir named after the edition.
# Find the first one present and use that.
if test "x$VS_EDITIONS" != x; then
for edition in $VS_EDITIONS; do
Expand Down Expand Up @@ -26124,7 +26138,7 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal
VS_BASE="$unix_path"
fi

# In VS 2017, the default installation is in a subdir named after the edition.
# In VS 2017 and VS 2019, the default installation is in a subdir named after the edition.
# Find the first one present and use that.
if test "x$VS_EDITIONS" != x; then
for edition in $VS_EDITIONS; do
Expand Down Expand Up @@ -26182,7 +26196,7 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal
VS_BASE="$unix_path"
fi

# In VS 2017, the default installation is in a subdir named after the edition.
# In VS 2017 and VS 2019, the default installation is in a subdir named after the edition.
# Find the first one present and use that.
if test "x$VS_EDITIONS" != x; then
for edition in $VS_EDITIONS; do
Expand Down Expand Up @@ -26239,7 +26253,7 @@ $as_echo "$as_me: Warning: None of $VCVARSFILES were found, Visual Studio instal
VS_BASE="$unix_path"
fi

# In VS 2017, the default installation is in a subdir named after the edition.
# In VS 2017 and VS 2019, the default installation is in a subdir named after the edition.
# Find the first one present and use that.
if test "x$VS_EDITIONS" != x; then
for edition in $VS_EDITIONS; do
Expand Down Expand Up @@ -50104,7 +50118,7 @@ $as_echo "$as_me: The path of CYGWIN_VC_INSTALL_DIR, which resolves as \"$path\"
POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
fi
else
# Probe: Using well-known location from VS 2017
# Probe: Using well-known location from VS 2017 and VS 2019
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
else
Expand Down Expand Up @@ -51507,7 +51521,7 @@ $as_echo "$as_me: The path of CYGWIN_VC_INSTALL_DIR, which resolves as \"$path\"
POSSIBLE_MSVC_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME"
fi
else
# Probe: Using well-known location from VS 2017
# Probe: Using well-known location from VS 2017 and VS 2019
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
POSSIBLE_MSVC_DLL="`ls $CYGWIN_VC_INSTALL_DIR/Redist/MSVC/*/x64/Microsoft.VC${VS_VERSION_INTERNAL}.CRT/$DLL_NAME`"
else
Expand Down
1 change: 0 additions & 1 deletion corba/.hgignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
^build/
^dist/
/nbproject/private/
^.hgtip
.DS_Store
1 change: 0 additions & 1 deletion hotspot/.hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
^src/share/tools/IdealGraphVisualizer/[a-zA-Z0-9]*/build/
^src/share/tools/IdealGraphVisualizer/build/
^src/share/tools/IdealGraphVisualizer/dist/
^.hgtip
.DS_Store
1 change: 0 additions & 1 deletion jaxp/.hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
^drop_included/
^webrev/
/nbproject/private/
^.hgtip
1 change: 0 additions & 1 deletion jaxws/.hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
^drop_included/
^webrev/
/nbproject/private/
^.hgtip
.DS_Store
1 change: 0 additions & 1 deletion jdk/.hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
/nbproject/private/
^make/netbeans/.*/build/
^make/netbeans/.*/dist/
^.hgtip
.DS_Store
17 changes: 9 additions & 8 deletions jdk/make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -617,30 +617,31 @@ define create-info-file
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)")
$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
if [ -n "$(JDK_ARCH_ABI_PROP_NAME)" ]; then $(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"); fi
$(call info-file-item, "SOURCE", "$(ALL_SOURCE_TIPS)")
$(call info-file-item, "SOURCE", "$(strip $(SOURCE_REVISION))")
endef

ALL_SOURCE_TIPS = $(shell \
if [ -f $(OUTPUT_ROOT)/source_tips ] ; then \
$(CAT) $(OUTPUT_ROOT)/source_tips ; \
SOURCE_REVISION = $(shell \
if [ -f $(SOURCE_REVISION_TRACKER) ] ; then \
$(CAT) $(SOURCE_REVISION_TRACKER) ; \
fi)

$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
# The SOURCE_REVISION_TRACKER file may not exist. Only depend on it if it does.
$(JRE_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(wildcard $(SOURCE_REVISION_TRACKER))
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(call create-info-file)
ifneq ($(PROFILE), )
$(call info-file-item, "JAVA_PROFILE", "$(call profile_name, $(call profile_number, $(PROFILE)))")
endif

$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
$(JDK_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(wildcard $(SOURCE_REVISION_TRACKER))
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(call create-info-file)

$(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
$(JRE_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(wildcard $(SOURCE_REVISION_TRACKER))
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(call create-info-file)

$(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(OUTPUT_ROOT)/source_tips
$(JDK_OVERLAY_INFO_FILE): $(OUTPUT_ROOT)/spec.gmk $(wildcard $(SOURCE_REVISION_TRACKER))
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(call create-info-file)

Expand Down
1 change: 0 additions & 1 deletion langtools/.hgignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
^build/
^dist/
/nbproject/private/
^.hgtip
.DS_Store
20 changes: 9 additions & 11 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,19 @@ demos-only: start-make

# Note: This double-colon rule is intentional, to support
# custom make file integration.
images:: source-tips demos nashorn images-only
images:: create-source-revision-tracker demos nashorn images-only
images-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
@$(call TargetExit)

overlay-images: source-tips demos overlay-images-only
overlay-images: create-source-revision-tracker demos overlay-images-only
overlay-images-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images)
@$(call TargetExit)

profiles: source-tips jdk hotspot profiles-only
profiles: create-source-revision-tracker jdk hotspot profiles-only
profiles-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles)
Expand Down Expand Up @@ -196,18 +196,15 @@ test-only: start-make
exit $${EXIT}; \
fi)

# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
# used to track the exact sources used to build that image.
source-tips: $(OUTPUT_ROOT)/source_tips
$(OUTPUT_ROOT)/source_tips: FRC
@$(MKDIR) -p $(@D)
@$(RM) $@
@$(call GetSourceTips)
store-source-revision:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk store-source-revision)

create-source-revision-tracker:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f SourceRevision.gmk create-source-revision-tracker)

# Remove everything, except the output from configure.
clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-overlay-images clean-bootcycle-build clean-docs clean-test
@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log* build-trace*.log*)
@($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp $(wildcard $(patsubst $(OUTPUT_ROOT)/%,%,$(SOURCE_REVISION_TRACKER))) build.log* build-trace*.log*)
@$(ECHO) Cleaned all build artifacts.

# Remove everything, including configure configuration.
Expand Down Expand Up @@ -265,6 +262,7 @@ reconfigure:
.PHONY: default all clean dist-clean bootcycle-images start-make
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-docs-zip clean-test clean-overlay-images clean-bootcycle-build
.PHONY: profiles profiles-only
.PHONY: store-source-revision create-source-revision-tracker

include $(root_dir)/make/Jprt.gmk

Expand Down
Loading

1 comment on commit e3b9a06

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.