diff --git a/pkgs/by-name/de/deno/package.nix b/pkgs/by-name/de/deno/package.nix index 5ece4a05954e..c3abdb168673 100644 --- a/pkgs/by-name/de/deno/package.nix +++ b/pkgs/by-name/de/deno/package.nix @@ -43,9 +43,17 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-ZEWSnath9v04wU1VyFDAx3LANnVhfE5s93jX4QW3XlI="; patches = [ - ./tests-replace-hardcoded-paths.patch - ./tests-darwin-differences.patch - ./tests-no-chown.patch + # Patch out the remote upgrade (deno update) check. + # Not a blocker in the build sandbox, since implementation and tests are + # considerately written for no external networking, but removing brings + # in-line with common nixpkgs practice. + ./patches/0000-remove-deno-upgrade-check.patch + # Patch out the upgrade sub-command since that wouldn't correctly upgrade + # deno from nixpkgs. + ./patches/0001-remove-deno-upgrade.patch + ./patches/0002-tests-replace-hardcoded-paths.patch + ./patches/0003-tests-linux-no-chown.patch + ./patches/0004-tests-darwin-fixes.patch ]; postPatch = '' diff --git a/pkgs/by-name/de/deno/patches/0000-remove-deno-upgrade-check.patch b/pkgs/by-name/de/deno/patches/0000-remove-deno-upgrade-check.patch new file mode 100644 index 000000000000..48e95530ca5c --- /dev/null +++ b/pkgs/by-name/de/deno/patches/0000-remove-deno-upgrade-check.patch @@ -0,0 +1,41 @@ + +diff --git a/cli/tools/upgrade.rs b/cli/tools/upgrade.rs +index 3f4bcc8c7..74d5805a3 100644 +--- a/cli/tools/upgrade.rs ++++ b/cli/tools/upgrade.rs +@@ -310,10 +310,7 @@ async fn print_release_notes( + } + + pub fn upgrade_check_enabled() -> bool { +- matches!( +- env::var("DENO_NO_UPDATE_CHECK"), +- Err(env::VarError::NotPresent) +- ) ++ false + } + + pub fn check_for_upgrades( +diff --git a/cli/args/flags.rs b/cli/args/flags.rs +index e1bc861e4..612599c4c 100644 +--- a/cli/args/flags.rs ++++ b/cli/args/flags.rs +@@ -1283,7 +1283,6 @@ static ENV_VARIABLES_HELP: &str = cstr!( + database. + DENO_EMIT_CACHE_MODE Control if the transpiled sources should be cached. + DENO_NO_PACKAGE_JSON Disables auto-resolution of package.json +- DENO_NO_UPDATE_CHECK Set to disable checking if a newer Deno version is available + DENO_SERVE_ADDRESS Override address for Deno.serve + Example: "tcp:0.0.0.0:8080", "unix:/tmp/deno.sock", or "vsock:1234:5678" + DENO_AUTO_SERVE If the entrypoint contains export default { fetch }, `deno run` +diff --git a/tests/integration/upgrade_tests.rs b/tests/integration/upgrade_tests.rs +index b342c17f7..1f54292f0 100644 +--- a/tests/integration/upgrade_tests.rs ++++ b/tests/integration/upgrade_tests.rs +@@ -43,6 +43,7 @@ fn upgrade_invalid_lockfile() { + ); + } + ++#[ignore] + #[flaky_test::flaky_test] + fn upgrade_prompt() { + let context = upgrade_context(); diff --git a/pkgs/by-name/de/deno/patches/0001-remove-deno-upgrade.patch b/pkgs/by-name/de/deno/patches/0001-remove-deno-upgrade.patch new file mode 100644 index 000000000000..fa67e84b79de --- /dev/null +++ b/pkgs/by-name/de/deno/patches/0001-remove-deno-upgrade.patch @@ -0,0 +1,73 @@ +diff --git a/cli/args/flags.rs b/cli/args/flags.rs +index e1bc861e4..05f070563 100644 +--- a/cli/args/flags.rs ++++ b/cli/args/flags.rs +@@ -1349,8 +1349,6 @@ static DENO_HELP: &str = cstr!( + test Run tests + deno test | deno test test.ts + publish Publish the current working directory's package or workspace +- upgrade Upgrade deno executable to given version +- deno upgrade | deno upgrade 1.45.0 | deno upgrade canary + {after-help} + + Docs: https://docs.deno.com +@@ -1536,7 +1534,6 @@ pub fn flags_from_vec(args: Vec) -> clap::error::Result { + "types" => types_parse(&mut flags, &mut m), + "uninstall" => uninstall_parse(&mut flags, &mut m), + "update" => outdated_parse(&mut flags, &mut m, true)?, +- "upgrade" => upgrade_parse(&mut flags, &mut m), + "vendor" => vendor_parse(&mut flags, &mut m), + "publish" => publish_parse(&mut flags, &mut m)?, + _ => unreachable!(), +@@ -1797,7 +1794,6 @@ pub fn clap_root() -> Command { + .subcommand(test_subcommand()) + .subcommand(types_subcommand()) + .subcommand(update_subcommand()) +- .subcommand(upgrade_subcommand()) + .subcommand(vendor_subcommand()); + + let help = help_subcommand(&cmd); +@@ -6644,6 +6640,7 @@ mod tests { + assert_eq!(flags2, flags); + } + ++ #[ignore] + #[test] + fn upgrade() { + let r = flags_from_vec(svec!["deno", "upgrade", "--dry-run", "--force"]); +@@ -6665,6 +6662,7 @@ mod tests { + ); + } + ++ #[ignore] + #[test] + fn upgrade_with_output_flag() { + let r = flags_from_vec(svec!["deno", "upgrade", "--output", "example.txt"]); +@@ -10599,6 +10597,7 @@ mod tests { + ); + } + ++ #[ignore] + #[test] + fn upgrade_with_ca_file() { + let r = flags_from_vec(svec!["deno", "upgrade", "--cert", "example.crt"]); +@@ -10620,6 +10619,7 @@ mod tests { + ); + } + ++ #[ignore] + #[test] + fn upgrade_release_candidate() { + let r = flags_from_vec(svec!["deno", "upgrade", "--rc"]); +diff --git a/tests/integration/upgrade_tests.rs b/tests/integration/upgrade_tests.rs +index b342c17f7..a6c2aafc6 100644 +--- a/tests/integration/upgrade_tests.rs ++++ b/tests/integration/upgrade_tests.rs +@@ -9,6 +9,7 @@ use test_util::TestContext; + use test_util::assert_starts_with; + use util::TestContextBuilder; + ++#[ignore] + #[flaky_test::flaky_test] + fn upgrade_invalid_lockfile() { + let context = upgrade_context(); diff --git a/pkgs/by-name/de/deno/tests-replace-hardcoded-paths.patch b/pkgs/by-name/de/deno/patches/0002-tests-replace-hardcoded-paths.patch similarity index 100% rename from pkgs/by-name/de/deno/tests-replace-hardcoded-paths.patch rename to pkgs/by-name/de/deno/patches/0002-tests-replace-hardcoded-paths.patch diff --git a/pkgs/by-name/de/deno/tests-no-chown.patch b/pkgs/by-name/de/deno/patches/0003-tests-linux-no-chown.patch similarity index 100% rename from pkgs/by-name/de/deno/tests-no-chown.patch rename to pkgs/by-name/de/deno/patches/0003-tests-linux-no-chown.patch diff --git a/pkgs/by-name/de/deno/tests-darwin-differences.patch b/pkgs/by-name/de/deno/patches/0004-tests-darwin-fixes.patch similarity index 100% rename from pkgs/by-name/de/deno/tests-darwin-differences.patch rename to pkgs/by-name/de/deno/patches/0004-tests-darwin-fixes.patch