From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) by mx.groups.io with SMTP id smtpd.web12.1428.1659380777304914808 for ; Mon, 01 Aug 2022 12:06:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Qh/nti7X; spf=pass (domain: gmail.com, ip: 209.85.217.52, mailfrom: pedro.falcato@gmail.com) Received: by mail-vs1-f52.google.com with SMTP id l68so12312867vsc.0 for ; Mon, 01 Aug 2022 12:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=nUrEUnRGJGWrPXPGA5Ta4C14h9pJU0Ifeovo3nnwKWw=; b=Qh/nti7X0XnhMRt5FpdQBvhHQQCZF3DTvQlqBBh2nv604hkhP7Fn7JHAoGL8Xw0DCQ A3r9P9W+Ch6g47TpFv74z+3i3fogeR1LTBIN06A8fUOhR1zbHBBtchcSrwnLsopJZdIF 6W/qDwAEYgTYYHcoYDs2G9qwQVbnbmP1cEeUl0xv/9uXxbBtXhPIMVvdFfrfKQPwQE8m JJjD3WbMF98KTr3gUAeMnnOX5ZbyJ8e9jyW5QjLQql0ilSX575JM1HSRP2YmvCr/w20g e3nC3oJAhQUel1H4BeGyVDs2dOfHYN6Txj1b84BmiM8mRcSuoG7JGcbSlw5S2Q3w899s lndA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=nUrEUnRGJGWrPXPGA5Ta4C14h9pJU0Ifeovo3nnwKWw=; b=FDQU2o8pnk2gBzZQfNDB3xuKsAjVvYT3IO8KtQaQU0XWlurbBB30syRppQMiOheMLI W+IAYp4hbqaxfa45AiXjxANGbMwp9cdZG/vErA5ZrP0LupY8WHEURvM6ZFGMFKCb1n4z 0aZJOcFnGHfMXUvucdYCR6fxpi9DB+8zUEGTiKBx9DmeeCeRPJBORhHdX0ejNO1uAoqQ +qF8SyiXWoeAUXbtddJLe+bJ99dRZ4EWlnB//OX0Uia+zX41alXxFOY/z5EyexlEYaOL xxSrmxLy4Z4u2CtaonqwzpDpaXj5FDett6U6Js2fffyO9KtXcqR1TGzg2XXb9d+nLhua pA4g== X-Gm-Message-State: AJIora95W72SyF7R2BpajNpiQ0EUadwomstGwhNzSXeLtzA1/qRhwdU+ +KmTHgEq0m4jA0/fWvrhnrPLOx2m1Zc7+yNVp9U= X-Google-Smtp-Source: AGRyM1u1lGs2MCTIeeQiQ+BQSj9F2uammqTeP4w3TOqTCcCOa/LPpD5Az98cIS3a+sWwcYTeJY2jxKzx7udG79i4yYM= X-Received: by 2002:a67:af07:0:b0:358:3951:343e with SMTP id v7-20020a67af07000000b003583951343emr5923784vsl.6.1659380776350; Mon, 01 Aug 2022 12:06:16 -0700 (PDT) MIME-Version: 1.0 References: <33ac1f75-d6c9-2093-8701-698a3e553d64@gmail.com> <25b8fe0b-12ae-8c51-5e3b-6397a727c863@gmail.com> In-Reply-To: <25b8fe0b-12ae-8c51-5e3b-6397a727c863@gmail.com> From: "Pedro Falcato" Date: Mon, 1 Aug 2022 20:06:04 +0100 Message-ID: Subject: Re: [edk2-devel] Proposal to move Rust std work to a Repository under Tianocore To: Ayush Singh Cc: edk2-devel-groups-io , "Kinney, Michael D" , Michael Kubacki , "Yao, Jiewen" , "Gaibusab, Jabeena B" Content-Type: multipart/alternative; boundary="000000000000b8b7f405e532b12e" --000000000000b8b7f405e532b12e Content-Type: text/plain; charset="UTF-8" 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 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, 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 --000000000000b8b7f405e532b12e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Right. I had no idea that you were going to go for st= d support in your project. This makes me like your project much less. I tho= ught you were going to go the way of linux, where they do not use std but r= ather 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 l= ike 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 users= pace'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 crit= ical code is the rest of EFI, which needs to fit the EDK2 system and someti= mes run in awkward contexts like runtime services, SMM, etc.
=
Is there no chance to upstream build integration and some ba= sic wrappers around existing code?

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

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 significan= t 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/platf= orm-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:
=20
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> 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
--000000000000b8b7f405e532b12e--