All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/rust: fix boostrap build
@ 2023-02-08 11:05 Sebastian Weyer
  2023-02-08 14:09 ` Romain Naour
  2023-02-08 14:47 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Weyer @ 2023-02-08 11:05 UTC (permalink / raw)
  To: buildroot; +Cc: Eric Le Bihan, Sebastian Weyer, James Hilliard

The update to v1.67.0 of rust broke the boostrap build. This patch
applies an upstream patch to fix this:
https://github.com/rust-lang/rust/commit/3fe64ebbce21e79adb64099984e96dfb79bdd0f9

Fixes:
http://autobuild.buildroot.org/results/214/214fcbb3458893784b7f85b60f7ee1edb428c77f/build-end.log

Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Cc: James Hilliard <james.hilliard1@gmail.com>
---
I previously just tested TestRustBin since TestRust takes forever. This
time I ran TestRust and it builds fine :)
---
 ...-unsoundness-in-bootstrap-cache-code.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/rust/0001-fix-unsoundness-in-bootstrap-cache-code.patch

diff --git a/package/rust/0001-fix-unsoundness-in-bootstrap-cache-code.patch b/package/rust/0001-fix-unsoundness-in-bootstrap-cache-code.patch
new file mode 100644
index 0000000000..3eae34642f
--- /dev/null
+++ b/package/rust/0001-fix-unsoundness-in-bootstrap-cache-code.patch
@@ -0,0 +1,43 @@
+From 6bf37780ed49846c78d6707355f1cf44790c4301 Mon Sep 17 00:00:00 2001
+From: Michael Goulet <michael@errs.io>
+Date: Mon, 12 Dec 2022 18:29:33 +0000
+Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20fix=20unsoundness=20in=20bootstr?=
+ =?UTF-8?q?ap=20cache=20code?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+(cherry picked from commit 3fe64ebbce21e79adb64099984e96dfb79bdd0f9)
+Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
+---
+ src/bootstrap/cache.rs | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs
+index be5c9bb0788..05f25af68ea 100644
+--- a/src/bootstrap/cache.rs
++++ b/src/bootstrap/cache.rs
+@@ -89,16 +89,16 @@ fn hash<H: Hasher>(&self, state: &mut H) {
+ 
+ impl<T: Internable + Deref> Deref for Interned<T> {
+     type Target = T::Target;
+-    fn deref(&self) -> &'static Self::Target {
++    fn deref(&self) -> &Self::Target {
+         let l = T::intern_cache().lock().unwrap();
+-        unsafe { mem::transmute::<&Self::Target, &'static Self::Target>(l.get(*self)) }
++        unsafe { mem::transmute::<&Self::Target, &Self::Target>(l.get(*self)) }
+     }
+ }
+ 
+ impl<T: Internable + AsRef<U>, U: ?Sized> AsRef<U> for Interned<T> {
+-    fn as_ref(&self) -> &'static U {
++    fn as_ref(&self) -> &U {
+         let l = T::intern_cache().lock().unwrap();
+-        unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) }
++        unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) }
+     }
+ }
+ 
+-- 
+2.25.1
+
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/rust: fix boostrap build
  2023-02-08 11:05 [Buildroot] [PATCH 1/1] package/rust: fix boostrap build Sebastian Weyer
@ 2023-02-08 14:09 ` Romain Naour
  2023-02-08 14:47 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Romain Naour @ 2023-02-08 14:09 UTC (permalink / raw)
  To: Sebastian Weyer, buildroot; +Cc: Eric Le Bihan, James Hilliard

Hello Sebastian,

Le 08/02/2023 à 12:05, Sebastian Weyer a écrit :
> The update to v1.67.0 of rust broke the boostrap build. This patch
> applies an upstream patch to fix this:
> https://github.com/rust-lang/rust/commit/3fe64ebbce21e79adb64099984e96dfb79bdd0f9
> 
> Fixes:
> http://autobuild.buildroot.org/results/214/214fcbb3458893784b7f85b60f7ee1edb428c77f/build-end.log

Reviewed-by: Romain Naour <romain.naour@smile.fr>

Best regards,
Romain

> 
> Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
> Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
> Cc: James Hilliard <james.hilliard1@gmail.com>
> ---
> I previously just tested TestRustBin since TestRust takes forever. This
> time I ran TestRust and it builds fine :)
> ---
>  ...-unsoundness-in-bootstrap-cache-code.patch | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 package/rust/0001-fix-unsoundness-in-bootstrap-cache-code.patch
> 
> diff --git a/package/rust/0001-fix-unsoundness-in-bootstrap-cache-code.patch b/package/rust/0001-fix-unsoundness-in-bootstrap-cache-code.patch
> new file mode 100644
> index 0000000000..3eae34642f
> --- /dev/null
> +++ b/package/rust/0001-fix-unsoundness-in-bootstrap-cache-code.patch
> @@ -0,0 +1,43 @@
> +From 6bf37780ed49846c78d6707355f1cf44790c4301 Mon Sep 17 00:00:00 2001
> +From: Michael Goulet <michael@errs.io>
> +Date: Mon, 12 Dec 2022 18:29:33 +0000
> +Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20fix=20unsoundness=20in=20bootstr?=
> + =?UTF-8?q?ap=20cache=20code?=
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +(cherry picked from commit 3fe64ebbce21e79adb64099984e96dfb79bdd0f9)
> +Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
> +---
> + src/bootstrap/cache.rs | 8 ++++----
> + 1 file changed, 4 insertions(+), 4 deletions(-)
> +
> +diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs
> +index be5c9bb0788..05f25af68ea 100644
> +--- a/src/bootstrap/cache.rs
> ++++ b/src/bootstrap/cache.rs
> +@@ -89,16 +89,16 @@ fn hash<H: Hasher>(&self, state: &mut H) {
> + 
> + impl<T: Internable + Deref> Deref for Interned<T> {
> +     type Target = T::Target;
> +-    fn deref(&self) -> &'static Self::Target {
> ++    fn deref(&self) -> &Self::Target {
> +         let l = T::intern_cache().lock().unwrap();
> +-        unsafe { mem::transmute::<&Self::Target, &'static Self::Target>(l.get(*self)) }
> ++        unsafe { mem::transmute::<&Self::Target, &Self::Target>(l.get(*self)) }
> +     }
> + }
> + 
> + impl<T: Internable + AsRef<U>, U: ?Sized> AsRef<U> for Interned<T> {
> +-    fn as_ref(&self) -> &'static U {
> ++    fn as_ref(&self) -> &U {
> +         let l = T::intern_cache().lock().unwrap();
> +-        unsafe { mem::transmute::<&U, &'static U>(l.get(*self).as_ref()) }
> ++        unsafe { mem::transmute::<&U, &U>(l.get(*self).as_ref()) }
> +     }
> + }
> + 
> +-- 
> +2.25.1
> +

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/rust: fix boostrap build
  2023-02-08 11:05 [Buildroot] [PATCH 1/1] package/rust: fix boostrap build Sebastian Weyer
  2023-02-08 14:09 ` Romain Naour
@ 2023-02-08 14:47 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2023-02-08 14:47 UTC (permalink / raw)
  To: Sebastian Weyer; +Cc: Eric Le Bihan, James Hilliard, buildroot

>>>>> "Sebastian" == Sebastian Weyer <sebastian.weyer@smile.fr> writes:

 > The update to v1.67.0 of rust broke the boostrap build. This patch

s/boostrap/bootstrap/ ;)

 > applies an upstream patch to fix this:
 > https://github.com/rust-lang/rust/commit/3fe64ebbce21e79adb64099984e96dfb79bdd0f9

 > Fixes:
 > http://autobuild.buildroot.org/results/214/214fcbb3458893784b7f85b60f7ee1edb428c77f/build-end.log

 > Signed-off-by: Sebastian Weyer <sebastian.weyer@smile.fr>
 > Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr>
 > Cc: James Hilliard <james.hilliard1@gmail.com>

Committed with that fixed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2023-02-08 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 11:05 [Buildroot] [PATCH 1/1] package/rust: fix boostrap build Sebastian Weyer
2023-02-08 14:09 ` Romain Naour
2023-02-08 14:47 ` Peter Korsgaard

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.