Skip to content

Upgrade jni to 0.22#193

Draft
djc wants to merge 2 commits intomainfrom
jni-0.22
Draft

Upgrade jni to 0.22#193
djc wants to merge 2 commits intomainfrom
jni-0.22

Conversation

@djc
Copy link
Member

@djc djc commented Sep 13, 2025

To give feedback upstream.

@djc djc requested review from complexspaces, cpu and ctz September 13, 2025 19:27
@complexspaces
Copy link
Collaborator

It looks like we'll need to finally bump our MSRV with this update, as jni now has an MSRV of 1.77. This is 8 months newer, but hopefully by this point most users have moved on? Debian stable is on 1.85 so I think we're OK personally.
image

@complexspaces complexspaces force-pushed the jni-0.22 branch 2 times, most recently from 38af1e3 to c85fd1c Compare September 13, 2025 23:03
@complexspaces
Copy link
Collaborator

I've pushed up an initial attempt to adopt the new API of jni 0.22. It looks like there's some problems and lints that still need to be fixed but I'm out of steam for further fiddling today.

@atouchet
Copy link

jni 0.22 is out now.

@djc
Copy link
Member Author

djc commented Feb 23, 2026

@djc
Copy link
Member Author

djc commented Feb 23, 2026

error:
       … while checking the derivation 'packages.x86_64-linux.rustls-platform-verifier'

       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:38:12:
           37|
           38|   strict = drvFunc drvAttrs;
             |            ^
           39|

       … while evaluating derivation 'rustls-platform-verifier'
         whose name attribute is located at «github:NixOS/nixpkgs/8c50662»/pkgs/stdenv/generic/make-derivation.nix:333:7

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: No hash was found while vendoring the git dependency jni-0.22.0. You can add
       a hash through the `outputHashes` argument of `importCargoLock`:

       outputHashes = {
         "jni-0.22.0" = "<hash>";
       };

       If you use `buildRustPackage`, you can add this attribute to the `cargoLock`
       attribute set.

Not sure what this means, nor am I really motivated to learn...

@cpu
Copy link
Member

cpu commented Feb 23, 2026

Not sure what this means, nor am I really motivated to learn...

The error message suggests how to fix the problem (add an explicit outputHashes for the patched crate), but it will also go away when you stop using a cargo patch to take a git dependency on jni. I would recommend ignoring it for now.

@djc
Copy link
Member Author

djc commented Feb 24, 2026

Not sure what this means, nor am I really motivated to learn...

The error message suggests how to fix the problem (add an explicit outputHashes for the patched crate), but it will also go away when you stop using a cargo patch to take a git dependency on jni. I would recommend ignoring it for now.

Dropped the patch section, which is no longer necessary anyway.

@djc
Copy link
Member Author

djc commented Feb 24, 2026

Okay, so the test suite doesn't compile yet, and I don't think I have enough context on how this should work to fix that.

Also, the Nix stuff fails, probably because the compiler is too old and the flake.lock rust-overlay needs an update?

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.

4 participants