Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8287191

[8u] Build failure without git information

    XMLWordPrintable

Details

    Description


      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.

      Attachments

        Issue Links

          Activity

            People

              jiefu Jie Fu
              jiefu Jie Fu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: