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

Upgrade JNA used for SBT Zinc #20361

Closed
msogrin opened this issue Apr 4, 2022 · 4 comments
Closed

Upgrade JNA used for SBT Zinc #20361

msogrin opened this issue Apr 4, 2022 · 4 comments

Comments

@msogrin
Copy link

msogrin commented Apr 4, 2022

Gradle build on Macosx Monterey fails on compileScala task when executed from Intellij IDEA with error

Unable to load library 'c': Native library (darwin/libc.dylib) not found in resource path

The error doesn't happen when build is started from Terminal.
The error happens only for some team members, and other people with seemingly identical setup have no issues.

The error is similar to https://youtrack.jetbrains.com/issue/IDEA-244962. And the workaround suggested there helped: upgrade JNA to at least 5.6.

I upgraded to 5.11.0 using

dependencies {
    constraints {
        zinc("net.java.dev.jna:jna:5.11.0")
        zinc("net.java.dev.jna:jna-platform:5.11.0")
    }
}

and it helped to eliminate the error when executed from IDEA. No ill effects were observed yet but the testing wasn't extensive.

It would be better if Gradle distribution used a newer version of JNA by default without need for workaround in user build scripts.

@hegyibalint
Copy link
Member

What happens if you would upgrade the zinc version?

Related documentation: https://docs.gradle.org/current/userguide/scala_plugin.html#sec:configure_zinc_compiler
Related issue: #19864

@msogrin
Copy link
Author

msogrin commented Apr 6, 2022

I'll test when #19864 gets into a RC/released version.

@msogrin
Copy link
Author

msogrin commented May 19, 2022

Tested with 7.5-rc1, the issue is resolved: Zinc 1.6.1 uses JNA 5.8.0, which is higher than required 5.6.

@msogrin
Copy link
Author

msogrin commented May 25, 2022

Tested with 7.5-rc1, the issue is resolved: Zinc 1.6.1 uses JNA 5.8.0, which is higher than required 5.6.

Correction: the problem is fixed not because a newer JNA is used. Instead, org.scala-sbt:io >= 1.4.0 doesn't even use JNA (for millisecond time), but uses Java time with Java 10+.

@msogrin msogrin closed this as completed Nov 16, 2022
@ljacomet ljacomet closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants