All of lore.kernel.org
 help / color / mirror / Atom feed
* Discussion on policies around minimum rust version for coconut-svsm
@ 2026-11-25 17:55 James Bottomley
  2026-11-25 18:32 ` Mahmoud Nagy Adam
  2026-11-26 12:27 ` Jörg Rödel
  0 siblings, 2 replies; 9+ messages in thread
From: James Bottomley @ 2026-11-25 17:55 UTC (permalink / raw)
  To: coconut-svsm, linux-coco

In the Wednesday coconut-svsm meeting I advocated for keeping this the
lowest version possible, in line with the way the kernel handles gcc
versioning, but since rust is a lot less mature than gcc, there are
more compelling reasons not to do this. However, the situation we
really want to avoid is moving too aggressively to a newer rust version
which then complicates actually doing a stable release of coconut
through a distribution.

Just in case it's instructive, the Linux Kernel actually maintains a
global and per-architecture minimum of gcc (checked in scripts/min-
tool-version.sh). The current minimum version of gcc is gcc-8, which is
way behind the latest gnu release of gcc-16. The last time it was
actually changed was in early 2025. The driver for the change was x86
needing gcc-8.1 for stack protector support:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a3e8fe814ad15c16735cdf394454a8bd96eb4d56

However Arnd Bergmann later raised it globally because there had been
no objections from any other architecture:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=118c40b7b50340bf7ff7e0adee8e3bab6e552c82

You can read the discussion in the links, but the compact summary is
"does anyone care ... no ... OK let's do it"

I think the coconut-svsm policy should be conservative; i.e. we try to
stay on the lowest possible rust version, starting with where we are
now (1.85 but shortly to be bumped to 1.90). However, if any forcing
function comes along that version should be increased. I think the two
forcing functions are

   1. Language feature we really need to help with or simplify the code
   2. cargo dependency hygiene (we need a version of our dependencies
      which is current with fixes and they may require a newer rust
      version to keep that currency)

but others may have things to add.

The other thing that came up is that eventually coconut-svsm will have
to be shipped by distributions and that means its minimum version must
overlap the build versions that distributions have chosen, so this
policy has to also be informed by the policies the distributions (both
enterprise like RHEL and community like Debian and Fedora) are going to
adopt ... which at least Red Hat promised to think about.

Are there any other considerations people can think of?

Regards,

James

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Discussion on policies around minimum rust version for coconut-svsm
  2026-11-25 17:55 Discussion on policies around minimum rust version for coconut-svsm James Bottomley
@ 2026-11-25 18:32 ` Mahmoud Nagy Adam
  2026-11-26 12:31   ` Jörg Rödel
  2026-11-26 12:27 ` Jörg Rödel
  1 sibling, 1 reply; 9+ messages in thread
From: Mahmoud Nagy Adam @ 2026-11-25 18:32 UTC (permalink / raw)
  To: James Bottomley; +Cc: coconut-svsm, linux-coco

James Bottomley <James.Bottomley@HansenPartnership.com> writes:

> In the Wednesday coconut-svsm meeting I advocated for keeping this the
> lowest version possible, in line with the way the kernel handles gcc
> versioning, but since rust is a lot less mature than gcc, there are
> more compelling reasons not to do this. However, the situation we
> really want to avoid is moving too aggressively to a newer rust version
> which then complicates actually doing a stable release of coconut
> through a distribution.
>
> Just in case it's instructive, the Linux Kernel actually maintains a
> global and per-architecture minimum of gcc (checked in scripts/min-
> tool-version.sh). The current minimum version of gcc is gcc-8, which is
> way behind the latest gnu release of gcc-16. The last time it was
> actually changed was in early 2025. The driver for the change was x86
> needing gcc-8.1 for stack protector support:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a3e8fe814ad15c16735cdf394454a8bd96eb4d56
>
> However Arnd Bergmann later raised it globally because there had been
> no objections from any other architecture:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=118c40b7b50340bf7ff7e0adee8e3bab6e552c82
>
> You can read the discussion in the links, but the compact summary is
> "does anyone care ... no ... OK let's do it"
>
> I think the coconut-svsm policy should be conservative; i.e. we try to
> stay on the lowest possible rust version, starting with where we are
> now (1.85 but shortly to be bumped to 1.90). However, if any forcing
> function comes along that version should be increased. I think the two
> forcing functions are
>
>    1. Language feature we really need to help with or simplify the code
>    2. cargo dependency hygiene (we need a version of our dependencies
>       which is current with fixes and they may require a newer rust
>       version to keep that currency)
>
> but others may have things to add.
>
> The other thing that came up is that eventually coconut-svsm will have
> to be shipped by distributions and that means its minimum version must
> overlap the build versions that distributions have chosen, so this
> policy has to also be informed by the policies the distributions (both
> enterprise like RHEL and community like Debian and Fedora) are going to
> adopt ... which at least Red Hat promised to think about.
>
> Are there any other considerations people can think of?
>
> Regards,
>
> James


For information, Rust for Linux already has a policy for this: their
minimum Rust version follows Debian Stable's and is raised some months
after each Debian stable release, so the kernel can always be built with
the Rust that Debian ships
(https://rust-for-linux.com/rust-version-policy).

We could generally follow this policy, unless a forcing function (a
needed language feature or a dependency fix) requires a newer version.

Regards,
Nagy

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Discussion on policies around minimum rust version for coconut-svsm
  2026-11-25 17:55 Discussion on policies around minimum rust version for coconut-svsm James Bottomley
  2026-11-25 18:32 ` Mahmoud Nagy Adam
@ 2026-11-26 12:27 ` Jörg Rödel
  1 sibling, 0 replies; 9+ messages in thread
From: Jörg Rödel @ 2026-11-26 12:27 UTC (permalink / raw)
  To: James Bottomley; +Cc: coconut-svsm, linux-coco

Hi James,

On Wed, Nov 25, 2026 at 12:55:23PM -0500, James Bottomley wrote:
> I think the coconut-svsm policy should be conservative; i.e. we try to
> stay on the lowest possible rust version, starting with where we are
> now (1.85 but shortly to be bumped to 1.90). However, if any forcing
> function comes along that version should be increased. I think the two
> forcing functions are

I agree with the assessment, COCONUT should be conservative about updating the
minimum required Rust compiler version. There are some constraints to think
about, though.

>    1. Language feature we really need to help with or simplify the code
>    2. cargo dependency hygiene (we need a version of our dependencies
>       which is current with fixes and they may require a newer rust
>       version to keep that currency)
> 
> but others may have things to add.
> 
> The other thing that came up is that eventually coconut-svsm will have
> to be shipped by distributions and that means its minimum version must
> overlap the build versions that distributions have chosen, so this
> policy has to also be informed by the policies the distributions (both
> enterprise like RHEL and community like Debian and Fedora) are going to
> adopt ... which at least Red Hat promised to think about.

The distribution policies are the main uncertainty for the project. We fully
control which language features COCONUT-SVSM is using, but not what our
downstream users require to build packages.

This can become problematic once COCONUT maintains stable release branches and
a security issue appears in a dependency, requiring an update which needs a
newer compiler version. We have a similar situation right now with PR #1277.

I am sure COCONUT is not the only Rust project which aims to be packaged by a
Linux distribution. It would be good to learn how the distributors handle these
situations with already packaged software so that we can adapt our policy to
their processes.

-Joerg

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Discussion on policies around minimum rust version for coconut-svsm
  2026-11-25 18:32 ` Mahmoud Nagy Adam
@ 2026-11-26 12:31   ` Jörg Rödel
  2026-11-26 16:18     ` James Bottomley
  0 siblings, 1 reply; 9+ messages in thread
From: Jörg Rödel @ 2026-11-26 12:31 UTC (permalink / raw)
  To: Mahmoud Nagy Adam; +Cc: James Bottomley, coconut-svsm, linux-coco

Hi Mahmoud,

On Wed, Nov 25, 2026 at 07:32:08PM +0100, Mahmoud Nagy Adam wrote:
> For information, Rust for Linux already has a policy for this: their
> minimum Rust version follows Debian Stable's and is raised some months
> after each Debian stable release, so the kernel can always be built with
> the Rust that Debian ships
> (https://rust-for-linux.com/rust-version-policy).
> 
> We could generally follow this policy, unless a forcing function (a
> needed language feature or a dependency fix) requires a newer version.

The Rust4Linux project is in a different situation. They do not use cargo and
vendor all external dependencies to maintain them within the Linux source tree.
This gives them much more freedom to set the minimum Rust version because
constraint #2 (from James' email) does not apply to them.

Also Debian stable uses Rust 1.85, COCONUT is already on 1.88 with the aim to
go to 1.91.

-Joerg

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Discussion on policies around minimum rust version for coconut-svsm
  2026-11-26 12:31   ` Jörg Rödel
@ 2026-11-26 16:18     ` James Bottomley
  2026-11-27  7:58       ` Gerd Hoffmann
  0 siblings, 1 reply; 9+ messages in thread
From: James Bottomley @ 2026-11-26 16:18 UTC (permalink / raw)
  To: Jörg Rödel, Mahmoud Nagy Adam; +Cc: coconut-svsm, linux-coco

On Thu, 2026-11-26 at 13:31 +0100, Jörg Rödel wrote:
> Hi Mahmoud,
> 
> On Wed, Nov 25, 2026 at 07:32:08PM +0100, Mahmoud Nagy Adam wrote:
> > For information, Rust for Linux already has a policy for this:
> > their minimum Rust version follows Debian Stable's and is raised
> > some months after each Debian stable release, so the kernel can
> > always be built with the Rust that Debian ships
> > (https://rust-for-linux.com/rust-version-policy).
> > 
> > We could generally follow this policy, unless a forcing function (a
> > needed language feature or a dependency fix) requires a newer
> > version.
> 
> The Rust4Linux project is in a different situation. They do not use
> cargo and vendor all external dependencies to maintain them within
> the Linux source tree.
> This gives them much more freedom to set the minimum Rust version
> because constraint #2 (from James' email) does not apply to them.

I agree with this, but it it too late to question why coconut couldn't
remove or at least reduce external dependencies?  I know it's a lot
easier for the rust4linux project because the kernel has a huge library
set of stuff it had to home grow which rust4linux can just use.
However, if I look at the coconut dependency list today, it's not that
huge.  I'm definitely biased; I tend to see the package ecosystem of
rust going the same way as all the others and leading to nasty security
problems like log4j via uncontrolled indirect dependencies.  To give a
concrete example: the goal of making coconut fips compliant by forcing
all crypto through a fips library is impossible to achieve today due to
crypto in indirect dependencies.

> Also Debian stable uses Rust 1.85, COCONUT is already on 1.88 with
> the aim to go to 1.91.

Well that's only because of this:

https://github.com/coconut-svsm/svsm/pull/1277

And the rationale is dependency on this project

https://gitlab.com/kraxel/virt-firmware-rs

requires it to pull in a bug fix, but if I look through the commit logs
of the latter I can't figure out why (presumably Gerd or Luigi can
explain); however, since the authors are also coconut committers it
might be possible to negotiate a way to get the bug fix without
requiring a rust version increase.

If the crypto dependencies all get dumped for fips, there's really only
the closely allied projects and some odd helpers which remain.  It
might be possible to internalize the helpers and keep the allies if
they agree to the same rust version policy (and crypto policy for fips)
... sort of a half way house between the way a normal rust project
behaves and the no external dependency requirement of rust4linux.

Regards,

James

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Discussion on policies around minimum rust version for coconut-svsm
  2026-11-26 16:18     ` James Bottomley
@ 2026-11-27  7:58       ` Gerd Hoffmann
  2026-11-27 14:04         ` James Bottomley
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Hoffmann @ 2026-11-27  7:58 UTC (permalink / raw)
  To: James Bottomley
  Cc: Jörg Rödel, Mahmoud Nagy Adam, coconut-svsm, linux-coco

  Hi,

> > Also Debian stable uses Rust 1.85, COCONUT is already on 1.88 with
> > the aim to go to 1.91.
> 
> Well that's only because of this:
> 
> https://github.com/coconut-svsm/svsm/pull/1277
> 
> And the rationale is dependency on this project
> 
> https://gitlab.com/kraxel/virt-firmware-rs
> 
> requires it to pull in a bug fix, but if I look through the commit logs
> of the latter I can't figure out why (presumably Gerd or Luigi can
> explain);

uefi-rs (which virt-firmware-rs depends on) raised the bar.  The
dependency update pulled this in.  Note that virt-firmware-rs does
not require the latest version ...

	uefi = { version = ">= 0.39, < 0.42" }
	uefi-raw = { version = ">= 0.15, < 0.18" }

... so pinning uefi + uefi-rs to an older version in coconut should
work for now.

It is unclear how long that will hold though.  There have been
incompatible changes which affected virt-firmware-rs in the past, most
recent was the 0.38 -> 0.39 update (which why 0.39 is the oldest
supported version).  It will probably happen again in the future ...

take care,
  Gerd


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Discussion on policies around minimum rust version for coconut-svsm
  2026-11-27  7:58       ` Gerd Hoffmann
@ 2026-11-27 14:04         ` James Bottomley
  2026-11-27 15:37           ` Gerd Hoffmann
  0 siblings, 1 reply; 9+ messages in thread
From: James Bottomley @ 2026-11-27 14:04 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Jörg Rödel, Mahmoud Nagy Adam, coconut-svsm, linux-coco

On Fri, 2026-11-27 at 08:58 +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > > Also Debian stable uses Rust 1.85, COCONUT is already on 1.88
> > > with the aim to go to 1.91.
> > 
> > Well that's only because of this:
> > 
> > https://github.com/coconut-svsm/svsm/pull/1277
> > 
> > And the rationale is dependency on this project
> > 
> > https://gitlab.com/kraxel/virt-firmware-rs
> > 
> > requires it to pull in a bug fix, but if I look through the commit
> > logs of the latter I can't figure out why (presumably Gerd or Luigi
> > can explain);
> 
> uefi-rs (which virt-firmware-rs depends on) raised the bar.  The
> dependency update pulled this in.  Note that virt-firmware-rs does
> not require the latest version ...
> 
> 	uefi = { version = ">= 0.39, < 0.42" }
> 	uefi-raw = { version = ">= 0.15, < 0.18" }

Digging into their reasons, it's this:

https://github.com/rust-osdev/uefi-rs/commit/89def6ad014294d0549d3efccab4afb55ae3f6ea

So they're blaming their dependencies ... it's turtles all the way
down.  Their commit logs are a bit useless (like most github projects)
but there are hints it's this issue:

https://github.com/rust-lang/rust/issues/100189

> ... so pinning uefi + uefi-rs to an older version in coconut should
> work for now.

THat's probably a good idea given this commit:

https://github.com/rust-osdev/uefi-rs/commit/b6876100e8a1cdf12ccea09252adc4ef4b367519

Although I don't quite know why going to 1.95 would be a breaking
change ... but if they mark it as such, it's likely going to be a
problem for you ...

The bottom line is they seem to be a project with an aggressive view
about increasing rust versions to get language features, so if there's
no way of controlling them, their view is going to become the forcing
function even for coconut.

> It is unclear how long that will hold though.  There have been
> incompatible changes which affected virt-firmware-rs in the past,
> most recent was the 0.38 -> 0.39 update (which why 0.39 is the oldest
> supported version).  It will probably happen again in the future ...

Would I be right in guessing it's just Cstr16 and the variable
interface you get from them?  The former should probably be generic,
like it is in C and the latter could be done internally.  I'm not
saying that's what has to be done, just probing for ways to reconcile
this conservative vs aggressive rust policy problem.

Regards,

James

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Discussion on policies around minimum rust version for coconut-svsm
  2026-11-27 14:04         ` James Bottomley
@ 2026-11-27 15:37           ` Gerd Hoffmann
  2026-11-28 16:22             ` James Bottomley
  0 siblings, 1 reply; 9+ messages in thread
From: Gerd Hoffmann @ 2026-11-27 15:37 UTC (permalink / raw)
  To: James Bottomley
  Cc: Jörg Rödel, Mahmoud Nagy Adam, coconut-svsm, linux-coco

  Hi,

> Would I be right in guessing it's just Cstr16 and the variable
> interface you get from them?

Yes, for the most part it is support for those uefi strings.
Also Errors and Status codes.

The variable interface is actually internal, but it needs
parse uefi strings ...

take care,
  Gerd


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Discussion on policies around minimum rust version for coconut-svsm
  2026-11-27 15:37           ` Gerd Hoffmann
@ 2026-11-28 16:22             ` James Bottomley
  0 siblings, 0 replies; 9+ messages in thread
From: James Bottomley @ 2026-11-28 16:22 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Jörg Rödel, Mahmoud Nagy Adam, coconut-svsm, linux-coco

On Fri, 2026-11-27 at 16:37 +0100, Gerd Hoffmann wrote:
>   Hi,
> 
> > Would I be right in guessing it's just Cstr16 and the variable
> > interface you get from them?
> 
> Yes, for the most part it is support for those uefi strings.
> Also Errors and Status codes.

So you can get the strings and errors from

https://crates.io/crates/r-efi

And widestring has a no_std version as well for Cstr16

https://crates.io/crates/widestring

Both of which seem to have much more conservative rust version
requirements than even coconut is proposing.  I think that's because
both the above aim to be shippable by distros and uefi-rs doesn't seem
to have any ambitions in that direction.  However, debian is trying to
package it in testing, where the rust version is 1.97.1 and which
should become stable some time in mid 2027; when that happens debian
will actually be committed to uefi-rs bug fix backports even if the
uefi-rs project goes beyond them in rust versions so we could rely on
the debian stable branch to keep everything conservative if we can wait
until Forky becomes stable?

> The variable interface is actually internal, but it needs
> parse uefi strings ...

If the above works, I think that would solve the problem long term and
coconut could actually stick with 1.88

Of course, what this proves is that unless the direct and indirect
dependencies are vetted for also following conservative rust version
policies, coconut is going to get forced by them regardless of what its
own policy is.  So what actual policy coconut follows is up to you.

Regards,

James

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-28 16:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 17:55 Discussion on policies around minimum rust version for coconut-svsm James Bottomley
2026-11-25 18:32 ` Mahmoud Nagy Adam
2026-11-26 12:31   ` Jörg Rödel
2026-11-26 16:18     ` James Bottomley
2026-11-27  7:58       ` Gerd Hoffmann
2026-11-27 14:04         ` James Bottomley
2026-11-27 15:37           ` Gerd Hoffmann
2026-11-28 16:22             ` James Bottomley
2026-11-26 12:27 ` Jörg Rödel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.