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

[GHA] get-bootjdk action should return the abolute path

    XMLWordPrintable

Details

    • b13
    • generic
    • generic

    Backports

      Description

        We are running hotspot:tier2 on github action(GHA). I have difficulty to execute this unit test on GHA:
        Runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java


        It's fine to run it on my local linux environment. If we run it locally, the building script will assign the right java property for me and it's an absolute path.
         
        $make test TEST="runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java" CONF=linux-x86_64-server-fastdebug

        In GHA, the java property is gained from environment variable BOOT_JDK.
        BOOT_JDK=${{ steps.bootjdk.outputs.path }}

        https://github.com/openjdk/jdk/blob/master/.github/workflows/test.yml#L156

        it's from a custom action called 'get-bootjdk'. it is a relative path.

        Unit test TestAutoCreateSharedArchiveUpgrade.java will have problem to find the executable if BOOT_JDK is a relative path.
        https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java#L111C13-L111C19

        If we don't want to change action 'get-bootjdk', there are 2 alternatives:

        1) we hack environment variable 'PATH'. Not only it's not portable, we will have difficulty to deal with 'jtreg'. I found it always changes CWD and reset to PATH=/bin:/usr/bin:/usr/sbin

        2) change task definition. change BOOT_JDK to `pwd`/${{ steps.bootjdk.outputs.path }}. This approach isn't future-proof. We have multiple tasks which define BOOT_JDK, so we have to change them all and keep tabs on it in the future.
        https://github.com/openjdk/jdk/blob/master/.github/workflows/test.yml#L156

        I would recommend changing the action get-bootjdk. we just return the absolute path. we tried that it doesn't have problem on all platforms.

        Attachments

          Issue Links

            Activity

              People

                xliu Xin Liu
                xliu Xin Liu
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: