aboutsummaryrefslogtreecommitdiffstats
path: root/community/rust
diff options
context:
space:
mode:
authorKevin Daudt <kdaudt@alpinelinux.org>2019-11-24 17:12:19 +0000
committerKevin Daudt <kdaudt@alpinelinux.org>2019-11-24 22:00:38 +0000
commitb08fc57094f3643e7af68d87b8ff3bad8c253882 (patch)
treea3e74ee7f53536e809bfad4ae13d95be75f8bd83 /community/rust
parent744fbf64b6a7f549c386ecaba4cc81356e46a1a9 (diff)
downloadaports-b08fc57094f3643e7af68d87b8ff3bad8c253882.tar.bz2
aports-b08fc57094f3643e7af68d87b8ff3bad8c253882.tar.xz
community/rust: fix build error with rustdoc
Building rust fails with the error: error[E0523]: found two different crates with name `bitflags` that are not distinguished by differing `-C metadata`. This will result in symbol conflicts between the two. --> src/librustdoc/html/markdown.rs:36:5 | 36 | use pulldown_cmark::{html, CowStr, Event, Options, Parser, Tag}; | ^^^^^^^^^^^^^^ Upstream fixed it with the included patch.
Diffstat (limited to 'community/rust')
-rw-r--r--community/rust/APKBUILD4
-rw-r--r--community/rust/rustdoc-fix-conflicting-symbols.patch35
2 files changed, 38 insertions, 1 deletions
diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD
index bb6d5e3d6f..3f59b25637 100644
--- a/community/rust/APKBUILD
+++ b/community/rust/APKBUILD
@@ -71,6 +71,7 @@ source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz
musl-dont-use-crt-static.patch
0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch
alpine-change-rpath-to-rustlib.patch
+ rustdoc-fix-conflicting-symbols.patch
"
builddir="$srcdir/rustc-$pkgver-src"
@@ -325,4 +326,5 @@ c31fdfe8a9b3411576c75da46645cf0465b9053000a2ab49cf9b2f2733f679d6d33acbf236d67a20
2a91c0d149f19a2268b2db8e375e0c10820529f588161d8d8e68900d929235d9b1cb4f0d64539c1e20ecca3948b4715f2d9d3d16a2754373d56b4b5808bed6bd link-musl-dynamically.patch
795194976763326c5e4a9eefc8b651b6d5fb533d2d000631ed48a92bafac90e9ca33b8d662e6c53ef109ea1a90c69def715d7d7154e3f9fb9035a58a313a7db3 musl-dont-use-crt-static.patch
f15c8e6a4c8ad33ee5874580ed76463e2a7359e9b4a8651eb974ea5354c3f992fd2ce1d04661ee8cff2105b25967428894ecdd144a6a45f09c7e1952b2f3731c 0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch
-7755637b140c5ddf01a8805b74b1b71a7e581c32d7deabf1372a94ccec30b6c494603cd5ab362f429b8b537ff4f7ee22de1b1ff43d5131c9130216319464773f alpine-change-rpath-to-rustlib.patch"
+7755637b140c5ddf01a8805b74b1b71a7e581c32d7deabf1372a94ccec30b6c494603cd5ab362f429b8b537ff4f7ee22de1b1ff43d5131c9130216319464773f alpine-change-rpath-to-rustlib.patch
+0cbe98e34e765b567502f0c7d502f19d9efb7722c82df4cabefc7948f53be73a69427f2fab00ce33cb43de5502c736bf48b7dfdf2dd2306137338e62e839e197 rustdoc-fix-conflicting-symbols.patch"
diff --git a/community/rust/rustdoc-fix-conflicting-symbols.patch b/community/rust/rustdoc-fix-conflicting-symbols.patch
new file mode 100644
index 0000000000..b399b16bf9
--- /dev/null
+++ b/community/rust/rustdoc-fix-conflicting-symbols.patch
@@ -0,0 +1,35 @@
+From 73369f32621f6a844a80a8513ae3ded901e4a406 Mon Sep 17 00:00:00 2001
+From: Mark Rousskov <mark.simulacrum@gmail.com>
+Date: Tue, 5 Nov 2019 11:16:46 -0500
+Subject: [PATCH] Hopefully fix rustdoc build
+
+It's super unclear why this broke when we switched to beta but not
+previously -- but at least it's hopefully fixed now.
+---
+ src/bootstrap/builder.rs | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
+index 2748903f2d47..2edcef203ad2 100644
+--- a/src/bootstrap/builder.rs
++++ b/src/bootstrap/builder.rs
+@@ -886,7 +886,18 @@ impl<'a> Builder<'a> {
+ // things still build right, please do!
+ match mode {
+ Mode::Std => metadata.push_str("std"),
+- _ => {},
++ // When we're building rustc tools, they're built with a search path
++ // that contains things built during the rustc build. For example,
++ // bitflags is built during the rustc build, and is a dependency of
++ // rustdoc as well. We're building rustdoc in a different target
++ // directory, though, which means that Cargo will rebuild the
++ // dependency. When we go on to build rustdoc, we'll look for
++ // bitflags, and find two different copies: one built during the
++ // rustc step and one that we just built. This isn't always a
++ // problem, somehow -- not really clear why -- but we know that this
++ // fixes things.
++ Mode::ToolRustc => metadata.push_str("tool-rustc"),
++ _ => {}
+ }
+ cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata);
+