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

Bump the SBT version from 1.4.1 to 1.9.8 #737

Merged
merged 1 commit into from
Jan 19, 2024
Merged

Conversation

kenoir
Copy link
Contributor

@kenoir kenoir commented Jan 14, 2024

What does this change?

The 1.4.1 version of SBT has an issue with the version of the JNA library is uses which prevents it from loading on M1 macs.

scala-libs git:(main) ✗ sbt
copying runtime jar...
[info] [launcher] getting org.scala-sbt sbt 1.4.1  (this may take some time)...
[info] [launcher] getting Scala 2.12.12 (for sbt)...
java.lang.UnsatisfiedLinkError: Can't load library: /Users/kennyr/Library/Caches/JNA/temp/jna12269094481575250405.tmp

See: sbt/io#320

How to test?

The most recent version (1.9.8) of sbt seems to work with this project, so upgrading.

  • Build and test locally, does it succeed?
  • Does this PR get a green tick when running in CI?

How can we measure success?

People working on this project with M1 macs can build and test it.

Have we considered potential risks?

Jumping from 1.4.x to 1.9.x is a large version leap ... there may be some breaking changes lurking in the release notes. However if the project builds and tests without error we can be somewhat reassured that we have not met any.

The 1.4.1 version of SBT has an issue with the version of the JNA library is uses which prevents it from loading on M1 macs.

See: sbt/io#320

The most recent version (1.9.8) of sbt works with this project, so upgrading.

- [ ] Build and test locally, does it succeed?
- [ ] Does this PR get a green tick when running in CI?
@kenoir kenoir requested a review from a team January 14, 2024 13:18
@kenoir kenoir linked an issue Jan 14, 2024 that may be closed by this pull request
13 tasks
@kenoir
Copy link
Contributor Author

kenoir commented Jan 14, 2024

Hmm, there are still some issues here. Trying to run after sbt project items results in an error like:

sbt:items> run
[info] running weco.api.items.Main
13:38:13.716 [sbt-bg-threads-1] INFO  weco.api.items.Main$ - Starting service
13:38:14.027 [main-actor-system-akka.actor.default-dispatcher-4] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
13:38:14.206 [sbt-bg-threads-1] ERROR weco.api.items.Main$ - Fatal error, terminating service:
java.lang.IllegalStateException: Error during attachment using: co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent$AttachmentProvider$Compound@598a78c7
        at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:613)
        at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.attach(ByteBuddyAgent.java:273)
        at co.elastic.apm.attach.ElasticApmAttacher.attach(ElasticApmAttacher.java:170)
        at co.elastic.apm.attach.ElasticApmAttacher.attach(ElasticApmAttacher.java:113)
        at weco.Tracing$.init(Tracing.scala:49)
        at weco.api.items.Main$.$anonfun$new$1(Main.scala:32)
        at weco.typesafe.WellcomeTypesafeApp.runWithConfig(WellcomeTypesafeApp.scala:21)
        at weco.typesafe.WellcomeTypesafeApp.runWithConfig$(WellcomeTypesafeApp.scala:16)
        at weco.api.items.Main$.runWithConfig(Main.scala:24)
        at weco.api.items.Main$.delayedEndpoint$weco$api$items$Main$1(Main.scala:26)
        at weco.api.items.Main$delayedInit$body.apply(Main.scala:24)                                                                                               [0/1943]
        at scala.Function0.apply$mcV$sp(Function0.scala:39)
        at scala.Function0.apply$mcV$sp$(Function0.scala:39)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
        at scala.App.$anonfun$main$1$adapted(App.scala:80)
        at scala.collection.immutable.List.foreach(List.scala:431)
        at scala.App.main(App.scala:80)
        at scala.App.main$(App.scala:78)
        at weco.api.items.Main$.main(Main.scala:24)
        at weco.api.items.Main.main(Main.scala)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at sbt.Run.invokeMain(Run.scala:144)
        at sbt.Run.execute$1(Run.scala:94)
        at sbt.Run.$anonfun$runWithLoader$5(Run.scala:121)
        at sbt.Run$.executeSuccess(Run.scala:187)
        at sbt.Run.runWithLoader(Run.scala:121)
        at sbt.Defaults$.$anonfun$bgRunTask$6(Defaults.scala:1988)
        at sbt.Defaults$.$anonfun$termWrapper$2(Defaults.scala:1927)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at scala.util.Try$.apply(Try.scala:213)
        at sbt.internal.BackgroundThreadPool$BackgroundRunnable.run(DefaultBackgroundJobService.scala:367)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.reflect.InvocationTargetException: null
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at co.elastic.apm.attach.bytebuddy.agent.Attacher.install(Attacher.java:106)
        at co.elastic.apm.attach.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:608)
        ... 36 common frames omitted
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /Users/kennyr/Library/Caches/JNA/temp/jna7060826423949229767.tmp

It looks like we are still pulling in a dependency on an older version of the JNA library that is causing the issue. Inspecting the dependency tree:

Screenshot 2024-01-14 at 13 39 49

Generated using the sbt command dependencyBrowseTreeHTML, after adding these changes: #738

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")

We can see this is coming from the elastic APM library, that is pulled in via wellcomecollection/scala-libs.

Probably worth looking at bumping this dependency in a future PR.

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

Successfully merging this pull request may close these issues.

Meaningful ECS service health checks
2 participants