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

Propose to remove set-platform-properties #137

Open
llxia opened this issue May 17, 2024 · 0 comments
Open

Propose to remove set-platform-properties #137

llxia opened this issue May 17, 2024 · 0 comments

Comments

@llxia
Copy link
Contributor

llxia commented May 17, 2024

System tests are running through TKG. Using set-platform-properties in system tests to set all properties (i.e., platform, osname, arc, bits, etc) again is unnecessary and often requires additional maintenance (For example: eclipse-openj9/openj9#18110)

<macrodef name="set-platform-properties" description="Sets various properties for the java at the provided java_home location">
<attribute name="platform.property" description="The property to put the platform name in - e.g. win_x86-64"/>
<attribute name="platformclass.property" description="The property to put the platform class in - e.g. win_x86, linux_ppcle"/>
<attribute name="java.bindir.property" description="The property to put the java bin directory in"/>
<attribute name="java.compiler.property" description="The property to put the java compiler executable in"/>
<attribute name="osname.property" description="The property to put the osname in e.g. win, linux"/>
<attribute name="arch.property" description="The property to put the architecture in - e.g. x86, ppcle, 390"/>
<attribute name="bits.property" description="The property to put the bits in - e.g. 31, 32, 64"/>
<attribute name="java.specification.version.property" description="The property to put the java version in - e.g. 1.8, 9"/>
<attribute name="java.vm.vendor.property" description="The JVM version - e.g. Eclipse OpenJ9"/>
<attribute name="java.home" description="The JAVA_HOME directory of the java to query"/>
<attribute name="java.id" description="A unique identifier to prefix the properties for the java instance with"/>
<sequential>
<available file="@{java.home}/bin/javac${exe_suffix}" property="@{java.bindir.property}" value="@{java.home}/bin"/>
<available file="@{java.home}/../bin/javac${exe_suffix}" property="@{java.bindir.property}" value="@{java.home}/../bin"/>
<property name="@{java.compiler.property}" location="${@{java.bindir.property}}/javac${exe_suffix}"/>
<tempfile property="properties_file" destDir="${java.io.tmpdir}" prefix="openjdk.java.build.properties."/>
<!-- Run java -XshowSettings:properties -version to determine java platform" -->
<exec executable="${@{java.bindir.property}}/java" output="${properties_file}">
<arg value="-XshowSettings:properties"/>
<arg value="-version"/>
</exec>
<loadproperties srcFile="${properties_file}" prefix="@{java.id}." prefixValues="false">
<filterchain>
<replacestring from="\" to="\\" />
</filterchain>
</loadproperties>
<!-- comment to stop echo the -XshowSettings:properties output to the log. -->
<echoproperties>
<propertyset>
<propertyref prefix="@{java.id}."/>
</propertyset>
</echoproperties>
<delete file="${properties_file}" verbose="false"/>
<get-platform-prefix property="@{osname.property}" osname="${@{java.id}.os.name}"/>
<get-platform-arch property="@{arch.property}" arch="${@{java.id}.os.arch}"/>
<get-platform-bits property="@{bits.property}" bits="${@{java.id}.sun.arch.data.model}"/>
<property name="@{platform.property}" value="${@{osname.property}}_${@{arch.property}}-${@{bits.property}}"/>
<property name="@{platformclass.property}" value="${@{osname.property}}_${@{arch.property}}"/>
<property name="@{java.specification.version.property}" value="${@{java.id}.java.specification.version}"/>
<property name="@{java.vm.vendor.property}" value="${@{java.id}.java.vm.vendor}"/>
</sequential>
</macrodef>

I would like to propose to remove it. Unfortunately, this will not be a simple deletion. We will need to ensure all properties are set properly.

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

No branches or pull requests

1 participant