summaryrefslogtreecommitdiffstats
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0003-tests-add-missing-cross-disabled-checks.patch43
-rw-r--r--debian/patches/0004-test-loose-overly-matches-for-git-cli-output.patch43
-rw-r--r--debian/patches/1000-riscv64-skip-split-debuginfo-test.patch19
-rw-r--r--debian/patches/2000-fix-test-stderr.patch12
-rw-r--r--debian/patches/2002_disable-net-tests.patch615
-rw-r--r--debian/patches/2003-workaround-qemu-vfork-command-not-found.patch19
-rw-r--r--debian/patches/2200-workaround-x32-test.patch15
-rw-r--r--debian/patches/README3
-rw-r--r--debian/patches/disable-fs-specific-test.patch13
-rw-r--r--debian/patches/series11
-rw-r--r--debian/patches/update-libgit2.patch37
11 files changed, 830 insertions, 0 deletions
diff --git a/debian/patches/0003-tests-add-missing-cross-disabled-checks.patch b/debian/patches/0003-tests-add-missing-cross-disabled-checks.patch
new file mode 100644
index 0000000..8a6f569
--- /dev/null
+++ b/debian/patches/0003-tests-add-missing-cross-disabled-checks.patch
@@ -0,0 +1,43 @@
+From 981279ccd8f7855faaed010bff0891afff588210 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?=
+ <debian@fabian.gruenbichler.email>
+Date: Sat, 19 Nov 2022 10:24:08 +0100
+Subject: [PATCH] tests: add missing cross disabled checks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+cross_conmpile::alternate states it should only be used in test cases
+after checking cross_compile::disabled(), which is missing here. these
+tests fail despite setting CFG_DISABLE_CROSS_TESTS on i386, since both
+the host and the alternate cross target would be i686 in that case.
+
+Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
+---
+ tests/testsuite/build_script.rs | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+Index: cargo/tests/testsuite/build_script.rs
+===================================================================
+--- cargo.orig/tests/testsuite/build_script.rs
++++ cargo/tests/testsuite/build_script.rs
+@@ -697,6 +697,9 @@ fn custom_build_linker_bad_host_with_arc
+ #[cargo_test]
+ fn custom_build_env_var_rustc_linker_cross_arch_host() {
+ let target = rustc_host();
++ if cross_compile::disabled() {
++ return;
++ }
+ let cross_target = cross_compile::alternate();
+ let p = project()
+ .file(
+@@ -735,6 +738,9 @@ fn custom_build_env_var_rustc_linker_cro
+ #[cargo_test]
+ fn custom_build_linker_bad_cross_arch_host() {
+ let target = rustc_host();
++ if cross_compile::disabled() {
++ return;
++ }
+ let cross_target = cross_compile::alternate();
+ let p = project()
+ .file(
diff --git a/debian/patches/0004-test-loose-overly-matches-for-git-cli-output.patch b/debian/patches/0004-test-loose-overly-matches-for-git-cli-output.patch
new file mode 100644
index 0000000..0fd6248
--- /dev/null
+++ b/debian/patches/0004-test-loose-overly-matches-for-git-cli-output.patch
@@ -0,0 +1,43 @@
+From 51ebba2fc1c581e4ec30b308c07f7b70ef3d2f10 Mon Sep 17 00:00:00 2001
+From: Weihang Lo <me@weihanglo.tw>
+Date: Wed, 7 Jun 2023 22:47:25 +0100
+Subject: [PATCH] test: loose overly matches for git cli output
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The output format should be stable I believe, but it turns out not.
+This is how `git fetch` man page says [1]:
+
+```
+<flag> <summary> <from> -> <to> [<reason>]
+```
+
+In Git 2.41 they've changed the fetch output a bit [2].
+
+I think let's just loose it to prevent future breakages.
+
+[1]: https://git-scm.com/docs/git-fetch#_output
+[2]: https://github.blog/2023-06-01-highlights-from-git-2-41/
+
+Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
+---
+ tests/testsuite/git.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/testsuite/git.rs b/tests/testsuite/git.rs
+index 091192037..7c717e967 100644
+--- a/tests/testsuite/git.rs
++++ b/tests/testsuite/git.rs
+@@ -2711,7 +2711,7 @@ fn use_the_cli() {
+ [UPDATING] git repository `[..]`
+ [RUNNING] `git fetch [..]`
+ From [..]
+- * [new ref] -> origin/HEAD
++ * [new ref] [..] -> origin/HEAD[..]
+ [CHECKING] dep1 [..]
+ [RUNNING] `rustc [..]`
+ [CHECKING] foo [..]
+--
+2.39.2
+
diff --git a/debian/patches/1000-riscv64-skip-split-debuginfo-test.patch b/debian/patches/1000-riscv64-skip-split-debuginfo-test.patch
new file mode 100644
index 0000000..68fd43d
--- /dev/null
+++ b/debian/patches/1000-riscv64-skip-split-debuginfo-test.patch
@@ -0,0 +1,19 @@
+Subject: riscv64 skip split debuginfo test
+Author: Fabian Grünbichler <debian@fabian.gruenbichler.email>
+
+See corresponding rustc change for details.
+
+diff --git a/tests/testsuite/build.rs.orig b/tests/testsuite/build.rs
+index 56130c6..369a3e9 100644
+--- a/tests/testsuite/build.rs.orig
++++ b/tests/testsuite/build.rs
+@@ -5313,7 +5313,7 @@ fn uplift_pdb_of_bin_on_windows() {
+ }
+
+ #[cargo_test]
+-#[cfg(target_os = "linux")]
++#[cfg(all(target_os = "linux", target_arch = "riscv"))]
+ fn uplift_dwp_of_bin_on_linux() {
+ let p = project()
+ .file("src/main.rs", "fn main() { panic!(); }")
+
diff --git a/debian/patches/2000-fix-test-stderr.patch b/debian/patches/2000-fix-test-stderr.patch
new file mode 100644
index 0000000..add1ab7
--- /dev/null
+++ b/debian/patches/2000-fix-test-stderr.patch
@@ -0,0 +1,12 @@
+Index: cargo/tests/testsuite/build_script.rs
+===================================================================
+--- cargo.orig/tests/testsuite/build_script.rs
++++ cargo/tests/testsuite/build_script.rs
+@@ -33,6 +33,7 @@ fn custom_build_script_failed() {
+ .file("build.rs", "fn main() { std::process::exit(101); }")
+ .build();
+ p.cargo("build -v")
++ .env("RUST_BACKTRACE", "0")
+ .with_status(101)
+ .with_stderr(
+ "\
diff --git a/debian/patches/2002_disable-net-tests.patch b/debian/patches/2002_disable-net-tests.patch
new file mode 100644
index 0000000..3623165
--- /dev/null
+++ b/debian/patches/2002_disable-net-tests.patch
@@ -0,0 +1,615 @@
+Description: Disable network tests
+Author: Ximin Luo <infinity0@debian.org>
+Forwarded: TODO
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: cargo/tests/testsuite/git_auth.rs
+===================================================================
+--- cargo.orig/tests/testsuite/git_auth.rs
++++ cargo/tests/testsuite/git_auth.rs
+@@ -102,7 +102,7 @@ fn setup_failed_auth_test() -> (SocketAd
+ }
+
+ // Tests that HTTP auth is offered from `credential.helper`.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn http_auth_offered() {
+ let (addr, t, connections) = setup_failed_auth_test();
+ let p = project()
+@@ -167,7 +167,7 @@ Caused by:
+ }
+
+ // Boy, sure would be nice to have a TLS implementation in rust!
+-#[cargo_test]
++#[allow(dead_code)]
+ fn https_something_happens() {
+ let server = TcpListener::bind("127.0.0.1:0").unwrap();
+ let addr = server.local_addr().unwrap();
+Index: cargo/tests/testsuite/net_config.rs
+===================================================================
+--- cargo.orig/tests/testsuite/net_config.rs
++++ cargo/tests/testsuite/net_config.rs
+@@ -2,7 +2,7 @@
+
+ use cargo_test_support::project;
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn net_retry_loads_from_config() {
+ let p = project()
+ .file(
+@@ -38,7 +38,7 @@ fn net_retry_loads_from_config() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn net_retry_git_outputs_warning() {
+ let p = project()
+ .file(
+Index: cargo/tests/testsuite/publish.rs
+===================================================================
+--- cargo.orig/tests/testsuite/publish.rs
++++ cargo/tests/testsuite/publish.rs
+@@ -85,7 +85,7 @@ fn validate_upload_li() {
+ );
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn simple() {
+ let registry = RegistryBuilder::new().http_api().http_index().build();
+
+@@ -124,7 +124,7 @@ See [..]
+
+ // Check that the `token` key works at the root instead of under a
+ // `[registry]` table.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn simple_publish_with_http() {
+ let _reg = registry::RegistryBuilder::new()
+ .http_api()
+@@ -161,7 +161,7 @@ See [..]
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn simple_publish_with_asymmetric() {
+ let _reg = registry::RegistryBuilder::new()
+ .http_api()
+@@ -201,7 +201,7 @@ See [..]
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn old_token_location() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -255,7 +255,7 @@ See [..]
+ // Other tests will verify the endpoint gets the right payload.
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn simple_with_index() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -297,7 +297,7 @@ fn simple_with_index() {
+ // Other tests will verify the endpoint gets the right payload.
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn git_deps() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -335,7 +335,7 @@ the `git` specification will be removed
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn path_dependency_no_version() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -375,7 +375,7 @@ the `path` specification will be removed
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn unpublishable_crate() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -408,7 +408,7 @@ fn unpublishable_crate() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn dont_publish_dirty() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -450,7 +450,7 @@ to proceed despite this and include the
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_clean() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -495,7 +495,7 @@ fn publish_clean() {
+ // Other tests will verify the endpoint gets the right payload.
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_in_sub_repo() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -541,7 +541,7 @@ fn publish_in_sub_repo() {
+ // Other tests will verify the endpoint gets the right payload.
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_when_ignored() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -587,7 +587,7 @@ fn publish_when_ignored() {
+ // Other tests will verify the endpoint gets the right payload.
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn ignore_when_crate_ignored() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -632,7 +632,7 @@ fn ignore_when_crate_ignored() {
+ // Other tests will verify the endpoint gets the right payload.
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn new_crate_rejected() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -665,7 +665,7 @@ fn new_crate_rejected() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn dry_run() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -708,7 +708,7 @@ See [..]
+ assert!(!registry::api_path().join("api/v1/crates/new").exists());
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn registry_not_in_publish_list() {
+ let p = project()
+ .file(
+@@ -741,7 +741,7 @@ The registry `alternative` is not listed
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_empty_list() {
+ let p = project()
+ .file(
+@@ -770,7 +770,7 @@ fn publish_empty_list() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_allowed_registry() {
+ let _registry = RegistryBuilder::new()
+ .http_api()
+@@ -827,7 +827,7 @@ fn publish_allowed_registry() {
+ );
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_implicitly_to_only_allowed_registry() {
+ let _registry = RegistryBuilder::new()
+ .http_api()
+@@ -885,7 +885,7 @@ fn publish_implicitly_to_only_allowed_re
+ );
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_fail_with_no_registry_specified() {
+ let p = project().build();
+
+@@ -919,7 +919,7 @@ The registry `crates-io` is not listed i
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn block_publish_no_registry() {
+ let p = project()
+ .file(
+@@ -949,7 +949,7 @@ fn block_publish_no_registry() {
+ }
+
+ // Explicitly setting `crates-io` in the publish list.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_with_crates_io_explicit() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -999,7 +999,7 @@ The registry `alternative` is not listed
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_with_select_features() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -1047,7 +1047,7 @@ fn publish_with_select_features() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_with_all_features() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -1095,7 +1095,7 @@ fn publish_with_all_features() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_with_no_default_features() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -1131,7 +1131,7 @@ fn publish_with_no_default_features() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_with_patch() {
+ let registry = RegistryBuilder::new().http_api().http_index().build();
+ Package::new("bar", "1.0.0").publish();
+@@ -1233,7 +1233,7 @@ fn publish_with_patch() {
+ );
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_checks_for_token_before_verify() {
+ let registry = registry::RegistryBuilder::new()
+ .no_configure_token()
+@@ -1282,7 +1282,7 @@ fn publish_checks_for_token_before_verif
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_with_bad_source() {
+ let p = project()
+ .file(
+@@ -1331,7 +1331,7 @@ include `--registry crates-io` to use cr
+ }
+
+ // A dependency with both `git` and `version`.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_git_with_version() {
+ let registry = RegistryBuilder::new().http_api().http_index().build();
+
+@@ -1471,7 +1471,7 @@ fn publish_git_with_version() {
+ );
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_dev_dep_no_version() {
+ let registry = RegistryBuilder::new().http_api().http_index().build();
+
+@@ -1557,7 +1557,7 @@ repository = "foo"
+ );
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn credentials_ambiguous_filename() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -1610,7 +1610,7 @@ fn credentials_ambiguous_filename() {
+
+ // --index will not load registry.token to avoid possibly leaking
+ // crates.io token to another server.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn index_requires_token() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -1645,7 +1645,7 @@ fn index_requires_token() {
+ }
+
+ // publish with source replacement without --registry
+-#[cargo_test]
++#[allow(dead_code)]
+ fn cratesio_source_replacement() {
+ registry::init();
+ let p = project()
+@@ -1674,7 +1674,7 @@ include `--registry dummy-registry` or `
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish_with_missing_readme() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -1719,7 +1719,7 @@ Caused by:
+ }
+
+ // Registry returns an API error.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn api_error_json() {
+ let _registry = registry::RegistryBuilder::new()
+ .alternative()
+@@ -1767,7 +1767,7 @@ Caused by:
+ }
+
+ // Registry returns an API error with a 200 status code.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn api_error_200() {
+ let _registry = registry::RegistryBuilder::new()
+ .alternative()
+@@ -1815,7 +1815,7 @@ Caused by:
+ }
+
+ // Registry returns an error code without a JSON message.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn api_error_code() {
+ let _registry = registry::RegistryBuilder::new()
+ .alternative()
+@@ -1869,7 +1869,7 @@ Caused by:
+ }
+
+ // Registry has a network error.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn api_curl_error() {
+ let _registry = registry::RegistryBuilder::new()
+ .alternative()
+@@ -1919,7 +1919,7 @@ Caused by:
+ }
+
+ // Registry returns an invalid response.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn api_other_error() {
+ let _registry = registry::RegistryBuilder::new()
+ .alternative()
+@@ -1969,7 +1969,7 @@ Caused by:
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn in_package_workspace() {
+ let registry = RegistryBuilder::new().http_api().http_index().build();
+
+@@ -2017,7 +2017,7 @@ See [..]
+ validate_upload_li();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn with_duplicate_spec_in_members() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -2069,7 +2069,7 @@ fn with_duplicate_spec_in_members() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn in_package_workspace_with_members_with_features_old() {
+ let registry = RegistryBuilder::new().http_api().http_index().build();
+
+@@ -2116,7 +2116,7 @@ See [..]
+ validate_upload_li();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn in_virtual_workspace() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -2152,7 +2152,7 @@ fn in_virtual_workspace() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn in_virtual_workspace_with_p() {
+ // `publish` generally requires a remote registry
+ let registry = registry::RegistryBuilder::new().http_api().build();
+@@ -2206,7 +2206,7 @@ See [..]
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn in_package_workspace_not_found() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -2251,7 +2251,7 @@ error: package ID specification `li` did
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn in_package_workspace_found_multiple() {
+ // Use local registry for faster test times since no publish will occur
+ let registry = registry::init();
+@@ -2308,7 +2308,7 @@ error: the `-p` argument must be specifi
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ // https://github.com/rust-lang/cargo/issues/10536
+ fn publish_path_dependency_without_workspace() {
+ // Use local registry for faster test times since no publish will occur
+@@ -2355,7 +2355,7 @@ error: package ID specification `bar` di
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn http_api_not_noop() {
+ let registry = registry::RegistryBuilder::new().http_api().build();
+
+@@ -2413,7 +2413,7 @@ fn http_api_not_noop() {
+ p.cargo("build").run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn wait_for_first_publish() {
+ // Counter for number of tries before the package is "published"
+ let arc: Arc<Mutex<u32>> = Arc::new(Mutex::new(0));
+@@ -2493,7 +2493,7 @@ See [..]
+ /// A separate test is needed for package names with - or _ as they hit
+ /// the responder twice per cargo invocation. If that ever gets changed
+ /// this test will need to be changed accordingly.
+-#[cargo_test]
++#[allow(dead_code)]
+ fn wait_for_first_publish_underscore() {
+ // Counter for number of tries before the package is "published"
+ let arc: Arc<Mutex<u32>> = Arc::new(Mutex::new(0));
+@@ -2570,7 +2570,7 @@ See [..]
+ p.cargo("build").with_status(0).run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn wait_for_subsequent_publish() {
+ // Counter for number of tries before the package is "published"
+ let arc: Arc<Mutex<u32>> = Arc::new(Mutex::new(0));
+@@ -2660,7 +2660,7 @@ See [..]
+ p.cargo("build").with_status(0).run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn skip_wait_for_publish() {
+ // Intentionally using local registry so the crate never makes it to the index
+ let registry = registry::init();
+Index: cargo/tests/testsuite/credential_process.rs
+===================================================================
+--- cargo.orig/tests/testsuite/credential_process.rs
++++ cargo/tests/testsuite/credential_process.rs
+@@ -8,7 +8,7 @@ fn toml_bin(proj: &Project, name: &str)
+ proj.bin(name).display().to_string().replace('\\', "\\\\")
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn gated() {
+ let _alternative = registry::RegistryBuilder::new()
+ .alternative()
+@@ -65,7 +65,7 @@ or use environment variable CARGO_REGIST
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn warn_both_token_and_process() {
+ // Specifying both credential-process and a token in config should issue a warning.
+ let _server = registry::RegistryBuilder::new()
+@@ -209,7 +209,7 @@ fn get_token_test() -> (Project, TestReg
+ (p, server)
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn publish() {
+ // Checks that credential-process is used for `cargo publish`.
+ let (p, _t) = get_token_test();
+@@ -231,7 +231,7 @@ fn publish() {
+ assert_eq!(calls, 1);
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn basic_unsupported() {
+ // Non-action commands don't support login/logout.
+ let registry = registry::RegistryBuilder::new()
+@@ -274,7 +274,7 @@ the credential-process configuration val
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn login() {
+ let server = registry::RegistryBuilder::new()
+ .no_configure_token()
+@@ -331,7 +331,7 @@ fn login() {
+ );
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn logout() {
+ let server = registry::RegistryBuilder::new()
+ .no_configure_token()
+@@ -386,7 +386,7 @@ token for `crates-io` has been erased!
+ );
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn yank() {
+ let (p, _t) = get_token_test();
+
+@@ -401,7 +401,7 @@ fn yank() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn owner() {
+ let (p, _t) = get_token_test();
+
+@@ -416,7 +416,7 @@ fn owner() {
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn libexec_path() {
+ // cargo: prefixed names use the sysroot
+ let server = registry::RegistryBuilder::new()
+@@ -450,7 +450,7 @@ Caused by:
+ .run();
+ }
+
+-#[cargo_test]
++#[allow(dead_code)]
+ fn invalid_token_output() {
+ // Error when credential process does not output the expected format for a token.
+ let _server = registry::RegistryBuilder::new()
diff --git a/debian/patches/2003-workaround-qemu-vfork-command-not-found.patch b/debian/patches/2003-workaround-qemu-vfork-command-not-found.patch
new file mode 100644
index 0000000..d7f6424
--- /dev/null
+++ b/debian/patches/2003-workaround-qemu-vfork-command-not-found.patch
@@ -0,0 +1,19 @@
+Index: cargo/crates/cargo-test-macro/src/lib.rs
+===================================================================
+--- cargo.orig/crates/cargo-test-macro/src/lib.rs
++++ cargo/crates/cargo-test-macro/src/lib.rs
+@@ -223,6 +223,14 @@ fn has_command(command: &str) -> bool {
+ }
+ };
+ if !output.status.success() {
++ // Debian specific patch, upstream wontfix:
++ // qemu has a faulty vfork where it fails to fail if a command is not
++ // found, with a unix_wait_status of 32512, or 0x7f00, 7f meaning
++ // exit code 127. See https://github.com/rust-lang/rust/issues/90825
++ use std::os::unix::process::ExitStatusExt;
++ if output.status.into_raw() == 0x7f00 {
++ return false;
++ }
+ panic!(
+ "expected command `{}` to be runnable, got error {}:\n\
+ stderr:{}\n\
diff --git a/debian/patches/2200-workaround-x32-test.patch b/debian/patches/2200-workaround-x32-test.patch
new file mode 100644
index 0000000..82937b2
--- /dev/null
+++ b/debian/patches/2200-workaround-x32-test.patch
@@ -0,0 +1,15 @@
+Bug: https://github.com/rust-lang/cargo/issues/10005
+
+Index: cargo/tests/testsuite/cfg.rs
+===================================================================
+--- cargo.orig/tests/testsuite/cfg.rs
++++ cargo/tests/testsuite/cfg.rs
+@@ -272,7 +272,7 @@ fn any_ok() {
+
+ // https://github.com/rust-lang/cargo/issues/5313
+ #[cargo_test]
+-#[cfg(all(target_arch = "x86_64", target_os = "linux", target_env = "gnu"))]
++#[cfg(all(target_arch = "x86_64", target_os = "linux", target_env = "gnu", target_pointer_width = "64"))]
+ fn cfg_looks_at_rustflags_for_target() {
+ let p = project()
+ .file(
diff --git a/debian/patches/README b/debian/patches/README
new file mode 100644
index 0000000..80c1584
--- /dev/null
+++ b/debian/patches/README
@@ -0,0 +1,3 @@
+0xxx: Grabbed from upstream development.
+1xxx: Possibly relevant for upstream adoption.
+2xxx: Only relevant for official Debian release.
diff --git a/debian/patches/disable-fs-specific-test.patch b/debian/patches/disable-fs-specific-test.patch
new file mode 100644
index 0000000..518665b
--- /dev/null
+++ b/debian/patches/disable-fs-specific-test.patch
@@ -0,0 +1,13 @@
+Index: cargo/tests/testsuite/metadata.rs
+===================================================================
+--- cargo.orig/tests/testsuite/metadata.rs
++++ cargo/tests/testsuite/metadata.rs
+@@ -3935,7 +3935,7 @@ fn dep_kinds_workspace() {
+ // Creating non-utf8 path is an OS-specific pain, so let's run this only on
+ // linux, where arbitrary bytes work.
+ #[cfg(target_os = "linux")]
+-#[cargo_test]
++#[allow(dead_code)]
+ fn cargo_metadata_non_utf8() {
+ use std::ffi::OsString;
+ use std::os::unix::ffi::OsStringExt;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..501cb5f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,11 @@
+2002_disable-net-tests.patch
+2003-workaround-qemu-vfork-command-not-found.patch
+
+2200-workaround-x32-test.patch
+disable-fs-specific-test.patch
+0003-tests-add-missing-cross-disabled-checks.patch
+2000-fix-test-stderr.patch
+0004-test-loose-overly-matches-for-git-cli-output.patch
+
+update-libgit2.patch
+1000-riscv64-skip-split-debuginfo-test.patch
diff --git a/debian/patches/update-libgit2.patch b/debian/patches/update-libgit2.patch
new file mode 100644
index 0000000..499de6a
--- /dev/null
+++ b/debian/patches/update-libgit2.patch
@@ -0,0 +1,37 @@
+Index: cargo/Cargo.toml
+===================================================================
+--- cargo.orig/Cargo.toml
++++ cargo/Cargo.toml
+@@ -28,8 +28,8 @@ curl-sys = "0.4.59"
+ env_logger = "0.10.0"
+ filetime = "0.2.9"
+ flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] }
+-git2 = "0.16.0"
+-git2-curl = "0.17.0"
++git2 = "0.18.0"
++git2-curl = "0.19.0"
+ glob = "0.3.0"
+ hex = "0.4"
+ hmac = "0.12.1"
+@@ -47,7 +47,7 @@ lazycell = "1.2.0"
+ libc = "0.2"
+ # Temporarily pin libgit2-sys due to some issues with SSH not working on
+ # Windows.
+-libgit2-sys = "=0.14.1"
++libgit2-sys = "0.16.1"
+ log = "0.4.6"
+ memchr = "2.1.3"
+ opener = "0.5"
+Index: cargo/crates/cargo-test-support/Cargo.toml
+===================================================================
+--- cargo.orig/crates/cargo-test-support/Cargo.toml
++++ cargo/crates/cargo-test-support/Cargo.toml
+@@ -14,7 +14,7 @@ cargo-util = { path = "../cargo-util" }
+ crates-io = { path = "../crates-io" }
+ filetime = "0.2"
+ flate2 = { version = "1.0", default-features = false, features = ["zlib"] }
+-git2 = "0.16.0"
++git2 = "0.18.0"
+ glob = "0.3"
+ itertools = "0.10.0"
+ lazy_static = "1.0"