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

"javafx-controls-17-ea+9-${javafx.platform}.jar" is not found #6564

Open
Christewart opened this issue Jun 24, 2021 · 17 comments
Open

"javafx-controls-17-ea+9-${javafx.platform}.jar" is not found #6564

Christewart opened this issue Jun 24, 2021 · 17 comments
Labels

Comments

@Christewart
Copy link

Christewart commented Jun 24, 2021

steps

Here are two different versions you can try to pull down and clone. This branch has the bug, note the version bump to 17-ea+9

https://github.com/Christewart/bitcoin-s-core/tree/2021-06-23-javafx-classifer-bug

problem

sbt does not seem to resolve classifiers correctly on 1.5.4, and here is the proof that it doesn't work on CI:
https://github.com/bitcoin-s/bitcoin-s/runs/2609905220#step:5:508

[error] lmcoursier.internal.shaded.coursier.error.FetchError$DownloadingArtifacts: Error fetching artifacts:
[error] https://repo1.maven.org/maven2/org/openjfx/javafx-controls/17-ea+9/javafx-controls-17-ea+9-${javafx.platform}.jar: not found: https://repo1.maven.org/maven2/org/openjfx/javafx-controls/17-ea+9/javafx-controls-17-ea+9-${javafx.platform}.jar
[error] https://repo1.maven.org/maven2/org/openjfx/javafx-web/17-ea+9/javafx-web-17-ea+9-${javafx.platform}.jar: not found: https://repo1.maven.org/maven2/org/openjfx/javafx-web/17-ea+9/javafx-web-17-ea+9-${javafx.platform}.jar
[error] https://repo1.maven.org/maven2/org/openjfx/javafx-swing/17-ea+9/javafx-swing-17-ea+9-${javafx.platform}.jar: not found: https://repo1.maven.org/maven2/org/openjfx/javafx-swing/17-ea+9/javafx-swing-17-ea+9-${javafx.platform}.jar
[error] https://repo1.maven.org/maven2/org/openjfx/javafx-base/17-ea+9/javafx-base-17-ea+9-${javafx.platform}.jar: not found: https://repo1.maven.org/maven2/org/openjfx/javafx-base/17-ea+9/javafx-base-17-ea+9-${javafx.platform}.jar
[error] https://repo1.maven.org/maven2/org/openjfx/javafx-graphics/17-ea+9/javafx-graphics-17-ea+9-${javafx.platform}.jar: not found: https://repo1.maven.org/maven2/org/openjfx/javafx-graphics/17-ea+9/javafx-graphics-17-ea+9-${javafx.platform}.jar
[error] https://repo1.maven.org/maven2/org/openjfx/javafx-media/17-ea+9/javafx-media-17-ea+9-${javafx.platform}.jar: not found: https://repo1.maven.org/maven2/org/openjfx/javafx-media/17-ea+9/javafx-media-17-ea+9-${javafx.platform}.jar
[error] https://repo1.maven.org/maven2/org/openjfx/javafx-fxml/17-ea+9/javafx-fxml-17-ea+9-${javafx.platform}.jar: not found: https://repo1.maven.org/maven2/org/openjfx/javafx-fxml/17-ea+9/javafx-fxml-17-ea+9-${javafx.platform}.jar
[error] 
[error] 	at lmcoursier.internal.shaded.coursier.Artifacts$.$anonfun$fetchArtifacts$9(Artifacts.scala:346)
[error] 	at lmcoursier.internal.shaded.coursier.util.Task$.$anonfun$flatMap$extension$1(Task.scala:14)
[error] 	at lmcoursier.internal.shaded.coursier.util.Task$.$anonfun$flatMap$extension$1$adapted(Task.scala:14)
[error] 	at lmcoursier.internal.shaded.coursier.util.Task$.wrap(Task.scala:84)
[error] 	at lmcoursier.internal.shaded.coursier.util.Task$.$anonfun$flatMap$2(Task.scala:14)
[error] 	at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
[error] 	at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
[error] 	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:834)
[error] Caused by: lmcoursier.internal.shaded.coursier.cache.ArtifactError$NotFound: not found: https://repo1.maven.org/maven2/org/openjfx/javafx-controls/17-ea+9/javafx-controls-17-ea+9-${javafx.platform}.jar
[error] 	at lmcoursier.internal.shaded.coursier.cache.internal.Downloader$Blocking$.doDownload(Downloader.scala:217)
[error] 	at lmcoursier.internal.shaded.coursier.cache.internal.Downloader$Blocking$.$anonfun$remote$2(Downloader.scala:380)
[error] 	at lmcoursier.internal.shaded.coursier.cache.internal.Downloader$.$anonfun$downloading$1(Downloader.scala:678)
[error] 	at lmcoursier.internal.shaded.coursier.cache.CacheLocks$.withUrlLock(CacheLocks.scala:116)
[error] 	at lmcoursier.internal.shaded.coursier.cache.internal.Downloader$.helper$2(Downloader.scala:678)
[error] 	at lmcoursier.internal.shaded.coursier.cache.internal.Downloader$.coursier$cache$internal$Downloader$$downloading(Downloader.scala:711)
[error] 	at lmcoursier.internal.shaded.coursier.cache.internal.Downloader$Blocking$.$anonfun$remote$1(Downloader.scala:380)
[error] 	at lmcoursier.internal.shaded.coursier.cache.CacheLocks$.loop$1(CacheLocks.scala:72)
[error] 	at lmcoursier.internal.shaded.coursier.cache.CacheLocks$.withLockOr(CacheLocks.scala:98)
[error] 	at lmcoursier.internal.shaded.coursier.cache.internal.Downloader$Blocking$.remote(Downloader.scala:382)
[error] 	at lmcoursier.internal.shaded.coursier.cache.internal.Downloader.$anonfun$remote$5(Downloader.scala:480)
[error] 	at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
[error] 	at scala.util.Success.$anonfun$map$1(Try.scala:255)
[error] 	at scala.util.Success.map(Try.scala:213)
[error] 	at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
[error] 	at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
[error] 	at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
[error] 	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:834)
[error] (gui / update) lmcoursier.internal.shaded.coursier.error.FetchError$DownloadingArtifacts: Error fetching artifacts:

expectations

it resolves.

note

master branch runs on 17-ea+8 which seems to work ok.

here are the links to the artifacts published on maven:

@eed3si9n eed3si9n changed the title Classifier setting seems to be broken when using javafx "javafx-controls-17-ea+9-${javafx.platform}.jar" is not found Jun 26, 2021
@robstoll
Copy link

robstoll commented Jul 5, 2021

Same problem here with sbt 1.5.3 and 17ea+14 - is there a workaround?

@Christewart
Copy link
Author

Not that I know of

@eed3si9n
Copy link
Member

eed3si9n commented Jul 5, 2021

There are Coursier fields called extraProperties and forceProperties. We should expose either of them to sbt via lm-coursier:
https://github.com/coursier/coursier/blob/d9a0fcc1af4876bec7f19a18f2c93d808e06df8d/modules/core/shared/src/main/scala/coursier/core/Resolution.scala#L677

A workaround probably would look like using cs CLI to grab the JARs you need and put them into lib/ directory where sbt would pick up as unmanaged dependency.

@eed3si9n eed3si9n added the area/library_management library management label Jul 5, 2021
@eed3si9n
Copy link
Member

eed3si9n commented Jul 5, 2021

To a potential contributor:
The relevant files would be similar to coursier/sbt-coursier#205

@robstoll
Copy link

robstoll commented Jul 6, 2021

@eed3si9n note that sbt does not have a problem with 17-ea+8, the problem only starts with 17-ea+9 and above (tested until 17-ea+14).
Btw, the download during Update works, it only complains during Compiling...
Maybe something in javafx artifacts changed?

Edit, indeed they introduced more platforms, thought I have the feeling this shouldn't be the problem but it could be somehow related
https://repo1.maven.org/maven2/org/openjfx/javafx-base/17-ea+8/
https://repo1.maven.org/maven2/org/openjfx/javafx-base/17-ea+9/ <== has more artifacts

@Martomate
Copy link

There has also been a change in this file:
https://repo1.maven.org/maven2/org/openjfx/javafx/17-ea+8/javafx-17-ea+8.pom
https://repo1.maven.org/maven2/org/openjfx/javafx/17-ea+9/javafx-17-ea+9.pom

This is where javafx.platform is defined, so it seems quite relevant.

I've done some experiments and it seems like the system property os.name affects what profile is chosen, but os.arch is ignored. This was tested by calling System.setProperty and then adding the dependencies without any classifier. For 17-ea+9 nothing worked anymore.

@s-bernard
Copy link

There are two new properties used to define javafx.platform in 17-ea+9 pom and later.

First, os.arch property. I guess this is not a problem because it is correctly defined like os.name and it seems to be transfered correctly to coursier (I do not need to define manually a classifier for versions 17-ea+8 and before. It seems to be ignored anyway.).

But there is also a new property named javafx.monocle which is not defined by default. And I’m pretty sure the problem is there. Surprisingly, being not defined does not trigger the following activation:

<property>
  <name>javafx.monocle</name>
  <value>!true</value>
</property>

This non-activation may be a bug of coursier.

If not, a solution is to define this property via extraProperties like @eed3si9n said. Is there a way to do it in sbt?
Another way is to define javafx.platform.custom to select directly the platform we want.

For example, it works with mill by using a resolutionCustomizer:

  def resolutionCustomizer =
    T.task {
      Some((r: coursier.core.Resolution) =>
        r.withOsInfo(
          coursier.core.Activation.Os.fromProperties(sys.props.toMap),
        ).withExtraProperties(Seq(("javafx.monocle", "false")))
      )
    }

The first part is just providing system properties but then I add javafx.monocle. Then it works!

@keynmol
Copy link
Contributor

keynmol commented Sep 14, 2021

Hah! Hello everyone affected by this issue :) I've been investigating it and arrived at the same conclusion as @s-bernard - coursier's property activation logic is slightly incorrect in this particular case.

I hope this PR will fix it: coursier/coursier#2176

@eed3si9n
Copy link
Member

Nice!

@robstoll
Copy link

@keynmol Is there a way to use the pre-release v2.0.16-200-ge888c6dea of coursier in sbt?

@keynmol
Copy link
Contributor

keynmol commented Nov 12, 2021

I believe there was a way, but I've never used it: https://get-coursier.io/docs/sbt-coursier#sbt-13x

That said, I'm pretty sure either @alexarchambault or @eed3si9n have a way of doing it, so let's see if they can shed some light :)

@eed3si9n
Copy link
Member

sbt uses lm-coursier-shaded_2.12 (https://repo1.maven.org/maven2/io/get-coursier/lm-coursier-shaded_2.12/). I don't think you can use the latest pre-releases unless you're willing to build and publish the artifact locally or something.

@robstoll
Copy link

@eed3si9n thanks for the clarification, in this case I'll see if I can help to get the fix into a new release. @alexarchambault can I somehow help to get the coursier release 2.0.17 out and make it available to sbt?

@esamson
Copy link
Contributor

esamson commented Sep 18, 2022

I'm not sure what fixed it but I just upgraded to 20-ea+2 in esamson/remder#363 and it seems this is no longer an issue. For JavaFX dependencies, at least.

@utenma
Copy link

utenma commented Feb 7, 2023

seems working for most JavaFx modules in JavaFX 18+, however as soon graphics module is added as dependency running throws:

/Users/myuser/.openjfx/cache/19+11/aarch64/libprism_sw.dylib' 
(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

@SethTisue
Copy link
Member

@mindlid do we have reason to believe that the root cause is a bug in sbt and/or in Coursier?

@utenma
Copy link

utenma commented Feb 9, 2023

@SethTisue the only facts i can list:
when used an JDK with FX libraries like zulu-fx, everything works fine
when used standard JDK without JavaFX, sbt seems to not resolve some graphics module dependencies to arm64

on Mac/Apple Silicon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants