Skip to content

Commit

Permalink
8210283: Support git as an SCM alternative in the build
Browse files Browse the repository at this point in the history
Removes forest handling of SCM ids

Reviewed-by: mikael, tbell
Backport-of: 054b85b1f65254b2d3d2a1d343e14d8eabd1af40
  • Loading branch information
erikj79 committed Apr 18, 2022
1 parent 87770b0 commit dfcf70d
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/build/
/dist/
/.idea/
nbproject/private/
/webrev
/.src-rev
/.jib/
/.hgtip
.DS_Store
.metadata/
.recommenders/
test/nashorn/script/external
test/nashorn/lib
NashornProfile.txt
**/JTreport/**
**/JTwork/**
/jdk/make/closed/
/jdk/src/closed/
3 changes: 2 additions & 1 deletion common/autoconf/basics.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, 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 Down Expand Up @@ -640,6 +640,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
fi
AC_PATH_PROGS(READELF, [readelf greadelf])
AC_PATH_PROG(HG, hg)
AC_PATH_PROG(GIT, git)
AC_PATH_PROG(STAT, stat)
AC_PATH_PROG(TIME, time)
# Check if it's GNU time
Expand Down
45 changes: 43 additions & 2 deletions common/autoconf/generated-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ DSYMUTIL
IS_GNU_TIME
TIME
STAT
GIT
HG
READELF
OTOOL
Expand Down Expand Up @@ -3108,7 +3109,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.

# Include these first...
#
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2022, 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 Down Expand Up @@ -3872,7 +3873,7 @@ fi
#CUSTOM_AUTOCONF_INCLUDE

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

###############################################################################
#
Expand Down Expand Up @@ -10449,6 +10450,46 @@ $as_echo "no" >&6; }
fi


# Extract the first word of "git", so it can be a program name with args.
set dummy git; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_GIT+:} false; then :
$as_echo_n "(cached) " >&6
else
case $GIT in
[\\/]* | ?:[\\/]*)
ac_cv_path_GIT="$GIT" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_GIT="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS

;;
esac
fi
GIT=$ac_cv_path_GIT
if test -n "$GIT"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIT" >&5
$as_echo "$GIT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


# Extract the first word of "stat", so it can be a program name with args.
set dummy stat; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
Expand Down
1 change: 1 addition & 0 deletions common/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ READELF:=@READELF@
EXPR:=@EXPR@
FILE:=@FILE@
HG:=@HG@
GIT:=@GIT@
OBJCOPY:=@OBJCOPY@
SETFILE:=@SETFILE@
XATTR:=@XATTR@
Expand Down
17 changes: 15 additions & 2 deletions make/common/MakeBase.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,13 @@ endef
# These should not be := assignments, only used from the root Makefile.
HG_VERSION = $(shell $(HG) version 2> /dev/null)
HG_DIRECTORY=.hg
GIT_DIRECTORY=.git
HGTIP_FILENAME=.hgtip
HG_SEARCH = ./REPO ./*/REPO ./*/*/REPO ./*/*/*/REPO
REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \
$(shell $(CD) $(SRC_ROOT) ; ( $(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \
$(shell $(CD) $(SRC_ROOT) ; ( \
$(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \
$(LS) -d $(HG_SEARCH:%/REPO=%/$(GIT_DIRECTORY)) ; \
$(LS) $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) ) \
2> /dev/null)))))

Expand All @@ -315,6 +318,12 @@ define GetSourceTips
elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \
$(PRINTF) " %s:%s" \
"$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \
elif [ -d $${i}/$(GIT_DIRECTORY) -a "$(GIT)" != "" ] ; then \
porcelain="`$(GIT) -C $${i} status --porcelain`" ; \
$(PRINTF) " %s:%s%s\n" \
"$${i}" \
"`$(GIT) -C $${i} log -n1 --format=%H | $(CUT) -c1-12`" \
"`if test -n \"$${porcelain}\"; then printf '+'; fi`" ; \
elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \
$(PRINTF) " %s:%s" \
"$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \
Expand All @@ -325,7 +334,11 @@ endef

# Create the HGTIP_FILENAME file. Called from jdk/make/closed/bundles.gmk
define CreateHgTip
$(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \
if [ -d $1/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \
$(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME); \
elif [ -d $1/$(GIT_DIRECTORY) -a "$(GIT)" != "" ] ; then \
$(GIT) -C $1 log -n1 --format=%H | $(CUT) -c1-12 > $1/$(HGTIP_FILENAME); \
fi ; \
$(ECHO) $1/$(HGTIP_FILENAME)
endef

Expand Down

1 comment on commit dfcf70d

@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.