Skip to content

[stable-1.19.x] deps: fix vm-memory version conflict when used as a Rust dependency#728

Merged
slp merged 1 commit into
libkrun:stable-1.19.xfrom
jakecorrenti:fix-transient-deps
Jun 24, 2026
Merged

[stable-1.19.x] deps: fix vm-memory version conflict when used as a Rust dependency#728
slp merged 1 commit into
libkrun:stable-1.19.xfrom
jakecorrenti:fix-transient-deps

Conversation

@jakecorrenti

@jakecorrenti jakecorrenti commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

When libkrun is added as a Rust crate dependency, Cargo resolves two incompatible versions of vm-memory (0.17.1 and 0.18.0), causing compilation failures. The root cause is imago's wide vm-memory constraint (>=0.16, <0.19) which lets Cargo pick 0.18.0 for imago while everything else resolves to 0.17.1. Within the workspace this is hidden by Cargo.lock, but external consumers don't inherit it.

Drop imago's vm-memory feature and manually convert VolatileSlice to IoVector/IoVectorMut using ptr_guard()/ptr_guard_mut(). Pin all vm-memory dependencies to =0.17.1 to prevent version splits from newly published semver-compatible releases (e.g., 0.17.2).

Fixes: #726

@drahnr

drahnr commented Jun 17, 2026

Copy link
Copy Markdown

I can confirm locally vendoring and patching imago @ v0.2.2, pinning the re-export of vm-memory to 0.17.1 works as expected for libkrun@v1.19.0

@jakecorrenti jakecorrenti marked this pull request as ready for review June 17, 2026 15:31
@slp

slp commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

I think we should wait for a new release of linux-loader and then update our crates to be at 0.18.0 instead.

@jakecorrenti

Copy link
Copy Markdown
Collaborator Author

I think we should wait for a new release of linux-loader and then update our crates to be at 0.18.0 instead.

We'll need to also wait for rust-vmm/vhost#348

@drahnr

drahnr commented Jun 22, 2026

Copy link
Copy Markdown

Given that the project is hardly usable without, an interim patch release would be very appreciated.

@slp

slp commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

I think we should wait for a new release of linux-loader and then update our crates to be at 0.18.0 instead.

We'll need to also wait for rust-vmm/vhost#348

Hm... that one is going to take longer. OK, what do you think about retargeting this change for stable-1.19.x? Then we can do the right thing for main.

@slp

slp commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Given that the project is hardly usable without, an interim patch release would be very appreciated.

This project has existed for years before even having a release on crates.io, and I think many people have found it usable.

@jakecorrenti

Copy link
Copy Markdown
Collaborator Author

I think we should wait for a new release of linux-loader and then update our crates to be at 0.18.0 instead.

We'll need to also wait for rust-vmm/vhost#348

Hm... that one is going to take longer. OK, what do you think about retargeting this change for stable-1.19.x? Then we can do the right thing for main.

I think that's a good compromise. I'll get around to it today

@jakecorrenti jakecorrenti changed the base branch from main to stable-1.19.x June 24, 2026 02:41
When libkrun is added as a Rust crate dependency, Cargo resolves two
incompatible versions of vm-memory (0.17.1 and 0.18.0), causing
compilation failures. The root cause is imago's wide vm-memory
constraint (>=0.16, <0.19) which lets Cargo pick 0.18.0 for imago
while everything else resolves to 0.17.1. Within the workspace this
is hidden by Cargo.lock, but external consumers don't inherit it.

Drop imago's vm-memory feature and manually convert VolatileSlice to
IoVector/IoVectorMut using ptr_guard()/ptr_guard_mut(). Pin all
vm-memory dependencies to =0.17.1 to prevent version splits from
newly published semver-compatible releases (e.g., 0.17.2).

Assisted-by: Claude Code: claude-opus-4-6[1m]
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
@jakecorrenti

Copy link
Copy Markdown
Collaborator Author

Hm... that one is going to take longer. OK, what do you think about retargeting this change for stable-1.19.x? Then we can do the right thing for main.

Should be set now

@jakecorrenti jakecorrenti changed the title deps: fix vm-memory version conflict when used as a Rust dependency deps: fix vm-memory version conflict when used as a Rust dependency (stable-1.19.x) Jun 24, 2026
@jakecorrenti jakecorrenti changed the title deps: fix vm-memory version conflict when used as a Rust dependency (stable-1.19.x) [stable-1.19.x] deps: fix vm-memory version conflict when used as a Rust dependency Jun 24, 2026
@slp

slp commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

thanks @jakecorrenti !

@slp slp merged commit 9a8fedc into libkrun:stable-1.19.x Jun 24, 2026
14 checks passed
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.

Unable to compile libkrun post v1.16.0 as cargo dependency - transient dependency version mismatches

3 participants