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

GRPC example on Fedora 39 doesn't compile #42931

Open
tmulle opened this issue Aug 31, 2024 · 13 comments · Fixed by #42993
Open

GRPC example on Fedora 39 doesn't compile #42931

tmulle opened this issue Aug 31, 2024 · 13 comments · Fixed by #42993
Labels
area/gradle Gradle area/grpc gRPC kind/bug Something isn't working

Comments

@tmulle
Copy link
Contributor

tmulle commented Aug 31, 2024

Describe the bug

When creating a new app using the quarkus start webpage which just contains GRPC extension and trying to compile it on Fedora 39 fails:

Failed to bootstrap application in NORMAL mode: Failed to resolve artifact io.grpc:protoc-gen-grpc-java:exe:linux-s390_64:1.65.1: The following artifacts could not be resolved: io.grpc:protoc-gen-grpc-java:exe:linux-s390_64:1.65.1 (absent)

We have a corporate Nexus server which is mirroring Maven Central and it should be pulling automatically, but that's another issue. The real issue is why is GRPC trying to pull unecessary dependencies?

Why is GRPC trying to pull IBM s390 on a Linux Fedora 39 system?

This is the POM.xml that was generated by the quarkus webpage:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.acme</groupId>
    <artifactId>code-with-quarkus</artifactId>
    <version>1.0.0-SNAPSHOT</version>

    <properties>
        <compiler-plugin.version>3.13.0</compiler-plugin.version>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
        <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
        <quarkus.platform.version>3.13.3</quarkus.platform.version>
        <skipITs>true</skipITs>
        <surefire-plugin.version>3.2.5</surefire-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-grpc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.platform.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                            <goal>native-image-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
                <configuration>
                    <parameters>true</parameters>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <systemPropertyVariables>
                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <properties>
                <skipITs>false</skipITs>
                <quarkus.native.enabled>true</quarkus.native.enabled>
            </properties>
        </profile>
    </profiles>
</project>

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

Linux 6.10.6-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Aug 19 14:35:32 UTC 2024 x86_64 GNU/Linux

Output of java -version

JDK 21 and JDK17

Quarkus version or git rev

3.14.1

Build tool (ie. output of mvnw --version or gradlew --version)

Maven

Additional information

No response

@tmulle tmulle added the kind/bug Something isn't working label Aug 31, 2024
@quarkus-bot quarkus-bot bot added the area/grpc gRPC label Aug 31, 2024
Copy link

quarkus-bot bot commented Aug 31, 2024

/cc @alesj (grpc), @cescoffier (grpc)

@cescoffier
Copy link
Member

Do you get this only on Fedora 39?

We pull all os/architectures in our dependencies. We know that it's sub-optimal, but we have to do it to make sure we can build the proto files.

@tmulle
Copy link
Contributor Author

tmulle commented Sep 1, 2024

Yes, it works fine on MacOS.

Interestingly enough, ALL dependencies get pulled no matter what the OS.

This is on my repo on MacOS which ironically gets pulled through our corporate Nexus mirror.
But I don’t see the dependencies actually stored on our Nexus, but somehow it works for MacOS but fails
on Fedora 39.

ls ~/.m2/repository/io/grpc/protoc-gen-grpc-java/1.65.1/
_remote.repositories                                       protoc-gen-grpc-java-1.65.1-linux-x86_64.exe.sha1
protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe             protoc-gen-grpc-java-1.65.1-osx-aarch_64.exe
protoc-gen-grpc-java-1.65.1-linux-aarch_64.exe.sha1        protoc-gen-grpc-java-1.65.1-osx-aarch_64.exe.sha1
protoc-gen-grpc-java-1.65.1-linux-ppcle_64.exe             protoc-gen-grpc-java-1.65.1-osx-x86_64.exe
protoc-gen-grpc-java-1.65.1-linux-ppcle_64.exe.sha1        protoc-gen-grpc-java-1.65.1-osx-x86_64.exe.sha1
protoc-gen-grpc-java-1.65.1-linux-s390_64.exe              protoc-gen-grpc-java-1.65.1-windows-x86_32.exe
protoc-gen-grpc-java-1.65.1-linux-s390_64.exe.lastUpdated  protoc-gen-grpc-java-1.65.1-windows-x86_32.exe.sha1
protoc-gen-grpc-java-1.65.1-linux-s390_64.exe.sha1         protoc-gen-grpc-java-1.65.1-windows-x86_64.exe
protoc-gen-grpc-java-1.65.1-linux-x86_32.exe               protoc-gen-grpc-java-1.65.1-windows-x86_64.exe.sha1
protoc-gen-grpc-java-1.65.1-linux-x86_32.exe.sha1          protoc-gen-grpc-java-1.65.1.pom
protoc-gen-grpc-java-1.65.1-linux-x86_64.exe               protoc-gen-grpc-java-1.65.1.pom.sha1

@cescoffier
Copy link
Member

I will try to get a fedora 39 to test it, but I don't have a specific nexus server.

Do you know if the issue occurs if we use a fedora 39 base docker image?

@gsmet
Copy link
Member

gsmet commented Sep 3, 2024

So the problem is this thing: https://github.com/quarkusio/quarkus/blob/main/extensions/grpc/codegen/pom.xml#L28-L135 .

I think we should try to reduce the dependencies by having profiles enabled with arch.

Using os family + arch profile, I think we should be able to reduce this significantly. I don't think we need to catch all the corner cases, we could at least greatly reduce the dependencies if matching os and arch.

@tmulle maybe that's something you could create a PR for?

@tmulle
Copy link
Contributor Author

tmulle commented Sep 3, 2024

@gsmet sure I can submit one. I’ll modify the pom.xml to have different profiles based on the os and arch.

@cescoffier
Copy link
Member

@gsmet why did you re-open it?

@cescoffier
Copy link
Member

Ok, seems to break tests...

@cescoffier
Copy link
Member

I had a memory flash this morning - this is precisely why it was not done like this 3/4 years ago. I remember Michal complaining about it :-)

@tmulle
Copy link
Contributor Author

tmulle commented Sep 5, 2024

That's a shame..I still get my first PR to Quarkus badge right? ;-)

So, since I'm new to the Quarkus build process why did this ultimately fail?

Did I not run the right test by using mvn -Dquickly? I guess github actions or your CI process runs deeper tests that this caught?

Why do we use Gradle and Maven together?

I did just read about Gradle and Maven profile activation and people seem to try to get around it by writing properties to files or changing the gradle builds to read the System env variables directly using if/then code branches.

Like I said in my commit/PR message I did try to read the os.detected.classifier directly in the two protoc dependencies but that didn't work because it couldn't find the variables..which is interesting because at the beginning of the builds all of those variables are printed out.

I thought you might be using this plugin which sets the variables and can be used in the builds:
https://github.com/trustin/os-maven-plugin

But I'm not sure if Gradle would be able to read them..

@tmulle
Copy link
Contributor Author

tmulle commented Sep 5, 2024

I just saw there is a Gradle version of the plugin I mentioned and it actually uses the same maven plugin under the hood.
https://github.com/google/osdetector-gradle-plugin

So, I wonder if reading the os.detected.classifer could ultimately work.

Then no more need for profiles.

@melloware
Copy link
Contributor

@tmulle try another PR using os.detected.classifier ?

@tmulle
Copy link
Contributor Author

tmulle commented Sep 18, 2024

I tried that before I commited the first PR but that didn't work.

The os.detected.classifier value was not being found during the build and I was getting an error as I stated above.

I wasn't sure if it was the gradle build failing or the maven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle area/grpc gRPC kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants