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

A transient dependency issue is affecting compilation of xtext projects #2077

Closed
denisoliveirac opened this issue Jun 14, 2022 · 9 comments
Closed

Comments

@denisoliveirac
Copy link

Hi.

My xtext project stopped compiling today. Apparently a transient dependency has been deleted or modified. See the error below:


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':myproject:generateXtext'.
> Could not resolve all files for configuration ':myproject:xtendToolingMain'.
   > Could not find any matches for org.osgi.service:org.osgi.service.prefs:[1.1.0,1.2.0) as no versions of org.osgi.service:org.osgi.service.prefs are available.
     Searched in the following locations:
       - file:/home/user/.m2/repository/org/osgi/service/org.osgi.service.prefs/
       - https://repo.maven.apache.org/maven2/org/osgi/service/org.osgi.service.prefs/maven-metadata.xml
     Required by:
         project :myproject > org.eclipse.xtend:org.eclipse.xtend.core:2.27.0 > org.eclipse.platform:org.eclipse.core.runtime:3.25.0 > org.eclipse.platform:org.eclipse.equinox.preferences:3.10.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 12s
2 actionable tasks: 2 executed
@SheppN
Copy link

SheppN commented Jun 14, 2022

I'm seeing the same thing. It's coming from org.eclipse.equinox.preferences:3.10.0 which has a dependency for org.osgi.service:org.osgi.service.prefs in its pom, but the group should be just org.osgi I think (based on org.osgi.service.prefs pom). I don't see org.eclipse.equinox.preferences:3.10.0 on mvnrepository so not quite sure where we're pulling that in from (well, it's jcenter via Artifactory, but I thought that was sunsetted).

If it helps you, or anyone who stumbles upon this, I was able to get around this for my build by setting a resolutionStrategy like below, though that should just be temporary until this is fixed:

configurations.all {
    resolutionStrategy.dependencySubstitution {
        substitute module('org.osgi.service:org.osgi.service.prefs') with module('org.osgi:org.osgi.service.prefs:1.1.2')
    }
}

That still brings in org.eclipse.equinox.preferences:3.10, so something like force org.eclipse.platform:org.eclipse.equinox.preferences:3.9.100 instead of the substitute might be better/achieve the same goal.

@denisoliveirac
Copy link
Author

denisoliveirac commented Jun 14, 2022

The workaround above solve the compilation problem but cause another problem in unit tests.
I use a excluded group exclude group: 'org.osgi.service' in configurations and the problem is the same.

I disable my unit tests and froze the changes in language project (xtext project) until the problem is solved.


    com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: java.lang.SecurityException: class "org.eclipse.core.runtime.OperationCanceledException"'s signer information does not match signer information of other classes in the same package
        at app//com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
        at app//com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)
        at app//com.google.inject.internal.util.$CustomConcurrentHashMap$ComputingImpl.get(CustomConcurrentHashMap.java:2041)
        at app//com.google.inject.internal.FailableCache.get(FailableCache.java:50)
        at app//com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:49)
        at app//com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:125)
        at app//com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:521)
        at app//com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:847)
        at app//com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:772)
        at app//com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:256)
        at app//com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205)
        at app//com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:853)
        at app//com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46)
        at app//com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50)
        at app//com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:133)
        at app//com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)
        at app//com.google.inject.Guice.createInjector(Guice.java:95)
        at app//com.google.inject.Guice.createInjector(Guice.java:72)
        at app//com.google.inject.Guice.createInjector(Guice.java:62)
        at app//org.eclipse.xtext.xbase.XtypeStandaloneSetupGenerated.createInjector(XtypeStandaloneSetupGenerated.java:45)
        at app//org.eclipse.xtext.xbase.XtypeStandaloneSetupGenerated.createInjectorAndDoEMFRegistration(XtypeStandaloneSetupGenerated.java:39)
        at app//org.eclipse.xtext.xbase.XtypeStandaloneSetup.createInjectorAndDoEMFRegistration(XtypeStandaloneSetup.java:31)
        at app//org.eclipse.xtext.xbase.XtypeStandaloneSetup.doSetup(XtypeStandaloneSetup.java:24)
        at app//org.eclipse.xtext.xbase.XbaseStandaloneSetupGenerated.createInjectorAndDoEMFRegistration(XbaseStandaloneSetupGenerated.java:23)
        at app//org.eclipse.xtext.xbase.XbaseStandaloneSetup.createInjectorAndDoEMFRegistration(XbaseStandaloneSetup.java:28)
        at app//org.eclipse.xtext.xbase.XbaseStandaloneSetup.doSetup(XbaseStandaloneSetup.java:22)
        ...

@cdietrich
Copy link
Contributor

cdietrich commented Jun 15, 2022

can you please provide a reproducer
i have the feeling you dont make use of the dev-bom

@cdietrich
Copy link
Contributor

cdietrich commented Jun 15, 2022

to me this also looks like a bug in eclipse platform and their scripts that create the maven deps
org.osgi.service:org.osgi.service.prefs
should be org.osgi:org.osgi.service.prefs

created eclipse-platform/eclipse.platform.releng#47

@cdietrich
Copy link
Contributor

cdietrich commented Jun 15, 2022

my gradle builds work,
but tycho ones fail:

 Error:  Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java (mwe2Launcher) on project org.xtext.example.mydsl: Execution mwe2Launcher of goal org.codehaus.mojo:exec-maven-plugin:3.0.0:java failed: Plugin org.codehaus.mojo:exec-maven-plugin:3.0.0 or one of its dependencies could not be resolved: 
Failed to collect dependencies at org.codehaus.mojo:exec-maven-plugin:jar:3.0.0 -> org.eclipse.xtext:org.eclipse.xtext.xtext.generator:jar:2.28.0-SNAPSHOT -> 
org.eclipse.emf:org.eclipse.emf.codegen:jar:2.19.0 -> 
org.eclipse.platform:org.eclipse.core.runtime:jar:3.12.0 -> 
org.eclipse.platform:org.eclipse.equinox.preferences:jar:3.10.0 -> 
org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0): No versions available for org.osgi.service:org.osgi.service.prefs:jar:[1.1.0,1.2.0) within specified range -> [Help 1]

also https://ci.eclipse.org/xtext/job/releng/job/sign-and-deploy/1580/console
fails

cdietrich added a commit to xtext/xtext-reference-projects that referenced this issue Jun 15, 2022
cdietrich added a commit to xtext/publishing that referenced this issue Jun 15, 2022
cdietrich added a commit to eclipse/xtext-core that referenced this issue Jun 15, 2022
cdietrich added a commit to xtext/publishing that referenced this issue Jun 15, 2022
[eclipse-xtext/xtext#2077] workaround for broken metadata in eclipse platform
cdietrich added a commit to eclipse/xtext-core that referenced this issue Jun 15, 2022
wborn added a commit to wborn/openhab-core that referenced this issue Jun 15, 2022
Someone added a dependency on a non-existing artifact in the new Equinox release and now many builds are broken because Xtext defines a version range for Equinox 😞, see:

* eclipse-equinox/equinox.bundles#54
* eclipse-xtext/xtext#2077

Signed-off-by: Wouter Born <[email protected]>
J-N-K pushed a commit to openhab/openhab-core that referenced this issue Jun 15, 2022
Someone added a dependency on a non-existing artifact in the new Equinox release and now many builds are broken because Xtext defines a version range for Equinox 😞, see:

* eclipse-equinox/equinox.bundles#54
* eclipse-xtext/xtext#2077

Signed-off-by: Wouter Born <[email protected]>
@denisoliveirac
Copy link
Author

Apparently the problem has been resolved and I removed exclude directive from my build.gradle.
My tests keep failing with the message:

com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: java.lang.SecurityException: class "org.eclipse.core.runtime.OperationCanceledException"'s signer information does not match signer information of other classes in the same package
        at app//com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:553)
        at app//com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:419)

When investigating the issue, I noticed that there is an override of the equinox version in the build.gradle of my tests.

dependencies {
    implementation project(':mylanguage')
    testImplementation "junit:junit:4.12"
    testImplementation "org.eclipse.xtext:org.eclipse.xtext.testing:${xtextVersion}"
    testImplementation "org.eclipse.xtext:org.eclipse.xtext.xbase.testing:${xtextVersion}"
    testImplementation "org.eclipse.platform:org.eclipse.equinox.common:${xtextVersion}"
}
def versionOverrides = [
    "org.eclipse.platform:org.eclipse.equinox.common": "3.10.0"
]

configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->

            def overrideVersion = versionOverrides[details.requested.group + ":" + details.requested.name]

            if (overrideVersion != null && details.requested.version != overrideVersion) {
                logger.info "Overriding dependency ${details.requested.group}:${details.requested.name} version ${details.requested.version} --> $overrideVersion"
                details.useVersion overrideVersion
            }
        }
 }

I removed the equinox override version and the tests passed without error.

cdietrich added a commit to xtext/publishing that referenced this issue Jun 17, 2022
@cdietrich
Copy link
Contributor

eclipse platform has pulled the bad artifact(s) from maven central. so (at least after the clearing of local maven repos or mirrors) the problem should be solved

@stefan-ka
Copy link

Hi @cdietrich
We run in the same problem these days... Do you know which artifacts have to be cleared from mirrors/caches? Which are those "bad" artifacts?
Thanks and best regards,
Stefan

@cdietrich
Copy link
Contributor

cdietrich commented Jul 15, 2022

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this issue Jul 12, 2023
Someone added a dependency on a non-existing artifact in the new Equinox release and now many builds are broken because Xtext defines a version range for Equinox 😞, see:

* eclipse-equinox/equinox.bundles#54
* eclipse-xtext/xtext#2077

Signed-off-by: Wouter Born <[email protected]>
GitOrigin-RevId: af0566a
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

4 participants