Skip to content

workaround(java-25): add java-25-openjdk and java-25-openjdk-portable compon…#16070

Merged
reubeno merged 4 commits intotomls/base/mainfrom
bphilip/java-25-pull-f44
Mar 3, 2026
Merged

workaround(java-25): add java-25-openjdk and java-25-openjdk-portable compon…#16070
reubeno merged 4 commits intotomls/base/mainfrom
bphilip/java-25-pull-f44

Conversation

@binujp
Copy link
Contributor

@binujp binujp commented Mar 2, 2026

java25 needs sources supplied by java-portable-sources which is version 25.0.20.0.10 in fed43 repo. Fedora build pulls in this version from fed42 repo. Downgrading java25 to version 25.0.0.0.32 via an older snapshot date takes care of this.

For java25 portable build, there is a bootstrap stage which needs N-1 jdk version, 24 in our case. This is not available in fed43 or fed42 and fedora build pulls this from fed41. We have to fix this to get stage2 build going. Downgrade will not work. Instead we override the bootstrap java version to 25 - self bootstrap, which will be built by stage1.

Below is copilot's explanation of the mechanics of the change.

Add dedicated component definitions for java-25-openjdk-portable and java-25-openjdk, migrating them from inline definitions in components-full.toml to dedicated comp.toml files with overlays to fix two build failures:

  1. Missing bootstrap JDK: The upstream Fedora spec uses conditional BuildRequires that resolve to java-latest-openjdk-devel, which does not pull in a specific JDK version. Added an explicit BuildRequires for java-25-openjdk-devel and set buildjdkver to 25.

  2. ccache symlink rejection: OpenJDK's autoconf configure script detects /usr/lib64/ccache/gcc as a ccache wrapper symlink and refuses to proceed:

    configure: error: /usr/lib64/ccache/gcc is a symbolic link to
    ccache. This is not supported.

    Added exports for CC=/usr/bin/gcc, CXX=/usr/bin/g++, and GCC=/usr/bin/gcc in the %build section to bypass the ccache wrappers in PATH.

Overlays applied to java-25-openjdk-portable:

  • spec-search-replace: buildjdkver 24 -> 25
  • spec-add-tag: BuildRequires java-25-openjdk-devel
  • spec-prepend-lines: export CC/CXX/GCC to real compiler paths

java-25-openjdk uses a separate Fedora 43 snapshot (2025-07-30) to match the portable sources version produced by java-25-openjdk-portable.

Tested: Built java-25-openjdk-portable-25.0.0.0.32-0.1.ea.azl4 successfully, producing 13 RPMs (runtime, devel, docs, sources, static-libs, and debug variants).

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

What does the PR accomplish, why was it needed?

Change Log
  • Change
  • Change
  • Change
Does this affect the toolchain?

YES/NO

Associated issues
  • #xxxx
Links to CVEs
Test Methodology
  • Pipeline build id: xxxx

Copilot AI review requested due to automatic review settings March 2, 2026 02:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds dedicated component definitions for Java 25 OpenJDK packages to pin Fedora snapshots and apply overlays needed to unblock the portable build/bootstrap process.

Changes:

  • Introduce dedicated *.comp.toml files for java-25-openjdk and java-25-openjdk-portable.
  • Pin Fedora 43 snapshots for both components to align with the desired upstream state.
  • Add overlays for the portable build to self-bootstrap (buildjdkver + explicit BuildRequires) and bypass the ccache symlink wrapper issue.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
base/comps/java-25-openjdk/java-25-openjdk.comp.toml New dedicated component definition with an upstream Fedora snapshot pin.
base/comps/java-25-openjdk-portable/java-25-openjdk-portable.comp.toml New dedicated component definition with snapshot pin + overlays for bootstrap/compiler environment.
base/comps/components-full.toml Removes inline component entries now that dedicated files exist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5 to +11
description = "Override buildjdkver to use Java 21 instead of 24 for bootstrap"
type = "spec-search-replace"
regex = '^%global buildjdkver 24$'
replacement = '%global buildjdkver 25'

[[components.java-25-openjdk-portable.overlays]]
description = "We need JDK 25 to build sicne that is our bootstrap version"
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overlay description says it switches the bootstrap JDK to Java 21, but the replacement actually changes buildjdkver from 24 to 25. Please correct the description to reflect what the overlay does so future readers don’t misinterpret the bootstrap strategy.

Suggested change
description = "Override buildjdkver to use Java 21 instead of 24 for bootstrap"
type = "spec-search-replace"
regex = '^%global buildjdkver 24$'
replacement = '%global buildjdkver 25'
[[components.java-25-openjdk-portable.overlays]]
description = "We need JDK 25 to build sicne that is our bootstrap version"
description = "Override buildjdkver to use Java 25 instead of 24 for bootstrap"
type = "spec-search-replace"
regex = '^%global buildjdkver 24$'
replacement = '%global buildjdkver 25'
[[components.java-25-openjdk-portable.overlays]]
description = "We need JDK 25 to build since that is our bootstrap version"

Copilot uses AI. Check for mistakes.
replacement = '%global buildjdkver 25'

[[components.java-25-openjdk-portable.overlays]]
description = "We need JDK 25 to build sicne that is our bootstrap version"
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in overlay description: “sicne” → “since”.

Suggested change
description = "We need JDK 25 to build sicne that is our bootstrap version"
description = "We need JDK 25 to build since that is our bootstrap version"

Copilot uses AI. Check for mistakes.
description = "Set GCC and CC environment variables to /usr/bin/gcc to avoid ccache symlink that OpenJDK configure rejects"
type = "spec-prepend-lines"
section = "%build"
lines = ["export GCC=/usr/bin/gcc", "export CC=/usr/bin/gcc", "export CXX=/usr/bin/g++"]
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability/maintainability, please format the lines list as a multi-line TOML array when it contains multiple entries (consistent with other overlays in this repo). This makes diffs and future edits less error-prone.

Suggested change
lines = ["export GCC=/usr/bin/gcc", "export CC=/usr/bin/gcc", "export CXX=/usr/bin/g++"]
lines = [
"export GCC=/usr/bin/gcc",
"export CC=/usr/bin/gcc",
"export CXX=/usr/bin/g++",
]

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@ddstreetmicrosoft ddstreetmicrosoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not marking this review as 'request changes' because i don't want to block getting everything building, but I added some comments to explain why I would normally block this PR.

@@ -0,0 +1,20 @@
[components.java-25-openjdk-portable]
spec = { type = "upstream", upstream-distro = { name = "fedora", version = "43", snapshot = "2025-07-22T00:00:00-08:00" } }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package builds fine for me in a local build, once I disable mock ccache. What's the reason we need to use the older version?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correction - it builds fine, but %check fails, if that's the reason for using the older version, shouldn't we just disable %check for now instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package will not build in stage2 because we do not build jdk24 in stage1. I am also not sure how it built for you without attempting to pull in jdk24! Can you please check what version of jdk it used to bootstrap or did you disable bootstrap build?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@binujp binujp changed the title fix(java-25): add java-25-openjdk and java-25-openjdk-portable compon… workaround(java-25): add java-25-openjdk and java-25-openjdk-portable compon… Mar 2, 2026
@ddstreetmicrosoft
Copy link
Contributor

I built java-25-openjdk-portable locally with only 2 changes:

  1. set config_opts['plugin_conf']['ccache_enable'] = False in distro/mock/azurelinux-4.0.tpl
  2. add overlay to fix spec file missing %changelog section:
[[components.java-25-openjdk-portable.overlays]]
type = "spec-search-replace"
regex = "%autochangelog"
replacement = "%changelog\n%autochangelog"

The java-25-openjdk package does need to build at the older commit for stage1. After we finish bootstrapping we can (and should) remove that.

@ddstreetmicrosoft
Copy link
Contributor

We had some discussion and the issue here is a stage1/stage2 problem:

For stage1, the java-25-openjdk-portable package will build fine (with changes noted), but the java-25-openjdk will not build because the version of the java-25-openjdk-portable pacakge it needs has not been published in f43. So an older version of the java-25-opendjk package must be built in stage1, using the older java-25-openjdk-portable published in f43.

Then in stage2, which uses only packages built in stage1 and does not use the f43 repo packages, the java-25-openjdk-portable package can still build (with noted changes), but the java-25-openjdk package will not build, because the older java-25-openjdk-portable package is not available.

This is the easiest way to get both packages building in both stages, i.e. set both to the older version. After our bootstrap phase we can iterate up to the latest version.

One change I would prefer is to not add the workaround for ccache; if we can merge #16081 first, then this PR can remove the ccache workaround.

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Spec Review Failed

Type Count
Errors 2
Warnings 4
Suggestions 4

🛠️ Debug locally: .github/workflows/scripts/README.md

azurelinux-release.spec

❌ Errors (1)
  • identity-wsl requires azurelinux-release-container via Requires(meta); this should reference the WSL variant to avoid pulling the container package.
⚠️ Warnings (3)
💡 Suggestions (2)

azurelinux-stage1-compat.spec

❌ Errors (1)
⚠️ Warnings (1)
💡 Suggestions (2)
📄 Raw JSON Report
{
  "spec_reviews": [
    {
      "spec_file": "base/comps/azurelinux-release/azurelinux-release.spec",
      "errors": [
        {
          "description": "identity-wsl requires azurelinux-release-container via Requires(meta); this should reference the WSL variant to avoid pulling the container package.",
          "citation": "N/A",
          "line": 211
        }
      ],
      "warnings": [
        {
          "description": "Top-level macros are defined with %define; guidelines prefer %global unless local scoping or lazy expansion is required.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#_global_preferred_over_define",
          "line": 1
        },
        {
          "description": "Unresolved TODO comments in the spec indicate pending review items that should be resolved or tracked externally before shipping.",
          "citation": "N/A",
          "line": 8
        },
        {
          "description": "Changelog entry says 'Initial version' but Release is 2; if 4.0-1 was built, it needs a changelog entry, otherwise Release should be 1.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/manual-changelog/",
          "line": 453
        }
      ],
      "suggestions": [
        {
          "description": "Consider using %autorelease for Release unless a manual scheme is required.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/",
          "line": 39
        },
        {
          "description": "Consider using %autochangelog (recommended) instead of a manual %changelog.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#changelogs",
          "line": 452
        }
      ]
    },
    {
      "spec_file": "base/comps/azurelinux-stage1-compat/azurelinux-stage1-compat.spec",
      "errors": [
        {
          "description": "License text is not packaged: MIT-licensed content should include a license file and list it with %license in %files.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/LicensingGuidelines/",
          "line": 22
        }
      ],
      "warnings": [
        {
          "description": "Hard-coded /usr/bin paths in %install/%files; prefer %{_bindir} for macro consistency.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/RPMMacros/",
          "line": 16
        }
      ],
      "suggestions": [
        {
          "description": "Consider using %autorelease for Release unless a manual scheme is required.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/",
          "line": 4
        },
        {
          "description": "Consider using %autochangelog (recommended) instead of a manual %changelog.",
          "citation": "https://docs.fedoraproject.org/en-US/packaging-guidelines/#changelogs",
          "line": 25
        }
      ]
    }
  ]
}

@ddstreetmicrosoft
Copy link
Contributor

i think your rebase might have got messed up, there's a lot of wrong-hash commits in your pr for recent changes to the tomls/base/main branch

@binujp
Copy link
Contributor Author

binujp commented Mar 2, 2026

Whoops, let me take a look.

@binujp binujp force-pushed the bphilip/java-25-pull-f44 branch from a7deadd to 85bc115 Compare March 2, 2026 23:17
binujp added 3 commits March 2, 2026 23:19
…ents

java25 needs sources supplied by java-portable-sources which is version 25.0.20.0.10
in fed43 repo. Fedora build pulls in this version from fed42 repo. Downgrading java25
to version 25.0.0.0.32 via an older snapshot date takes care of this.

For java25 portable build, there is a bootstrap stage which needs N-1 jdk version, 24
in our case. This is not available in fed43 or fed42 and fedora build pulls this from
fed41. We have to fix this to get stage2 build going. Downgrade will not work. Instead
we override the bootstrap java version to 25 - self bootstrap, which will be built by
stage1.

Below is copilot's explanation of the mechanics of the change.

Add dedicated component definitions for java-25-openjdk-portable and
java-25-openjdk, migrating them from inline definitions in
components-full.toml to dedicated comp.toml files with overlays to fix
two build failures:

1. Missing bootstrap JDK: The upstream Fedora spec uses conditional
   BuildRequires that resolve to java-latest-openjdk-devel, which does
   not pull in a specific JDK version. Added an explicit BuildRequires
   for java-25-openjdk-devel and set buildjdkver to 25.

2. ccache symlink rejection: OpenJDK's autoconf configure script
   detects /usr/lib64/ccache/gcc as a ccache wrapper symlink and
   refuses to proceed:

     configure: error: /usr/lib64/ccache/gcc is a symbolic link to
     ccache. This is not supported.

   Added exports for CC=/usr/bin/gcc, CXX=/usr/bin/g++, and
   GCC=/usr/bin/gcc in the %build section to bypass the ccache
   wrappers in PATH.

Overlays applied to java-25-openjdk-portable:
- spec-search-replace: buildjdkver 24 -> 25
- spec-add-tag: BuildRequires java-25-openjdk-devel
- spec-prepend-lines: export CC/CXX/GCC to real compiler paths

java-25-openjdk uses a separate Fedora 43 snapshot (2025-07-30) to
match the portable sources version produced by java-25-openjdk-portable.

Tested: Built java-25-openjdk-portable-25.0.0.0.32-0.1.ea.azl4
successfully, producing 13 RPMs (runtime, devel, docs, sources,
static-libs, and debug variants).
@binujp binujp force-pushed the bphilip/java-25-pull-f44 branch from 85bc115 to 4543b74 Compare March 2, 2026 23:19
@reubeno reubeno merged commit 7326cfd into tomls/base/main Mar 3, 2026
5 checks passed
@reubeno reubeno deleted the bphilip/java-25-pull-f44 branch March 3, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants