public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: Pedro Falcato <pedro.falcato@gmail.com>,
	Ayush Singh <ayushdevel1325@gmail.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
	Michael Kubacki <mikuback@linux.microsoft.com>,
	"Yao, Jiewen" <jiewen.yao@intel.com>,
	"Gaibusab, Jabeena B" <jabeena.b.gaibusab@intel.com>
Subject: Re: [edk2-devel] Proposal to move Rust std work to a Repository under Tianocore
Date: Mon, 1 Aug 2022 19:14:03 +0000	[thread overview]
Message-ID: <CO1PR11MB4929E80F999A0B84B774EA22D29A9@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAKbZUD35TKzpX9Byr=cHuffnMTxtfygsbe1x40YQYaMNsxeXMw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4476 bytes --]

Hi Pedro,

These ideas have been discussed.  These are all valuable and would be required
to use Rust in PEI, DXE, and SMM environments as part of system firmware images.

However, there is also a desire to use other rust crates that depend on std.
Those are not usable without std support.  So starting with a UEFI env with
full std that passes all rust unit tests and can be unstreamed to the rust
project provides a solid foundation to expand into the PEI, DXE, and SMM
environments and work on integration into the EDK II build system.

I consider UEFI std support to be a prerequisite for your ideas.

Thanks,

Mike

From: Pedro Falcato <pedro.falcato@gmail.com>
Sent: Monday, August 1, 2022 12:06 PM
To: Ayush Singh <ayushdevel1325@gmail.com>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>; Kinney, Michael D <michael.d.kinney@intel.com>; Michael Kubacki <mikuback@linux.microsoft.com>; Yao, Jiewen <jiewen.yao@intel.com>; Gaibusab, Jabeena B <jabeena.b.gaibusab@intel.com>
Subject: Re: [edk2-devel] Proposal to move Rust std work to a Repository under Tianocore

Right. I had no idea that you were going to go for std support in your project. This makes me like your project much less. I thought you were going to go the way of linux, where they do not use std but rather custom stuff that fits well with the rest of the kernel. I very much do not think that a whole standard library (especially a full-fledged one like Rust's) is useful, or fits well, or is even usable in this context; this is why no one that is working on firmware or a kernel uses your userspace's libc, C++ standard library or rust's std. I can see how std can be useful when trying to run standalone EFI apps, but the security critical code is the rest of EFI, which needs to fit the EDK2 system and sometimes run in awkward contexts like runtime services, SMM, etc.

Is there no chance to upstream build integration and some basic wrappers around existing code?

On Mon, Aug 1, 2022 at 6:39 PM Ayush Singh <ayushdevel1325@gmail.com<mailto:ayushdevel1325@gmail.com>> wrote:

Hi Pedro. Bare Rust already works in UEFI. In fact, UEFI support for no_std Rust has been present upstream for a few years. However, as you might be able to guess, bare Rust without any allocation and use of external crates simply did not provide enough benefits over C to migrate older projects to it. Additionally, without std, it's difficult to do enough significant testing to generate enough confidence in a new language like this.

Also to clarify, using Rust std in an application does not mean the whole std will be bundled with the application. Only the parts of std that are actually used by the application will be bundled in the final binary.

You can find more information about what is already present in upstream Rust for UEFI here: https://doc.rust-lang.org/nightly/rustc/platform-support/unknown-uefi.html

There is also some talks about promoting UEFI target to Tier-2, and having an std implementation will certainly help with that.



Yours Sincerely.

Ayush Singh


On 8/1/22 22:56, Pedro Falcato wrote:
Hi,

May I suggest you just port the bare rust language (no crates, no std) to EDK2? It seems far more plausible to expect people to use a cut down version with some bindings to the rest of the project instead of hoping people just use the whole of rust, a lot of which isnt proven (or even used AFAIK) in bare metal projects. Porting just the bare minimum is way more realistic in my opinion.

Thanks,
Pedro

On Mon, 1 Aug 2022, 18:02 Ayush Singh, <ayushdevel1325@gmail.com<mailto:ayushdevel1325@gmail.com>> wrote:
Hello everyone. In the previous email thread [1], I discussed the
proposal to move Rust std work to edk2-staging and mentioned its
potential problems. After some discussion with mentors, we arrived at
the conclusion to have a rustlang [2] fork under the Tianocore
organization, and move all the std related work there. We can then open
a PR upstream from there, while allowing PRs in this repository. This
should help provide an easier and streamlined way for people to
experiment and work on this project while it is in the process of being
merged upstream.


For a status update about tests:

- passed: 12797

- failed: 40

- ignored: 375


Yours Sincerely,

Ayush Singh


[1]: https://edk2.groups.io/g/devel/message/91989

[2]: https://github.com/rust-lang/rust







--
Pedro Falcato

[-- Attachment #2: Type: text/html, Size: 47286 bytes --]

  reply	other threads:[~2022-08-01 19:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 17:02 Proposal to move Rust std work to a Repository under Tianocore Ayush Singh
2022-08-01 17:26 ` [edk2-devel] " Pedro Falcato
2022-08-01 17:39   ` Ayush Singh
2022-08-01 19:06     ` Pedro Falcato
2022-08-01 19:14       ` Michael D Kinney [this message]
2022-08-01 19:36       ` Ayush Singh
2022-08-01 17:50   ` Ayush Singh
2022-08-01 18:07     ` Yao, Jiewen
2022-08-01 18:55       ` Ayush Singh
2022-08-01 21:16         ` Leonardo Garcia
2022-08-01 18:13 ` Michael D Kinney
2022-08-01 19:01   ` Ayush Singh
2022-08-01 19:08     ` Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR11MB4929E80F999A0B84B774EA22D29A9@CO1PR11MB4929.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox