summaryrefslogtreecommitdiff
path: root/cli/tools/upgrade.rs
AgeCommit message (Collapse)Author
2024-11-14fix: otel resiliency (#26857)snek
Improving the breadth of collected data, and ensuring that the collected data is more likely to be successfully reported. - Use `log` crate in more places - Hook up `log` crate to otel - Switch to process-wide otel processors - Handle places that use `process::exit` Also adds a more robust testing framework, with a deterministic tracing setting. Refs: https://github.com/denoland/deno/issues/26852
2024-11-10Revert "perf(upgrade): cache downloaded binaries in DENO_DIR" (#26799)Divy Srivastava
Reverts denoland/deno#26108 Tests are flaky on main https://github.com/denoland/deno/commit/01de3317424cc870913dbe85ff3b80eadaf8cc87
2024-11-09perf(upgrade): cache downloaded binaries in DENO_DIR (#26108)Bartek Iwańczuk
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-10-25fix(upgrade): stop running `deno lsp` processes on windows before attempting ↵David Sherret
to replace executable (#26542)
2024-10-15fix(install): retry downloads of registry info / tarballs (#26278)Nathan Whitaker
Fixes #26085. Adds a basic retry utility with some defaults, starts off with a 100ms wait, then 250ms, then 500ms I've applied the retry in the http client, reusing an existing function, so this also applies to retrying downloads of deno binaries in `upgrade` and `compile`. I can make a separate function that doesn't retry so this doesn't affect `upgrade` and `compile`, but it seemed desirable to have retries there too, so I left it in.
2024-09-12feat(upgrade): support LTS release channel (#25123)David Sherret
Signed-off-by: David Sherret <dsherret@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-11feat(upgrade): better error message on failure (#25503)Bartek Iwańczuk
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2024-08-31fix(upgrade): more informative information on invalid version (#25319)Bartek Iwańczuk
Before: ``` $ deno upgrade v1.xx error: Invalid version passed ``` After: ``` $ deno upgrade v1.xx error: Invalid version passed (v1.xx) Example usage: deno upgrade | deno upgrade 1.46 | deno upgrade canary ``` Also updates help text to use "shorthand version" without flags, but a positional arg.
2024-08-30feat(upgrade): print info links for Deno 2 RC releases (#25225)Bartek Iwańczuk
In addition to printing a blog post information (if it's available), this will also print a link to migration guide and the bug tracker. --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-21fix(upgrade): better error message when check_exe fails (#25133)Divy Srivastava
Fixes https://github.com/denoland/deno/issues/24971 Fixes the panic. We can give a more personalized error by checking the macOS version but probably not worth the effort.
2024-08-19feat(upgrade): support `deno upgrade 1.46.0` (#25096)Bartek Iwańczuk
This commit changes `deno upgrade` subcommand to accept a positional argument that can be either a version, release channel name or a git hash, making invocations of `deno upgrade` much more concise: ``` # before $ deno upgrade --version 1.46.0 # after $ deno upgrade 1.46.0 ``` ``` # before $ deno upgrade --canary # after $ deno upgrade canary ``` ``` # specific canary version before $ deno upgrade --canary --version f042c39180c1b345de8e7b5f0dfae5d0a49b161f # after $ deno upgrade f042c39180c1b345de8e7b5f0dfae5d0a49b161f ``` Old flags are still supported, but hidden from the help output.
2024-08-19fix(upgrade): support RC release with --version flag (#25091)Bartek Iwańczuk
This commit fixes scenarios like: ``` $ deno upgrade --version=v1.46.0-rc.0 Downloading https://github.com/denoland/deno/releases/download/v1.46.0-rc.0/deno-aarch64-apple-darwin.zip Download could not be found, aborting ``` Now: ``` $ target/debug/deno upgrade --version=v1.46.0-rc.0 Downloading https://dl.deno.land/release/v1.46.0-rc.0/deno-aarch64-apple-darwin.zip Deno is upgrading to version 1.46.0-rc.0 Upgraded successfully to Deno v1.46.0-rc.0 ``` Also some unneeded code was removed.
2024-08-19fix(upgrade): correctly compute latest version based on current release ↵Bartek Iwańczuk
channel (#25087) This commit fixes computation of the latest available version by taking into account which release channel the current binary is on. Before this commit, if user was on "RC" channel, calling `deno upgrade` would not switch back to the "stable" channel.
2024-08-18fix: log current version when using deno upgrade (#25079)HasanAlrimawi
This PR addresses a suggestion in issue #21417 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-16ci: add script to promote to RC release (#25072)Bartek Iwańczuk
This commits add a CI script that allows to promote a certain canary build to a "Release Candidate" release. This is done using `libsui` and `patchver` utilities.
2024-08-16refactor: show release channel in `deno --version` (#25061)Bartek Iwańczuk
Also simplifies handling of various release channels in `deno upgrade` subcommand.
2024-08-15refactor: `version` module exports a single const struct (#25014)Bartek Iwańczuk
This commit rewrites the internal `version` module that exported various information about the current executable. Instead of exporting several consts, we are now exporting a single const structure that contains all the necessary information. This is the first step towards cleaning up how we use this information and should allow us to use SUI to be able to patch this information in already produced binary making it easier to cut new releases. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-08-15refactor: remove version::is_canary(), use ReleaseChannel instead (#25053)Bartek Iwańczuk
In preparation for https://github.com/denoland/deno/pull/25014, this commit removes public `is_canary()` method and instead uses an enum `ReleaseChannel` to be able to designate more "kinds" of builds.
2024-08-13fix(upgrade): use proper version display (#25029)Bartek Iwańczuk
This commit fixes output of `deno upgrade` subcommand, by displaying proper version numbers. Before this PR we were prepending "v" before the canary version hash, which was obviously wrong.
2024-08-12fix(upgrade): return no RC versions if fetching fails (#25013)Bartek Iwańczuk
This commit fixes errors on CI like this: ``` ---- upgrade::upgrade_prompt stdout ---- command /home/runner/work/deno/deno/target/release/deno run --log-level=debug main.js command cwd /tmp/deno-cli-testqDw5UR command /home/runner/work/deno/deno/target/release/deno run --log-level=debug main.js command cwd /tmp/deno-cli-testqDw5UR ------ Start Full Text ------ "DEBUG RS - deno::args:620 - No .npmrc file found\r\nDEBUG RS - deno::args:909 - Finished config loading.\r\nDEBUG RS - deno::cache::cache_db:168 - Opening cache /tmp/deno-cli-testMKnYXP/dep_analysis_cache_v2...\r\nDEBUG RS - deno::cache::cache_db:168 - Opening cache /tmp/deno-cli-testMKnYXP/node_analysis_cache_v2...\r\nDEBUG RS - deno::cache::cache_db:168 - Opening cache /tmp/deno-cli-testMKnYXP/v8_code_cache_v2...\r\nDEBUG RS - deno::js:10 - Deno isolate init with snapshots.\r\nDEBUG RS - deno::worker:183 - main_module file:///tmp/deno-cli-testqDw5UR/main.js\r\nDEBUG RS - deno::module_loader:158 - Preparing module load.\r\nDEBUG RS - deno::module_loader:162 - Building module graph.\r\nDEBUG RS - deno::file_fetcher:573 - FileFetcher::fetch_no_follow_with_options - specifier: file:///tmp/deno-cli-testqDw5UR/main.js\r\nDEBUG RS - deno::module_loader:208 - Prepared module load.\r\nDEBUG RS - deno_runtime::worker:739 - received module evaluate Ok(\r\n (),\r\n)\r\nDEBUG RS - deno::module_loader:831 - Updating V8 code cache for ES module: file:///tmp/deno-cli-testqDw5UR/main.js, [1577979522354460122]\r\n" ------- End Full Text ------- Next text: "DEBUG RS - deno::args:620 - No .npmrc file found\r\nDEBUG RS - deno::args:909 - Finished config loading.\r\nDEBUG RS - deno::cache::cache_db:168 - Opening cache /tmp/deno-cli-testMKnYXP/dep_analysis_cache_v2...\r\nDEBUG RS - deno::cache::cache_db:168 - Opening cache /tmp/deno-cli-testMKnYXP/node_analysis_cache_v2...\r\nDEBUG RS - deno::cache::cache_db:168 - Opening cache /tmp/deno-cli-testMKnYXP/v8_code_cache_v2...\r\nDEBUG RS - deno::js:10 - Deno isolate init with snapshots.\r\nDEBUG RS - deno::worker:183 - main_module file:///tmp/deno-cli-testqDw5UR/main.js\r\nDEBUG RS - deno::module_loader:158 - Preparing module load.\r\nDEBUG RS - deno::module_loader:162 - Building module graph.\r\nDEBUG RS - deno::file_fetcher:573 - FileFetcher::fetch_no_follow_with_options - specifier: file:///tmp/deno-cli-testqDw5UR/main.js\r\nDEBUG RS - deno::module_loader:208 - Prepared module load.\r\nDEBUG RS - deno_runtime::worker:739 - received module evaluate Ok(\r\n (),\r\n)\r\nDEBUG RS - deno::module_loader:831 - Updating V8 code cache for ES module: file:///tmp/deno-cli-testqDw5UR/main.js, [1577979522354460122]\r\n" thread 'upgrade::upgrade_prompt' panicked at tests/integration/upgrade_tests.rs:251:9: Timed out. ``` These errors are caused by the fact that the test server doesn't have an endpoint to return RC releases. Which in turn causes an error to be raised which later just short-circuits logic for checking the version and storing it in file. Since fetching from a remote host is always fallible I elected to just return an empty vec of "rc" versions instead of erroring. This might lead to a slight mismatch in some situation when the request actually failed and user is prompted that there's a new canary version, but that is better than not displaying prompt at all. This issue will be fixed more robustly once we move to using SUI for specifying version of the binary.
2024-08-12feat: `deno upgrade --rc` (#24905)Bartek Iwańczuk
This commit adds the "--rc" flag to "deno upgrade" subcommand. This flag allows to upgrade to the latest "release candidate" release. The update checker was also updated to take this into account.
2024-08-09refactor(upgrade): cleanup pass (#24954)Bartek Iwańczuk
No functional changes, just factoring out some helpers to make it easier to update and test.
2024-08-08fix: Don't shell out to `unzip` in deno upgrade/compile (#24926)Nathan Whitaker
Use the `zip` crate instead Fixes #23988.
2024-08-07feat(upgrade): refresh output (#24911)Bartek Iwańczuk
This commit updates the output of "deno upgrade" subcommand.
2024-08-07refactor(upgrade): make fetching latest version async (#24919)Bartek Iwańczuk
Additionally some renames in preparation to support "LTS" and "RC" channels.
2024-07-23fix(upgrade): do not error if config in cwd invalid (#24689)David Sherret
``` > deno upgrade error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile. V:\scratch > V:\deno\target\debug\deno upgrade Looking up latest version Local deno version 1.45.3 is the most recent release ``` Closes #24517 Closes #20729
2024-07-18Reland "refactor(fetch): reimplement fetch with hyper instead of reqwest" ↵Bartek Iwańczuk
(#24593) Originally landed in https://github.com/denoland/deno/commit/f6fd6619e708a515831f707438368d81b0c9aa56. Reverted in https://github.com/denoland/deno/pull/24574. This reland contains a fix that sends "Accept: */*" header for calls made from "FileFetcher". Absence of this header made downloading source code from JSR broken. This is tested by ensuring this header is present in the test server that servers JSR packages. --------- Co-authored-by: Sean McArthur <sean@seanmonstar.com>
2024-07-13Revert "refactor(fetch): reimplement fetch with hyper instead of reqwest ↵Ryan Dahl
(#24237)" (#24574) This reverts commit f6fd6619e708a515831f707438368d81b0c9aa56. I'm seeing a difference between canary and 1.45.2. In `deno-docs/reference_gen` I can't download dax when running `deno task types` ``` ~/src/deno-docs/reference_gen# deno upgrade --canary Looking up latest canary version Found latest version f6fd6619e708a515831f707438368d81b0c9aa56 Downloading https://dl.deno.land/canary/f6fd6619e708a515831f707438368d81b0c9aa56/deno-aarch64-apple-darwin.zip Deno is upgrading to version f6fd6619e708a515831f707438368d81b0c9aa56 Archive: /var/folders/9v/kys6gqns6kl8nksyn4l1f9v40000gn/T/.tmpb5lDnq/deno.zip inflating: deno Upgraded successfully ~/src/deno-docs/reference_gen# deno -v deno 1.45.2+f6fd661 ~/src/deno-docs/reference_gen# rm -rf /Users/ry/Library/Caches/deno ~/src/deno-docs/reference_gen# deno task types Task types deno task types:deno && deno task types:node Task types:deno deno run --allow-read --allow-write --allow-run --allow-env --allow-sys deno-docs.ts error: JSR package manifest for '@david/dax' failed to load. expected value at line 1 column 1 at file:///Users/ry/src/deno-docs/reference_gen/deno-docs.ts:2:15 ~/src/deno-docs/reference_gen# deno upgrade --version 1.45.2 Downloading https://github.com/denoland/deno/releases/download/v1.45.2/deno-aarch64-apple-darwin.zip Deno is upgrading to version 1.45.2 Archive: /var/folders/9v/kys6gqns6kl8nksyn4l1f9v40000gn/T/.tmp3R7uhF/deno.zip inflating: deno Upgraded successfully ~/src/deno-docs/reference_gen# rm -rf /Users/ry/Library/Caches/deno ~/src/deno-docs/reference_gen# deno task types Task types deno task types:deno && deno task types:node Task types:deno deno run --allow-read --allow-write --allow-run --allow-env --allow-sys deno-docs.ts Task types:node deno run --allow-read --allow-write=. --allow-env --allow-sys node-docs.ts ```
2024-07-13refactor(fetch): reimplement fetch with hyper instead of reqwest (#24237)Sean McArthur
This commit re-implements `ext/fetch` and all dependent crates using `hyper` and `hyper-util`, instead of `reqwest`. The reasoning is that we want to have greater control and access to low level `hyper` APIs when implementing `fetch` API as well as `node:http` module. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-06-03refactor: don't share `reqwest::HttpClient` across tokio runtimes (#24092)David Sherret
This also fixes several issues where we weren't properly creating http clients with the user's settings.
2024-05-23FUTURE: initial support for .npmrc file (#23560)Bartek Iwańczuk
This commit adds initial support for ".npmrc" files. Currently we only discover ".npmrc" files next to "package.json" files and discovering these files in user home dir is left for a follow up. This pass supports "_authToken" and "_auth" configuration for providing authentication. LSP support has been left for a follow up PR. Towards https://github.com/denoland/deno/issues/16105
2024-05-23refactor: remove custom `utc_now` in favor of `chrono::Utc:now` feature ↵Felipe Baltor
(#23888) This PR removes the use of the custom `utc_now` function in favor of the `chrono` implementation. It resolves #22864. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-08chore: enable clippy::print_stdout and clippy::print_stderr (#23732)David Sherret
1. Generally we should prefer to use the `log` crate. 2. I very often accidentally commit `eprintln`s. When we should use `println` or `eprintln`, it's not too bad to be a bit more verbose and ignore the lint rule.
2024-03-14chore(cli): move away from PathBuf in clap (#22036)Łukasz Czerniawski
2024-03-11chore: enable clippy unused_async rule (#22834)David Sherret
2024-03-04chore: fix typos (#22677)cui fliter
2024-02-13feat: denort binary for `deno compile` (#22205)Divy Srivastava
This introduces the `denort` binary - a slim version of deno without tooling. The binary is used as the default for `deno compile`. Improves `deno compile` final size by ~2.5x (141 MB -> 61 MB) on Linux x86_64.
2024-01-30fix: canary for arm64 macos (#22187)Luca Casonato
This doesn't actually trigger the arm64 build job nightly yet. I'll do that in a follow up.
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-11-23chore: add upgrade prompt integration test (#21273)David Sherret
1. Adds an upgrade prompt integration test. 1. Adds a test for when the upgrade check takes a long time in the repl.
2023-11-17chore: combine `TestCommandBuilder` with `DenoCmd` (#21248)David Sherret
2023-11-17refactor(upgrade): add unit tests for lsp upgrade check (#21244)David Sherret
2023-11-14feat(lsp): upgrade check on init and notification (#21105)Nayeem Rahman
2023-10-07refactor: migrate more ops to op2 macro (#20808)Bartek Iwańczuk
Getting closer...
2023-09-27fix(upgrade): use tar.exe to extract on Windows (#20711)David Sherret
This is what we do for deno install, so it should be fine here https://github.com/denoland/deno_install/pull/219 Closes https://github.com/denoland/deno/issues/20683
2023-09-26fix(upgrade): error instead of panic on unzip failure (#20691)David Sherret
For #20683
2023-08-25chore(cli): remove atty crate (#20275)Matt Mastracci
Removes a crate with an outstanding vulnerability.
2023-08-23fix(ext/web): add stream tests to detect v8slice split bug (#20253)Matt Mastracci
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-07-20fix(cli): output file handling in deno upgrade (#18994)solach
2023-06-26chore: fix typos (#19572)Martin Fischer