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

Build instructions for copying db to images have conflicting non-dependent targets

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 9
    • 9
    • infrastructure
    • None

      Images.gmk defines the following logic for the db component:

      ifndef OPENJDK
        DB_ZIP_DIR := $(wildcard $(JDK_TOPDIR)/src/closed/db)

        $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped: $(DB_ZIP_DIR)/%
              $(ECHO) Unzipping $(patsubst $(SRC_ROOT)/%,%,$<)
              $(RM) -r $(JDK_IMAGE_DIR)/db
              $(MKDIR) -p $(JDK_IMAGE_DIR)/db
              cd $(JDK_IMAGE_DIR)/db && $(UNZIP) -q -o $< -x */index.html */KEYS */test/* *javadoc/* */docs/* */demo/* 2> /dev/null
              cd $(JDK_IMAGE_DIR)/db && $(MV) db-derby-*-bin/* . && $(RM) -r db-derby-*-bin
              $(MKDIR) -p $(@D)
              $(TOUCH) $@

        $(JDK_IMAGE_DIR)/db/README-JDK.html: $(DB_ZIP_DIR)/README-JDK.html
              $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
              $(MKDIR) -p $(@D)
              $(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@

        $(JDK_IMAGE_DIR)/db/3RDPARTY: $(DB_ZIP_DIR)/3RDPARTY
              $(ECHO) $(LOG_INFO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
              $(MKDIR) -p $(@D)
              $(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@

        JDK_DB_TARGETS := $(patsubst $(DB_ZIP_DIR)/%, $(IMAGES_OUTPUTDIR)/_unzip/%.unzipped, \
            $(wildcard $(DB_ZIP_DIR)/*.zip)) \
            $(JDK_IMAGE_DIR)/db/README-JDK.html $(JDK_IMAGE_DIR)/db/3RDPARTY

      endif


      Note that the first target will delete the $(JDK_IMAGE_DIR)/db directory, while the following targets will try to copy files into it. There are no dependencies listed between these tasks and so they can run concurrently and hence conflict. This has been observed in JPRT builds.

            erikj Erik Joelsson
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: