-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8
This is on behalf of seanwxiang@tencent.com .
The commit “8210283: Support git as an SCM alternative in the build” used git as an SCM.
In the source package “https://github.com/openjdk/jdk8u/archive/refs/tags/jdk8u332-ga.tar.gz”,
the git information has been removed in the source package.
When we compile JDK with the source code from the package, we get the below error:
```
Building 'linux-x86_64-normal-server-release' (matching CONF=release)
/bin/sh: line 0: [: too many arguments
```
The root cause is the lack of a non-empty check in the function
```
define GetSourceTips
$(CD) $(SRC_ROOT) ; \
if [ -d $(SCM_DIR) -a "$(SCM_VERSION)" != "" ] ; then \
$(ID_COMMAND) >> $@ ; \
elif [ -f $(SCM_TIP_FILENAME) ] ; then \
$(SCM_TIP_FILECMD) >> $@ ; \
fi;
$(PRINTF) "\n" >> $@
endef
```
In the scenario, SCM_DIR,SCM_VERSION,SCM_TIP_FILECMD aren’t defined. That causes the build failure.
we add a check with SCM to support the case where the SCM doesn‘t exist.
- duplicates
-
JDK-8286578 [8u] Build failure after rm -rf .git
-
- Closed
-
- relates to
-
JDK-8210283 Support git as an SCM alternative in the build
-
- Resolved
-
- links to
-
Review openjdk/jdk8u-dev/65