From 217d9223a5aa75daf9f286fd1fc06dae379b5dbc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:03:05 +0200 Subject: Adding debian version 1.64.0+dfsg1-1. Signed-off-by: Daniel Baumann --- .../patches/d-0000-ignore-removed-submodules.patch | 253 +++++++++ .../d-0001-pkg-config-no-special-snowflake.patch | 93 ++++ .../d-0002-mdbook-strip-embedded-libs.patch | 420 +++++++++++++++ debian/patches/d-0003-cc-psm-rebuild-wasm32.patch | 48 ++ debian/patches/d-0004-clippy-feature-sync.patch | 37 ++ debian/patches/d-0005-no-jemalloc.patch | 46 ++ debian/patches/d-armel-fix-lldb.patch | 19 + debian/patches/d-bootstrap-cargo-check-cfg.patch | 19 + debian/patches/d-bootstrap-cargo-doc-paths.patch | 243 +++++++++ .../d-bootstrap-custom-debuginfo-path.patch | 40 ++ debian/patches/d-bootstrap-disable-git.patch | 45 ++ debian/patches/d-bootstrap-install-symlinks.patch | 36 ++ debian/patches/d-bootstrap-no-assume-tools.patch | 27 + debian/patches/d-bootstrap-old-cargo-compat.patch | 45 ++ .../d-bootstrap-permit-symlink-in-docs.patch | 14 + .../d-bootstrap-read-beta-version-from-file.patch | 37 ++ debian/patches/d-bootstrap-rustflags.patch | 32 ++ debian/patches/d-bootstrap-use-local-css.patch | 42 ++ .../d-bootstrap-use-system-compiler-rt.patch | 40 ++ debian/patches/d-fix-rustix-outline.patch | 60 +++ debian/patches/d-remove-arm-privacy-breaches.patch | 195 +++++++ debian/patches/d-rust-gdb-paths | 39 ++ debian/patches/d-rust-lldb-paths | 29 ++ debian/patches/d-rustc-add-soname.patch | 44 ++ .../patches/d-rustc-fix-mips64el-bootstrap.patch | 62 +++ debian/patches/d-rustc-i686-baseline.patch | 22 + debian/patches/d-rustc-prefer-dynamic.patch | 18 + debian/patches/d-rustc-windows-ssp.patch | 22 + .../patches/d-rustdoc-disable-embedded-fonts.patch | 77 +++ debian/patches/d-test-host-duplicates.patch | 20 + debian/patches/d-test-ignore-avx-44056.patch | 22 + debian/patches/series | 70 +++ debian/patches/u-allow-system-compiler-rt.patch | 327 ++++++++++++ ...piler-builtins-add-sync-builtin-fallbacks.patch | 223 ++++++++ .../u-arm-compiler-builtins-weak-linkage-arm.patch | 23 + debian/patches/u-fix-rustix-for-sparc64.patch | 203 ++++++++ debian/patches/u-ignore-bpf-test.patch | 18 + debian/patches/u-ignore-endian-big-diff.patch | 70 +++ debian/patches/u-ignore-ppc-hangs.patch | 34 ++ debian/patches/u-ignore-reproducible-failure.patch | 22 + .../patches/u-make-tests-work-without-rpath.patch | 23 + debian/patches/u-reproducible-build.patch | 25 + debian/patches/u-reproducible-dl-stage0.patch | 22 + debian/patches/u-rustc-llvm-cross-flags.patch | 22 + ...constant-eval-to-do-strict-validity-check.patch | 569 +++++++++++++++++++++ .../patches/ubuntu-disable-ppc64el-asm-tests.patch | 39 ++ debian/patches/ubuntu-ignore-arm-doctest.patch | 38 ++ 47 files changed, 3874 insertions(+) create mode 100644 debian/patches/d-0000-ignore-removed-submodules.patch create mode 100644 debian/patches/d-0001-pkg-config-no-special-snowflake.patch create mode 100644 debian/patches/d-0002-mdbook-strip-embedded-libs.patch create mode 100644 debian/patches/d-0003-cc-psm-rebuild-wasm32.patch create mode 100644 debian/patches/d-0004-clippy-feature-sync.patch create mode 100644 debian/patches/d-0005-no-jemalloc.patch create mode 100644 debian/patches/d-armel-fix-lldb.patch create mode 100644 debian/patches/d-bootstrap-cargo-check-cfg.patch create mode 100644 debian/patches/d-bootstrap-cargo-doc-paths.patch create mode 100644 debian/patches/d-bootstrap-custom-debuginfo-path.patch create mode 100644 debian/patches/d-bootstrap-disable-git.patch create mode 100644 debian/patches/d-bootstrap-install-symlinks.patch create mode 100644 debian/patches/d-bootstrap-no-assume-tools.patch create mode 100644 debian/patches/d-bootstrap-old-cargo-compat.patch create mode 100644 debian/patches/d-bootstrap-permit-symlink-in-docs.patch create mode 100644 debian/patches/d-bootstrap-read-beta-version-from-file.patch create mode 100644 debian/patches/d-bootstrap-rustflags.patch create mode 100644 debian/patches/d-bootstrap-use-local-css.patch create mode 100644 debian/patches/d-bootstrap-use-system-compiler-rt.patch create mode 100644 debian/patches/d-fix-rustix-outline.patch create mode 100644 debian/patches/d-remove-arm-privacy-breaches.patch create mode 100644 debian/patches/d-rust-gdb-paths create mode 100644 debian/patches/d-rust-lldb-paths create mode 100644 debian/patches/d-rustc-add-soname.patch create mode 100644 debian/patches/d-rustc-fix-mips64el-bootstrap.patch create mode 100644 debian/patches/d-rustc-i686-baseline.patch create mode 100644 debian/patches/d-rustc-prefer-dynamic.patch create mode 100644 debian/patches/d-rustc-windows-ssp.patch create mode 100644 debian/patches/d-rustdoc-disable-embedded-fonts.patch create mode 100644 debian/patches/d-test-host-duplicates.patch create mode 100644 debian/patches/d-test-ignore-avx-44056.patch create mode 100644 debian/patches/series create mode 100644 debian/patches/u-allow-system-compiler-rt.patch create mode 100644 debian/patches/u-arm-compiler-builtins-add-sync-builtin-fallbacks.patch create mode 100644 debian/patches/u-arm-compiler-builtins-weak-linkage-arm.patch create mode 100644 debian/patches/u-fix-rustix-for-sparc64.patch create mode 100644 debian/patches/u-ignore-bpf-test.patch create mode 100644 debian/patches/u-ignore-endian-big-diff.patch create mode 100644 debian/patches/u-ignore-ppc-hangs.patch create mode 100644 debian/patches/u-ignore-reproducible-failure.patch create mode 100644 debian/patches/u-make-tests-work-without-rpath.patch create mode 100644 debian/patches/u-reproducible-build.patch create mode 100644 debian/patches/u-reproducible-dl-stage0.patch create mode 100644 debian/patches/u-rustc-llvm-cross-flags.patch create mode 100644 debian/patches/ubuntu-Revert-Use-constant-eval-to-do-strict-validity-check.patch create mode 100644 debian/patches/ubuntu-disable-ppc64el-asm-tests.patch create mode 100644 debian/patches/ubuntu-ignore-arm-doctest.patch (limited to 'debian/patches') diff --git a/debian/patches/d-0000-ignore-removed-submodules.patch b/debian/patches/d-0000-ignore-removed-submodules.patch new file mode 100644 index 000000000..3dfaf06cb --- /dev/null +++ b/debian/patches/d-0000-ignore-removed-submodules.patch @@ -0,0 +1,253 @@ +From: Debian Rust Maintainers +Date: Sat, 2 Oct 2021 01:07:59 +0100 +Subject: d-0000-ignore-removed-submodules + +--- + Cargo.toml | 36 ++++++++---------------------------- + src/bootstrap/bootstrap.py | 4 ---- + src/bootstrap/builder.rs | 7 +------ + src/bootstrap/doc.rs | 1 - + src/bootstrap/test.rs | 12 +----------- + src/tools/clippy/Cargo.toml | 5 ----- + src/tools/rustfmt/Cargo.toml | 5 ----- + src/tools/tidy/src/deps.rs | 2 +- + 8 files changed, 11 insertions(+), 61 deletions(-) + +diff --git a/Cargo.toml b/Cargo.toml +index ffc886d..7231b60 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -16,25 +16,14 @@ members = [ + "src/tools/tidy", + "src/tools/tier-check", + "src/tools/build-manifest", +- "src/tools/remote-test-client", +- "src/tools/remote-test-server", + "src/tools/rust-installer", + "src/tools/rust-demangler", +- "src/tools/cargo", +- "src/tools/cargo/crates/credential/cargo-credential-1password", +- "src/tools/cargo/crates/credential/cargo-credential-macos-keychain", +- "src/tools/cargo/crates/credential/cargo-credential-wincred", + "src/tools/rustdoc", +- "src/tools/rls", + "src/tools/rustfmt", +- "src/tools/miri", +- "src/tools/miri/cargo-miri", + "src/tools/rustdoc-themes", + "src/tools/unicode-table-generator", +- "src/tools/expand-yaml-anchors", + "src/tools/jsondocck", + "src/tools/html-checker", +- "src/tools/bump-stage0", + "src/tools/lld-wrapper", + ] + +@@ -96,25 +85,16 @@ gimli.debug = 0 + miniz_oxide.debug = 0 + object.debug = 0 + +-# We want the RLS to use the version of Cargo that we've got vendored in this +-# repository to ensure that the same exact version of Cargo is used by both the +-# RLS and the Cargo binary itself. The RLS depends on Cargo as a git repository +-# so we use a `[patch]` here to override the github repository with our local +-# vendored copy. +-[patch."https://github.com/rust-lang/cargo"] +-cargo = { path = "src/tools/cargo" } +-cargo-util = { path = "src/tools/cargo/crates/cargo-util" } +- +-[patch."https://github.com/rust-lang/rustfmt"] +-# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt` +-# that we're shipping as well (to ensure that the rustfmt in RLS and the +-# `rustfmt` executable are the same exact version). +-rustfmt-nightly = { path = "src/tools/rustfmt" } ++# The only package that ever uses debug builds is bootstrap. ++# We care a lot about bootstrap's compile times, so don't include debug info for ++# dependencies, only bootstrap itself. ++[profile.dev] ++debug = 0 ++[profile.dev.package] ++# Only use debuginfo=1 to further reduce compile times. ++bootstrap.debug = 1 + + [patch.crates-io] +-# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on +-# here +-rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' } + + # See comments in `library/rustc-std-workspace-core/README.md` for what's going on + # here +diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py +index 03eec02..c40811f 100644 +--- a/src/bootstrap/bootstrap.py ++++ b/src/bootstrap/bootstrap.py +@@ -759,10 +759,6 @@ class RustBuild(object): + os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")] + for _ in range(0, self.verbose): + args.append("--verbose") +- if self.use_locked_deps: +- args.append("--locked") +- if self.use_vendored_sources: +- args.append("--frozen") + if self.get_toml("metrics", "build"): + args.append("--features") + args.append("build-metrics") +diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs +index 0ab4824..629e1bb 100644 +--- a/src/bootstrap/builder.rs ++++ b/src/bootstrap/builder.rs +@@ -600,7 +600,6 @@ impl<'a> Builder<'a> { + tool::RustInstaller, + tool::Cargo, + tool::Rls, +- tool::RustAnalyzer, + tool::RustAnalyzerProcMacroSrv, + tool::RustDemangler, + tool::Rustdoc, +@@ -622,7 +620,6 @@ impl<'a> Builder<'a> { + check::Clippy, + check::Miri, + check::Rls, +- check::RustAnalyzer, + check::Rustfmt, + check::Bootstrap + ), +@@ -650,7 +647,6 @@ impl<'a> Builder<'a> { + test::Cargotest, + test::Cargo, + test::Rls, +- test::RustAnalyzer, + test::ErrorIndex, + test::Distcheck, + test::RunMakeFullDeps, +@@ -698,10 +694,8 @@ impl<'a> Builder<'a> { + doc::RustdocBook, + doc::RustByExample, + doc::RustcBook, +- doc::CargoBook, + doc::Clippy, + doc::ClippyBook, +- doc::Miri, + doc::EmbeddedBook, + doc::EditionGuide, + ), +@@ -723,7 +717,6 @@ impl<'a> Builder<'a> { + dist::Miri, + dist::LlvmTools, + dist::RustDev, +- dist::Extended, + // It seems that PlainSourceTarball somehow changes how some of the tools + // perceive their dependencies (see #93033) which would invalidate fingerprints + // and force us to rebuild tools after vendoring dependencies. +@@ -2054,10 +2047,7 @@ impl<'a> Builder<'a> { + } + } + +- if self.config.locked_deps { +- cargo.arg("--locked"); +- } +- if self.config.vendor || self.is_sudo { ++ if self.is_sudo { + cargo.arg("--frozen"); + } + +diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs +index 2852442..5faa8e5 100644 +--- a/src/bootstrap/doc.rs ++++ b/src/bootstrap/doc.rs +@@ -73,7 +73,6 @@ macro_rules! book { + // FIXME: Make checking for a submodule automatic somehow (maybe by having a list of all submodules + // and checking against it?). + book!( +- CargoBook, "src/tools/cargo/src/doc", "cargo", submodule = "src/tools/cargo"; + ClippyBook, "src/tools/clippy/book", "clippy"; + EditionGuide, "src/doc/edition-guide", "edition-guide", submodule; + EmbeddedBook, "src/doc/embedded-book", "embedded-book", submodule; +diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs +index c0fa8c9..8fbc390 100644 +--- a/src/bootstrap/test.rs ++++ b/src/bootstrap/test.rs +@@ -1910,17 +1910,7 @@ impl Step for RustcGuide { + } + + fn run(self, builder: &Builder<'_>) { +- let relative_path = Path::new("src").join("doc").join("rustc-dev-guide"); +- builder.update_submodule(&relative_path); +- +- let src = builder.src.join(relative_path); +- let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook); +- let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)) { +- ToolState::TestPass +- } else { +- ToolState::TestFail +- }; +- builder.save_toolstate("rustc-dev-guide", toolstate); ++ builder.save_toolstate("rustc-dev-guide", ToolState::TestPass); + } + } + +diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml +index 1c875c3..1aad7cf 100644 +--- a/src/tools/clippy/Cargo.toml ++++ b/src/tools/clippy/Cargo.toml +@@ -36,11 +36,6 @@ walkdir = "2.3" + # This is used by the `collect-metadata` alias. + filetime = "0.2" + +-# A noop dependency that changes in the Rust repository, it's a bit of a hack. +-# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` +-# for more information. +-rustc-workspace-hack = "1.0" +- + # UI test dependencies + clippy_utils = { path = "clippy_utils" } + derive-new = "0.5" +diff --git a/src/tools/rustfmt/Cargo.toml b/src/tools/rustfmt/Cargo.toml +index 7a4e02d..27b91f2 100644 +--- a/src/tools/rustfmt/Cargo.toml ++++ b/src/tools/rustfmt/Cargo.toml +@@ -59,11 +59,6 @@ unicode_categories = "0.1" + + rustfmt-config_proc_macro = { version = "0.2", path = "config_proc_macro" } + +-# A noop dependency that changes in the Rust repository, it's a bit of a hack. +-# See the `src/tools/rustc-workspace-hack/README.md` file in `rust-lang/rust` +-# for more information. +-rustc-workspace-hack = "1.0.0" +- + # Rustc dependencies are loaded from the sysroot, Cargo doesn't know about them. + + [package.metadata.rust-analyzer] +diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs +index 333f85f..4df2b54 100644 +--- a/src/tools/tidy/src/deps.rs ++++ b/src/tools/tidy/src/deps.rs +@@ -306,7 +306,7 @@ const FORBIDDEN_TO_HAVE_DUPLICATES: &[&str] = &[ + // These two crates take quite a long time to build, so don't allow two versions of them + // to accidentally sneak into our dependency graph, in order to ensure we keep our CI times + // under control. +- "cargo", ++ //"cargo", + ]; + + /// Dependency checks. +diff --git a/src/tools/rust-analyzer/Cargo.toml b/src.tools/rust-analyzer/Cargo.toml +index 6b68ca82389..7bc5d1bc5a0 100644 +--- a/src/tools/rust-analyzer/Cargo.toml ++++ b/src/tools/rust-analyzer/Cargo.toml +@@ -1,5 +1,14 @@ + [workspace] +-members = ["xtask/", "lib/*", "crates/*"] ++members = [ ++ "xtask/", ++ "lib/*", ++ "crates/proc-macro-srv", ++ "crates/proc-macro-srv-cli", ++ "crates/tt", ++ "crates/mbe", ++ "crates/paths", ++ "crates/proc-macro-api", ++] + exclude = ["crates/proc-macro-test/imp"] + + [profile.dev] diff --git a/debian/patches/d-0001-pkg-config-no-special-snowflake.patch b/debian/patches/d-0001-pkg-config-no-special-snowflake.patch new file mode 100644 index 000000000..db66e2c34 --- /dev/null +++ b/debian/patches/d-0001-pkg-config-no-special-snowflake.patch @@ -0,0 +1,93 @@ +From: Debian Rust Maintainers +Date: Sat, 2 Oct 2021 01:08:00 +0100 +Subject: d-0001-pkg-config-no-special-snowflake + +--- + vendor/pkg-config/src/lib.rs | 25 ++++++++++--------------- + vendor/pkg-config/tests/test.rs | 2 -- + 2 files changed, 10 insertions(+), 17 deletions(-) + +diff --git a/vendor/pkg-config/src/lib.rs b/vendor/pkg-config/src/lib.rs +index a28304e..11f9460 100644 +--- a/vendor/pkg-config/src/lib.rs ++++ b/vendor/pkg-config/src/lib.rs +@@ -111,11 +111,8 @@ pub enum Error { + /// Contains the name of the responsible environment variable. + EnvNoPkgConfig(String), + +- /// Detected cross compilation without a custom sysroot. +- /// +- /// Ignore the error with `PKG_CONFIG_ALLOW_CROSS=1`, +- /// which may let `pkg-config` select libraries +- /// for the host's architecture instead of the target's. ++ /// Cross compilation detected. Kept for compatibility; ++ /// the Debian package never emits this. + CrossCompilation, + + /// Failed to run `pkg-config`. +@@ -155,14 +152,6 @@ impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + Error::EnvNoPkgConfig(ref name) => write!(f, "Aborted because {} is set", name), +- Error::CrossCompilation => f.write_str( +- "pkg-config has not been configured to support cross-compilation.\n\ +- \n\ +- Install a sysroot for the target platform and configure it via\n\ +- PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\n\ +- cross-compiling wrapper for pkg-config and set it via\n\ +- PKG_CONFIG environment variable.", +- ), + Error::Command { + ref command, + ref cause, +@@ -219,7 +208,7 @@ impl fmt::Display for Error { + )?; + format_output(output, f) + } +- Error::__Nonexhaustive => panic!(), ++ Error::CrossCompilation | Error::__Nonexhaustive => panic!(), + } + } + } +@@ -411,6 +400,8 @@ impl Config { + if host == target { + return true; + } ++ // always enable PKG_CONFIG_ALLOW_CROSS override in Debian ++ return true; + + // pkg-config may not be aware of cross-compilation, and require + // a wrapper script that sets up platform-specific prefixes. +@@ -470,7 +461,11 @@ impl Config { + fn command(&self, name: &str, args: &[&str]) -> Command { + let exe = self + .targetted_env_var("PKG_CONFIG") +- .unwrap_or_else(|| OsString::from("pkg-config")); ++ .unwrap_or_else(|| { ++ self.env_var_os("DEB_HOST_GNU_TYPE") ++ .map(|mut t| { t.push(OsString::from("-pkg-config")); t }) ++ .unwrap_or_else(|| OsString::from("pkg-config")) ++ }); + let mut cmd = Command::new(exe); + if self.is_static(name) { + cmd.arg("--static"); +diff --git a/vendor/pkg-config/tests/test.rs b/vendor/pkg-config/tests/test.rs +index 4e04ac0..f884e46 100644 +--- a/vendor/pkg-config/tests/test.rs ++++ b/vendor/pkg-config/tests/test.rs +@@ -34,7 +34,6 @@ fn find(name: &str) -> Result { + pkg_config::probe_library(name) + } + +-#[test] + fn cross_disabled() { + let _g = LOCK.lock(); + reset(); +@@ -46,7 +45,6 @@ fn cross_disabled() { + } + } + +-#[test] + fn cross_enabled() { + let _g = LOCK.lock(); + reset(); diff --git a/debian/patches/d-0002-mdbook-strip-embedded-libs.patch b/debian/patches/d-0002-mdbook-strip-embedded-libs.patch new file mode 100644 index 000000000..3916871a2 --- /dev/null +++ b/debian/patches/d-0002-mdbook-strip-embedded-libs.patch @@ -0,0 +1,420 @@ +From: Debian Rust Maintainers +Date: Sat, 2 Oct 2021 01:08:00 +0100 +Subject: d-0002-mdbook-strip-embedded-libs + +Comment: Use https://github.com/infinity0/mdBook/tree/debian to help you rebase the patch on top of a newer version. . Make sure the paths here match the ones in debian/rust-doc.links +--- + src/tools/linkchecker/main.rs | 28 ++++++- + vendor/mdbook/src/book/init.rs | 6 -- + .../src/renderer/html_handlebars/hbs_renderer.rs | 80 ++----------------- + .../mdbook/src/renderer/html_handlebars/search.rs | 2 - + vendor/mdbook/src/theme/index.hbs | 93 +--------------------- + vendor/mdbook/src/theme/mod.rs | 27 ------- + vendor/mdbook/src/theme/searcher/mod.rs | 2 - + 7 files changed, 35 insertions(+), 203 deletions(-) + +diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs +index a7c78d8..22927f8 100644 +--- a/src/tools/linkchecker/main.rs ++++ b/src/tools/linkchecker/main.rs +@@ -183,7 +183,17 @@ impl Checker { + for entry in t!(dir.read_dir()).map(|e| t!(e)) { + let path = entry.path(); + // Goes through symlinks +- let metadata = t!(fs::metadata(&path)); ++ let metadata = fs::metadata(&path); ++ if let Err(err) = metadata { ++ if let Ok(target) = fs::read_link(&path) { ++ if target.starts_with("/usr/share") { ++ // broken symlink to /usr/share, ok for our Debian build ++ return; ++ } ++ } ++ panic!("error at file {:?} while walking - {:?}", path, err) ++ } ++ let metadata = t!(metadata); + if metadata.is_dir() { + self.walk(&path, report); + } else { +@@ -196,7 +206,15 @@ impl Checker { + fn check(&mut self, file: &Path, report: &mut Report) { + let (pretty_path, entry) = self.load_file(file, report); + let source = match entry { +- FileEntry::Missing => panic!("missing file {:?} while walking", file), ++ FileEntry::Missing => { ++ if let Ok(target) = fs::read_link(&file) { ++ if target.starts_with("/usr/share") { ++ // broken symlink to /usr/share, ok for our Debian build ++ return; ++ } ++ } ++ panic!("missing file {:?} while walking", file) ++ } + FileEntry::Dir => unreachable!("never with `check` path"), + FileEntry::OtherFile => return, + FileEntry::Redirect { .. } => return, +@@ -261,6 +279,12 @@ impl Checker { + let (target_pretty_path, target_entry) = self.load_file(&path, report); + let (target_source, target_ids) = match target_entry { + FileEntry::Missing => { ++ if let Ok(target) = fs::read_link(&path) { ++ if target.starts_with("/usr/share") { ++ // broken symlink to /usr/share, ok for our Debian build ++ return; ++ } ++ } + if is_exception(file, &target_pretty_path) { + report.links_ignored_exception += 1; + } else { +diff --git a/vendor/mdbook/src/book/init.rs b/vendor/mdbook/src/book/init.rs +index 264c113..2b0ff3a 100644 +--- a/vendor/mdbook/src/book/init.rs ++++ b/vendor/mdbook/src/book/init.rs +@@ -151,12 +151,6 @@ impl BookBuilder { + let mut js = File::create(themedir.join("book.js"))?; + js.write_all(theme::JS)?; + +- let mut highlight_css = File::create(themedir.join("highlight.css"))?; +- highlight_css.write_all(theme::HIGHLIGHT_CSS)?; +- +- let mut highlight_js = File::create(themedir.join("highlight.js"))?; +- highlight_js.write_all(theme::HIGHLIGHT_JS)?; +- + Ok(()) + } + +diff --git a/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs b/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs +index b933a35..09b4a7a 100644 +--- a/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs ++++ b/vendor/mdbook/src/renderer/html_handlebars/hbs_renderer.rs +@@ -3,7 +3,7 @@ use crate::config::{BookConfig, Config, HtmlConfig, Playground, RustEdition}; + use crate::errors::*; + use crate::renderer::html_handlebars::helpers; + use crate::renderer::{RenderContext, Renderer}; +-use crate::theme::{self, playground_editor, Theme}; ++use crate::theme::{self, Theme}; + use crate::utils; + + use std::borrow::Cow; +@@ -11,6 +11,7 @@ use std::collections::BTreeMap; + use std::collections::HashMap; + use std::fs::{self, File}; + use std::path::{Path, PathBuf}; ++use std::os::unix::fs::symlink; + + use crate::utils::fs::get_404_output_file; + use handlebars::Handlebars; +@@ -232,80 +233,13 @@ impl HtmlHandlebars { + if let Some(contents) = &theme.favicon_svg { + write_file(destination, "favicon.svg", contents)?; + } +- write_file(destination, "highlight.css", &theme.highlight_css)?; + write_file(destination, "tomorrow-night.css", &theme.tomorrow_night_css)?; + write_file(destination, "ayu-highlight.css", &theme.ayu_highlight_css)?; +- write_file(destination, "highlight.js", &theme.highlight_js)?; +- write_file(destination, "clipboard.min.js", &theme.clipboard_js)?; +- write_file( +- destination, +- "FontAwesome/css/font-awesome.css", +- theme::FONT_AWESOME, +- )?; +- write_file( +- destination, +- "FontAwesome/fonts/fontawesome-webfont.eot", +- theme::FONT_AWESOME_EOT, +- )?; +- write_file( +- destination, +- "FontAwesome/fonts/fontawesome-webfont.svg", +- theme::FONT_AWESOME_SVG, +- )?; +- write_file( +- destination, +- "FontAwesome/fonts/fontawesome-webfont.ttf", +- theme::FONT_AWESOME_TTF, +- )?; +- write_file( +- destination, +- "FontAwesome/fonts/fontawesome-webfont.woff", +- theme::FONT_AWESOME_WOFF, +- )?; +- write_file( +- destination, +- "FontAwesome/fonts/fontawesome-webfont.woff2", +- theme::FONT_AWESOME_WOFF2, +- )?; +- write_file( +- destination, +- "FontAwesome/fonts/FontAwesome.ttf", +- theme::FONT_AWESOME_TTF, +- )?; +- if html_config.copy_fonts { +- write_file(destination, "fonts/fonts.css", theme::fonts::CSS)?; +- for (file_name, contents) in theme::fonts::LICENSES.iter() { +- write_file(destination, file_name, contents)?; +- } +- for (file_name, contents) in theme::fonts::OPEN_SANS.iter() { +- write_file(destination, file_name, contents)?; +- } +- write_file( +- destination, +- theme::fonts::SOURCE_CODE_PRO.0, +- theme::fonts::SOURCE_CODE_PRO.1, +- )?; +- } +- +- let playground_config = &html_config.playground; +- +- // Ace is a very large dependency, so only load it when requested +- if playground_config.editable && playground_config.copy_js { +- // Load the editor +- write_file(destination, "editor.js", playground_editor::JS)?; +- write_file(destination, "ace.js", playground_editor::ACE_JS)?; +- write_file(destination, "mode-rust.js", playground_editor::MODE_RUST_JS)?; +- write_file( +- destination, +- "theme-dawn.js", +- playground_editor::THEME_DAWN_JS, +- )?; +- write_file( +- destination, +- "theme-tomorrow_night.js", +- playground_editor::THEME_TOMORROW_NIGHT_JS, +- )?; +- } ++ symlink("/usr/share/fonts-font-awesome/css/font-awesome.min.css", destination.join("css/font-awesome.min.css"))?; ++ symlink("/usr/share/fonts-font-awesome/fonts", destination.join("fonts"))?; ++ symlink("/usr/share/javascript/highlight.js/styles/atelier-dune-light.css", destination.join("highlight.css"))?; ++ symlink("/usr/share/javascript/highlight.js/highlight.js", destination.join("highlight.js"))?; ++ symlink("/usr/share/javascript/mathjax/MathJax.js", destination.join("MathJax.js"))?; + + Ok(()) + } +diff --git a/vendor/mdbook/src/renderer/html_handlebars/search.rs b/vendor/mdbook/src/renderer/html_handlebars/search.rs +index c3b944c..d4bbe35 100644 +--- a/vendor/mdbook/src/renderer/html_handlebars/search.rs ++++ b/vendor/mdbook/src/renderer/html_handlebars/search.rs +@@ -52,8 +52,6 @@ pub fn create_files(search_config: &Search, destination: &Path, book: &Book) -> + format!("Object.assign(window.search, {});", index).as_bytes(), + )?; + utils::fs::write_file(destination, "searcher.js", searcher::JS)?; +- utils::fs::write_file(destination, "mark.min.js", searcher::MARK_JS)?; +- utils::fs::write_file(destination, "elasticlunr.min.js", searcher::ELASTICLUNR_JS)?; + debug!("Copying search files ✓"); + } + +diff --git a/vendor/mdbook/src/theme/index.hbs b/vendor/mdbook/src/theme/index.hbs +index 18d984a..4a0e2d1 100644 +--- a/vendor/mdbook/src/theme/index.hbs ++++ b/vendor/mdbook/src/theme/index.hbs +@@ -34,10 +34,7 @@ + {{/if}} + + +- +- {{#if copy_fonts}} +- +- {{/if}} ++ + + + +@@ -51,7 +48,7 @@ + + {{#if mathjax_support}} + +- ++ + {{/if}} + + +@@ -61,46 +58,6 @@ + var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "{{ preferred_dark_theme }}" : "{{ default_theme }}"; + + +- +- +- +- +- +- +- +- +- +