Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jtreg artifacts contain incorrect contents #165

Closed
smlambert opened this issue Jun 9, 2021 · 12 comments · Fixed by #172
Closed

jtreg artifacts contain incorrect contents #165

smlambert opened this issue Jun 9, 2021 · 12 comments · Fixed by #172
Assignees
Labels
Milestone

Comments

@smlambert
Copy link
Contributor

The https://ci.adoptopenjdk.net/view/Dependencies/job/dependency_pipeline/lastSuccessfulBuild/artifact/jtreg/ job produces several artifacts, some of them contain incorrect contents.

  • jtreg4.2.0 doesn't contain 4.2.0 (see Slack conversation)
  • this job used to produce 5.0.1b but started producing a 6+1 (test.getDependency and job is failing due to this change... was expecting the other version)
  • the name of the jtreg 6 file is 'problematic' jtreg--6+1 (and doesn't follow previous naming convention)

The Jenkinsfile and jtreg.sh files are in: https://github.com/adoptium/ci-jenkins-pipelines/tree/master/tools/code-tools

@smlambert
Copy link
Contributor Author

@jerboaa - looking for some assistance with this one if you have time to take it or advise on it, please :)

@sophia-guo
Copy link
Contributor

Looking at the code both buildJTRegTip() and buildJTRegLastTag() are calling buildJTReg(), which built jtreg by make/build-all.sh ["$JAVA_HOME"](https://github.com/adoptium/ci-jenkins-pipelines/blob/master/tools/code-tools/jtreg.sh#L141). So no different version information is passed in or considered. All builds (including build using the former scripts before migrated to github) are building the latest jtreg.

@sophia-guo
Copy link
Contributor

sophia-guo commented Jun 11, 2021

This could be fixed by checkout preferred release version https://github.com/adoptium/ci-jenkins-pipelines/blob/master/tools/code-tools/Jenkinsfile#L70

https://github.com/openjdk/jtreg/releases

@jerboaa
Copy link
Contributor

jerboaa commented Jun 14, 2021

@smlambert Are you still looking to get this fixed? If yes, I'll take a look later in the week.

@smlambert
Copy link
Contributor Author

If you can, that would be great thanks @jerboaa.

@jerboaa
Copy link
Contributor

jerboaa commented Jun 14, 2021

ok

@karianna karianna moved this from To do to In progress in ci-jenkins-pipelines Jun 14, 2021
@karianna karianna added this to the June 2021 milestone Jun 14, 2021
@jerboaa
Copy link
Contributor

jerboaa commented Jun 15, 2021

Note that JDK head now requires jtreg 6, which isn't backwards compatible. I.e. JDK 17+ will have to use jtreg 6 and other JDKs stay with jtreg 5 (should work for JDK 8 and 11). As such, I'm going to update the code to build jtreg 5 and jtreg 6.

See also:
https://bugs.openjdk.java.net/browse/JDK-8266254

@smlambert
Copy link
Contributor Author

Related: adoptium/aqa-tests#2642

@sophia-guo sophia-guo self-assigned this Jun 15, 2021
@sophia-guo
Copy link
Contributor

sophia-guo commented Jun 16, 2021

I have successful builds available using specific releases https://github.com/openjdk/jtreg/releases https://ci.adoptopenjdk.net/view/work-in-progress/job/GetNode/46/

The tricky thing is the build is building from my personal jtreg branch. https://github.com/sophia-guo/jtreg

The reason for that is jtreg set the latest tagged version by default , which also doesn't support passing in extra tag information:

if [ "$#" -ne 1 ]; then
    echo "Usage: $0 /path/to/jdk/1.8/image" >&2   
   exit 1
fi

get_tag_info() {   
    case $SCM_TYPE in 
        HG)  hg tags | grep jtreg | head -1 ;;   
       GIT) git tag | grep jtreg | tail -1 ;;  
          *) echo "Error: unknown SCM" >&2 ; exit 1 ;;   
   esac
}

## Set version and build numbers to the latest tagged version by default
TAG_INFO=`get_tag_info`

https://github.com/openjdk/jtreg/blob/master/make/build-all.sh#L287-L288

https://github.com/openjdk/jtreg/blob/master/make/build-all.sh#L31-L34

https://github.com/openjdk/jtreg/blob/master/make/build-all.sh#L84-L90

So looks like we need to set up a separate repo if we'd like to build versions other than the latest. Thought?

@jerboaa
Copy link
Contributor

jerboaa commented Jun 17, 2021

So looks like we need to set up a separate repo if we'd like to build versions other than the latest. Thought?

I'm not sure we need to.

@sophia-guo These two lines look like as if they would respect BUILD_NUMBER and BUILD_VERSION environment variables. Only if they're not set it would use TAG_INFO. Have you considered using something like this:

# explicitly build jtreg 5.1
export BUILD_NUMBER=b01
export BUILD_VERSION=5.1
bash make/build-all.sh
[...]

@sophia-guo
Copy link
Contributor

@jerboaa Thanks! Didn't bother to go further once I saw the line TAG_INFO=get_tag_info .

@sophia-guo
Copy link
Contributor

Just a note that for jtreg 6+ we don't need to export build_number and build_version any more. Specification of version info was added in different version-numbers.txt files. When building use build.sh for jtreg6+ while buildall.sh for jtreg5. Though buildall.sh stays in the jtreg6+, which is confusing.

ci-jenkins-pipelines automation moved this from In progress to Done Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants