Skip to content

Conversation

@amaslenn
Copy link
Contributor

What

Specify openjdk-devel package as a build dependency.

Why ?

For some reason, Fedora doesn't pull openjdk-devel as a dependency for Maven, have to set it manually.

For some reason Fedora doesn't pull openjdk-devel as a dependency for
Maven, have to set it manually.
@amaslenn
Copy link
Contributor Author

@yosefe would be nice to have it for v1.8.1 release along with #5070.

@yosefe
Copy link
Contributor

yosefe commented May 4, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yosefe
Copy link
Contributor

yosefe commented May 4, 2020

https://dev.azure.com/ucfconsort/ucx/_build/results?buildId=5869&view=logs&jobId=1b6e0548-13f3-5bbf-46b7-02377d74d406&j=1b6e0548-13f3-5bbf-46b7-02377d74d406&t=a3dbc0da-a4bc-5096-251c-c5e42b51def6

2020-05-04T08:37:23.0954673Z + rpmbuild -bs '--define=_rpmdir /__w/1/s/rpm-dist' '--define=_srcrpmdir /__w/1/s/rpm-dist' '--define=_sourcedir /__w/1/s' '--define=_specdir /__w/1/s' '--define=_builddir /__w/1/s' --buildroot=/__w/1/s/_rpm ucx.spec
2020-05-04T08:37:23.2180138Z Wrote: /__w/1/s/rpm-dist/ucx-1.9.0-1.fc30.src.rpm
2020-05-04T08:37:23.2844667Z + rpmbuild -bb '--define=_rpmdir /__w/1/s/rpm-dist' '--define=_srcrpmdir /__w/1/s/rpm-dist' '--define=_sourcedir /__w/1/s' '--define=_specdir /__w/1/s' '--define=_builddir /__w/1/s' --buildroot=/__w/1/s/_rpm ucx.spec --with cma --without cuda --without gdrcopy --with ib --without ib_cm --without knem --with rdmacm --without rocm --without ugni --without xpmem --with java
2020-05-04T08:37:23.3033504Z error: Failed build dependencies:
2020-05-04T08:37:23.3035036Z 	java-latest-openjdk-devel >= 8 is needed by ucx-1.9.0-1.fc30.x86_64
2020-05-04T08:37:23.3100668Z 
2020-05-04T08:37:23.3181336Z ##[error]Bash exited with code '1'.
2020-05-04T08:37:23.3396988Z ##[section]Finishing: Build tarball

@petro-rudenko
Copy link
Member

petro-rudenko commented May 4, 2020

I think it's irrelevant now as of merging #5095
Maven already takes java-latest-openjdk-devel.
java-latest-openjdk-devel has no version since it's latest. Or to remove >= 8 from this PR

@yosefe
Copy link
Contributor

yosefe commented May 4, 2020

@amaslenn shall we close this?

@amaslenn
Copy link
Contributor Author

amaslenn commented May 5, 2020

This is still relevant.

Here is how to install openjdk-devel in Fedora:

# dnf search '*openjdk*' | grep devel
Last metadata expiration check: 0:00:58 ago on Mon May  4 15:39:46 2020.
java-openjdk-devel.i686 : Renamed to java-latest-openjdk-devel                                                                              java-openjdk-devel.x86_64 : Renamed to java-latest-openjdk-devel

I need to update UCX fedora Docker image to have this package installed and the checks for this PR will pass.

@yosefe would you prefer a separate PR for Fedora Docker update or do it here?

@amaslenn
Copy link
Contributor Author

amaslenn commented May 5, 2020

I think it's irrelevant now as of merging #5095
Maven already takes java-latest-openjdk-devel.
java-latest-openjdk-devel has no version since it's latest. Or to remove >= 8 from this PR

openjdk-devel is not installed as a Maven dependency in Fedora environment, so we have to explicitly specify it.

@yosefe
Copy link
Contributor

yosefe commented May 5, 2020

@yosefe would you prefer a separate PR for Fedora Docker update or do it here?

In this PR

@amaslenn amaslenn force-pushed the topic/rpm-spec-jdk branch from 8033c81 to d74e1f1 Compare May 6, 2020 06:46
@amaslenn
Copy link
Contributor Author

amaslenn commented May 6, 2020

@petro-rudenko could you please take a look?

List of installed Java packages:

$ docker run ucfconsort.azurecr.io/ucx/fedora:2 rpm -qa | grep java
java-1.8.0-openjdk-headless-1.8.0.242.b08-0.fc30.x86_64
tzdata-java-2019c-2.fc30.noarch
javapackages-tools-5.3.0-4.fc30.noarch
java-latest-openjdk-14.0.0.36-3.rolling.fc30.x86_64
java-latest-openjdk-devel-14.0.0.36-3.rolling.fc30.x86_64
java-latest-openjdk-headless-14.0.0.36-3.rolling.fc30.x86_64
javapackages-filesystem-5.3.0-4.fc30.noarch

Error:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project jucx: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
make[5]: *** [Makefile:992: native_headers.stamp] Error 1

@petro-rudenko
Copy link
Member

Clean fedora:30 image:

 dnf install maven
======================================================================================================================================
 Package                                      Arch        Version                                          Repository            Size
======================================================================================================================================
Installing:
 maven                                        noarch      1:3.5.4-5.module_f30+8611+513ae82a               updates-modular       11 k
Installing dependencies:
...
 java-1.8.0-openjdk                           x86_64      1:1.8.0.252.b09-0.fc30                           updates              255 k
 java-1.8.0-openjdk-headless                  x86_64      1:1.8.0.252.b09-0.fc30                           updates               33 M
...
Installing weak dependencies:
 gtk2                                         x86_64      2.24.32-6.fc30                                   updates              3.5 M
 java-1.8.0-openjdk-devel                     x86_64      1:1.8.0.252.b09-0.fc30                           updates              9.7 M

Then you remove only java-1.8.0-openjdk-devel. And installs java-latest-openjdk-devel. Maven still finds java8. Any case it won't compile with java14 yet, even when it'll find correct java14 compiler, will fix this soon.

@petro-rudenko
Copy link
Member

petro-rudenko commented May 18, 2020

So basically it won't compile on JDK-14 for java8 bytecode (because we use internal API to get byte buffer address):
https://stackoverflow.com/a/55605311/3271168

Solution is the following:

  1. Compile on java8 (lowest supported compiler, as we do). No need this PR then
  2. Compile on java14 for and produce code for java11+ (not good, since a lot of users still uses java8 runtime.

@amaslenn
Copy link
Contributor Author

@petro-rudenko that means we should specify java-1.8.0-openjdk-devel as a dependency, right? Otherwise, it won't be installed on modern systems.

@petro-rudenko
Copy link
Member

@amaslenn maven brings it on fedora30 container

@petro-rudenko
Copy link
Member

We compiled with java9. Seems only java14 doesn't allow to use internal API, in favor of : https://www.baeldung.com/java-foreign-memory-access

@amaslenn
Copy link
Contributor Author

@amaslenn maven brings it on fedora30 container

it is not on fedora@rawhide (faced it when tried to release v1.8.0)

@petro-rudenko
Copy link
Member

Then let's install java-1.8.0-openjdk-devel except of java-latest-openjdk-devel

@amaslenn
Copy link
Contributor Author

@yosefe f30 got gcc/cppcheck updated, v9.1.1 --> v9.3.1 and 1.88 --> 1.90 accordingly. They found new issues in code, could you please take a look?

@yosefe yosefe merged commit c875d29 into openucx:master May 21, 2020
@amaslenn amaslenn deleted the topic/rpm-spec-jdk branch May 21, 2020 12:10
@amaslenn
Copy link
Contributor Author

@petro-rudenko I'm getting the following issue when building UCX in Fedora/Koji env:

mvn -B -T 1C -f /builddir/build/BUILD/ucx-1.9.0/bindings/java/pom.xml -Dmaven.repo.local=./build-java/.deps -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn compile
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Unresolveable build extension: Plugin org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.sonatype.plugins:nexus-staging-maven-plugin:jar:1.6.8 @ 
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project org.openucx:jucx:1.9.0 (/builddir/build/BUILD/ucx-1.9.0/bindings/java/pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin org.sonatype.plugins:nexus-staging-maven-plugin:1.6.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.sonatype.plugins:nexus-staging-maven-plugin:jar:1.6.8: Could not transfer artifact org.sonatype.plugins:nexus-staging-maven-plugin:pom:1.6.8 from/to gcs-maven-central-mirror (https://maven-central.storage-download.googleapis.com/maven2/): transfer failed for https://maven-central.storage-download.googleapis.com/maven2/org/sonatype/plugins/nexus-staging-maven-plugin/1.6.8/nexus-staging-maven-plugin-1.6.8.pom: Unknown host maven-central.storage-download.googleapis.com: Name or service not known -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginManagerException
make[3]: *** [Makefile:992: native_headers.stamp] Error 1
make[3]: Leaving directory '/builddir/build/BUILD/ucx-1.9.0/bindings/java/src/main/native'
make[2]: *** [Makefile:506: all-recursive] Error 1
make[2]: Leaving directory '/builddir/build/BUILD/ucx-1.9.0/bindings/java'
make[1]: *** [Makefile:730: all-recursive] Error 1
make[1]: Leaving directory '/builddir/build/BUILD/ucx-1.9.0'

Full log: https://kojipkgs.fedoraproject.org//work/tasks/7768/44767768/build.log

@petro-rudenko
Copy link
Member

Is there internet connection in this container?

@amaslenn
Copy link
Contributor Author

Is there internet connection in this container?

Not sure, but it somehow pulls the sources and other packages.

@amaslenn
Copy link
Contributor Author

@petro-rudenko ping

@amaslenn
Copy link
Contributor Author

@yosefe turned out our current approach for packaging JUCX is invalid: java package should be a separate rpm. Also, we have to use Fedora's rpm macroses for Maven and this will require splitting UCX and JUCX builds.

According to @petro-rudenko JUCX users don't need rpms, they use Maven. I suggest removing the current JUCX packaging instructions and configure UCX with --without-java SPEC file.

If you think we need to package it anyway, let's discuss the priority: implementation will take time, it is hard to estimate right now. And it blocks v1.8.* release for Fedora.

@yosefe
Copy link
Contributor

yosefe commented May 31, 2020

According to @petro-rudenko JUCX users don't need rpms, they use Maven. I suggest removing the current JUCX packaging instructions and configure UCX with --without-java SPEC file.

+1 - let's build UCX RPM without java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants