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

Using org.gwtproject.http:gwt-http:1.0.0-RC3 fails finding elemental2 sources #126

Closed
xamde opened this issue Mar 1, 2022 · 2 comments · Fixed by #130
Closed

Using org.gwtproject.http:gwt-http:1.0.0-RC3 fails finding elemental2 sources #126

xamde opened this issue Mar 1, 2022 · 2 comments · Fixed by #130
Labels
bug Something isn't working gradle maven
Milestone

Comments

@xamde
Copy link
Contributor

xamde commented Mar 1, 2022

How to reproduce:

Swap

        <dependency>
            <groupId>org.gwtproject.http</groupId>
            <artifactId>gwt-http</artifactId>
            <version>1.0.0-RC3</version>

with

            <groupId>org.gwtproject.http</groupId>
            <artifactId>gwt-http</artifactId>
            <version>HEAD-SNAPSHOT</version>

from github.com/treblereel

and the issue goes away. Or patch AbstractBuildMojo to map Artifact.SCOPE_RUNTIME to Dependency.Scope.BOTH (instead of RUNTIME) and the issue goes also away

@niloc132
Copy link
Member

niloc132 commented Mar 1, 2022

Thanks for the report and for helping debug this in gitter.

The root cause is that when gradle produces a pom for publishing to maven, it's own api vs implementation distinction is expressed in the maven pom, even though maven doesn't know how to consume it. For traditional Java projects, where the already-compiled bytecode is also present in the repo server this is sufficient, and will help downstream gradle/maven builds to keep their compile classpaths slightly smaller. However, this is harmful for J2CL projects, as unlike jvm bytecode, j2cl output does not have a version imprinted in it, and makes no promises about forward/backward compatibility - an entire application must ensure that it uses this same version of J2CL to build all of its dependencies. Without published transpiled output, the published pom must be assumed to be reliable to not only depend on an artifact, but build against it.

As gwt-http has opted to not produce an accurate pom, the maven side of this project must interpret all scope=runtime dependencies as potentially being deliberately incorrect in this way - we can't predict what other projects might also make this same over-optimistic assumption.

niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Mar 1, 2022
Gradle's "implementation" configuration for dependencies results in
published maven poms that are technically accurate for building
bytecode, but useless for building J2CL. To fix this, we interpret any
scope=runtime as if it says scope=compile.

This patch also tests many publicly released gwt modules to ensure that
they build cleanly in the plugin, with the hope of avoiding this issue
in the future. There are several commented out dependencies, to avoid
trying to build gwt-dom until the next release is ready. Bug Vertispan#127 is
filed for followup.

Fixes Vertispan#126
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Mar 1, 2022
Gradle's "implementation" configuration for dependencies results in
published maven poms that are technically accurate for building
bytecode, but useless for building J2CL. To fix this, we interpret any
scope=runtime as if it says scope=compile.

This patch also tests many publicly released gwt modules to ensure that
they build cleanly in the plugin, with the hope of avoiding this issue
in the future. There are several commented out dependencies, to avoid
trying to build gwt-dom until the next release is ready. Bug Vertispan#127 is
filed for followup.

Fixes Vertispan#126
@xamde
Copy link
Contributor Author

xamde commented Mar 2, 2022

Very nice write-up.

@niloc132 niloc132 added the bug Something isn't working label Mar 3, 2022
@niloc132 niloc132 added this to the 0.19 milestone Mar 3, 2022
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Mar 3, 2022
Gradle's "implementation" configuration for dependencies results in
published maven poms that are technically accurate for building
bytecode, but useless for building J2CL. To fix this, we interpret any
scope=runtime as if it says scope=compile.

A separate commit will include a test case to verify that the published
gwt modules in maven central work properly.

Fixes Vertispan#126
niloc132 added a commit that referenced this issue Mar 3, 2022
Gradle's "implementation" configuration for dependencies results in
published maven poms that are technically accurate for building
bytecode, but useless for building J2CL. To fix this, we interpret any
scope=runtime as if it says scope=compile.

A separate commit will include a test case to verify that the published
gwt modules in maven central work properly.

Fixes #126
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Mar 3, 2022
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Mar 3, 2022
xamde pushed a commit to Calpano/j2clmavenplugin that referenced this issue Mar 9, 2022
…pan#130)

Gradle's "implementation" configuration for dependencies results in
published maven poms that are technically accurate for building
bytecode, but useless for building J2CL. To fix this, we interpret any
scope=runtime as if it says scope=compile.

A separate commit will include a test case to verify that the published
gwt modules in maven central work properly.

Fixes Vertispan#126
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Mar 20, 2022
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Mar 20, 2022
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Apr 16, 2022
treblereel pushed a commit to treblereel/j2clmavenplugin that referenced this issue Jun 3, 2022
…pan#130)

Gradle's "implementation" configuration for dependencies results in
published maven poms that are technically accurate for building
bytecode, but useless for building J2CL. To fix this, we interpret any
scope=runtime as if it says scope=compile.

A separate commit will include a test case to verify that the published
gwt modules in maven central work properly.

Fixes Vertispan#126
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Jul 14, 2022
Gradle's "implementation" configuration for dependencies results in
published maven poms that are technically accurate for building
bytecode, but useless for building J2CL. To fix this, we interpret any
scope=runtime as if it says scope=compile.

This patch also tests many publicly released gwt modules to ensure that
they build cleanly in the plugin, with the hope of avoiding this issue
in the future. There are several commented out dependencies, to avoid
trying to build gwt-dom until the next release is ready. Bug Vertispan#127 is
filed for followup.

Fixes Vertispan#126
niloc132 added a commit to niloc132/j2clmavenplugin that referenced this issue Nov 8, 2022
Gradle's "implementation" configuration for dependencies results in
published maven poms that are technically accurate for building
bytecode, but useless for building J2CL. To fix this, we interpret any
scope=runtime as if it says scope=compile.

This patch also tests many publicly released gwt modules to ensure that
they build cleanly in the plugin, with the hope of avoiding this issue
in the future. There are several commented out dependencies, to avoid
trying to build gwt-dom until the next release is ready. Bug Vertispan#127 is
filed for followup.

Fixes Vertispan#126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gradle maven
Projects
None yet
2 participants