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

Revisit classifierWithLikes #4

Open
zhangkun83 opened this issue Sep 17, 2015 · 4 comments
Open

Revisit classifierWithLikes #4

zhangkun83 opened this issue Sep 17, 2015 · 4 comments

Comments

@zhangkun83
Copy link
Collaborator

Setting classifierWithLikes changes the content of the classifier. Because there is only one classifier instance in on JVM, if different components want different classifierWithLikes settings, they will run into each other. A real world example is in gRPC Java build, both tcnative artifact and protobuf-gradle-plugin are using classifier, while tcnative sets classifierWithLikes and protobuf-gradle-plugin doesn't.

We should either allow multiple classifiers in a JVM (by making it non-static), or remove the classifierWithLikes feature.

@ejona86

@vans88
Copy link

vans88 commented Oct 19, 2016

@zhangkun83
@ejona86
I have built osdetector-gradle-plugin successfully. But when I run "./gradlew test" in top dir of this plugin and got the following error. Any suggestions on "setClassifierWithLikes FAILED".

part of the error information:

com.google.gradle.osdetector.OsDetectorPluginTest > **_### setClassifierWithLikes_** FAILED
    kr.motd.maven.os.DetectionException: unknown os.arch: mips64el
        at kr.motd.maven.os.Detector.detect(Detector.java:73)
        at com.google.gradle.osdetector.OsDetector$Impl.<init>(OsDetector.java:117)
        at com.google.gradle.osdetector.OsDetector.getImpl(OsDetector.java:64)
        at com.google.gradle.osdetector.OsDetector.getOs(OsDetector.java:34)
        at com.google.gradle.osdetector.OsDetector_Decorated.getOs(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:60)
        at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:153)
        at org.gradle.api.internal.BeanDynamicObject.getProperty(BeanDynamicObject.java:107)
        at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:78)
        at com.google.gradle.osdetector.OsDetector_Decorated.getProperty(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
        at com.google.gradle.osdetector.OsDetectorPluginTest.setClassifierWithLikes(OsDetectorPluginTest.groovy:53)

2 tests completed, 2 failed
Finished generating test XML results (0.278 secs) into: /usr/local/TenFlow/osdetector-gradle-plugin/build/test-results
Generating HTML test report...
Finished generating test html results (0.384 secs) into: /usr/local/TenFlow/osdetector-gradle-plugin/build/reports/tests
:test FAILED
:test (Thread[main,5,main]) completed. Took 26.676 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///usr/local/TenFlow/osdetector-gradle-plugin/build/reports/tests/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 20.901 secs
Stopped 0 compiler daemon(s).

Related links

The follow links are also about this errors:
#7
#8

@xzy256
Copy link

xzy256 commented May 18, 2017

@zhangkun83

We should either allow multiple classifiers in a JVM (by making it non-static), or remove the classifierWithLikes feature.

how to do? could you give more details for setting multiple classifiers in a JVM or removing the classifierWithLikes feature

@google google deleted a comment Apr 21, 2022
@google google deleted a comment Apr 21, 2022
@Vampire
Copy link

Vampire commented Jan 23, 2024

The readme says since 9 years that this will be changed or removed "in the next version".
Maybe this should either be done, or at least the "next version" promise removed from the readme.

@tisonkun
Copy link

tisonkun commented Feb 6, 2024

FWIW, I try to pick up this plugin and this crate according this background - trustin/os-maven-plugin#70 (comment)

And now I create tisonkun/os-detector#7 and tisonkun/os-detector#6 to move the os detector lib forward, esp. the FFM JEP is ready to release and I can see a future that we need to handle different platform switchers in the Java code and build logic.

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

5 participants