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

Overgrowing of the toolchains.xml on the self-hosted runners #530

Open
4 of 5 tasks
IvanZosimov opened this issue Aug 23, 2023 · 0 comments · May be fixed by #534
Open
4 of 5 tasks

Overgrowing of the toolchains.xml on the self-hosted runners #530

IvanZosimov opened this issue Aug 23, 2023 · 0 comments · May be fixed by #534
Assignees
Labels
bug Something isn't working

Comments

@IvanZosimov
Copy link
Contributor

Description:
Every time build runs setup-java adds a new toolchain element to toolchains.xml. Even it already exists.

<?xml version="1.0"?>
<toolchains xmlns="https://maven.apache.org/TOOLCHAINS/1.1.0"
  xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>17</version>
      <vendor>temurin</vendor>
      <id>temurin_17</id>
    </provides>
    <configuration>
      <jdkHome>C:\actions-runner\_work\_tool\Java_Temurin-Hotspot_jdk\17.0.7-7\x64</jdkHome>
    </configuration>
  </toolchain>
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>17</version>
      <vendor>temurin</vendor>
      <id>temurin_17</id>
    </provides>
    <configuration>
      <jdkHome>C:\actions-runner\_work\_tool\Java_Temurin-Hotspot_jdk\17.0.7-7\x64</jdkHome>
    </configuration>
  </toolchain>
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>17</version>
      <vendor>temurin</vendor>
      <id>temurin_17</id>
    </provides>
    <configuration>
      <jdkHome>C:\actions-runner\_work\_tool\Java_Temurin-Hotspot_jdk\17.0.7-7\x64</jdkHome>
    </configuration>
  </toolchain>
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>17</version>
      <vendor>temurin</vendor>
      <id>temurin_17</id>
    </provides>
    <configuration>
      <jdkHome>C:\actions-runner\_work\_tool\Java_Temurin-Hotspot_jdk\17.0.7-7\x64</jdkHome>
    </configuration>
  </toolchain>
  <toolchain>
    <type>jdk</type>
    <provides>
      <version>17</version>
      <vendor>temurin</vendor>
      <id>temurin_17</id>
    </provides>
    <configuration>
      <jdkHome>C:\actions-runner\_work\_tool\Java_Temurin-Hotspot_jdk\17.0.7-7\x64</jdkHome>
    </configuration>
  </toolchain>
</toolchains>

Thanks @cyrillzadra for mentioning this issue.

Task version:
v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Run actions several times in a row and check the toolchains.xml file.

Expected behavior:
The toolchains.xml should have only none identical toolchains records.

Actual behavior:
The toolchains.xml has several (in relation to number of action runs) identical toolchains records.

@IvanZosimov IvanZosimov added the bug Something isn't working label Aug 23, 2023
Okeanos added a commit to Okeanos/setup-java that referenced this issue Sep 19, 2023
On self-hosted runners toolchains.xml may survive multiple runs and unexpectedly
grow as a result of the toolchains setup simply appending the JDK definition
even if one with the same `type` and `provides.id` already exists.

Restructuring the parsing step and filtering the potentially existing list of
toolchain definitions prevents this and also fixes toolchain.xml files that
already contain duplicates.

Fixes actions#530
@Okeanos Okeanos linked a pull request Sep 19, 2023 that will close this issue
2 tasks
@IvanZosimov IvanZosimov linked a pull request Sep 20, 2023 that will close this issue
2 tasks
@dsame dsame self-assigned this Nov 23, 2023
Okeanos added a commit to Okeanos/setup-java that referenced this issue Nov 29, 2023
On self-hosted runners toolchains.xml may survive multiple runs and unexpectedly
grow as a result of the toolchains setup simply appending the JDK definition
even if one with the same `type` and `provides.id` already exists.

Restructuring the parsing step and filtering the potentially existing list of
toolchain definitions prevents this and also fixes toolchain.xml files that
already contain duplicates.

Fixes actions#530
Okeanos added a commit to Okeanos/setup-java that referenced this issue Dec 9, 2023
On self-hosted runners toolchains.xml may survive multiple runs and unexpectedly
grow as a result of the toolchains setup simply appending the JDK definition
even if one with the same `type` and `provides.id` already exists.

Restructuring the parsing step and filtering the potentially existing list of
toolchain definitions prevents this and also fixes toolchain.xml files that
already contain duplicates.

Fixes actions#530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants