From 006492d1c1148754d8b222517a090ac7aa165af3 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Sat, 15 Jun 2024 12:31:09 +0800 Subject: [PATCH 01/10] Use ubi as a library instead of as a binary --- Cargo.lock | 241 +++++++++++++++++++++++++-------- Cargo.toml | 2 + docs/cli/index.md | 1 - docs/dev-tools/backends/ubi.md | 9 -- e2e/backend/test_ubi | 2 - mise.usage.kdl | 1 - src/backend/ubi.rs | 32 ++--- src/registry.rs | 1 - 8 files changed, 204 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b6d8cd83..592c0fd08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,6 +139,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "anyhow" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" + [[package]] name = "arbitrary" version = "1.3.2" @@ -222,6 +228,17 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "binstall-tar" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3620d72763b5d8df3384f3b2ec47dc5885441c2abbd94dd32197167d08b014a" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -330,9 +347,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.13" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48" +checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" dependencies = [ "jobserver", "libc", @@ -424,6 +441,7 @@ dependencies = [ "anstyle", "clap_lex", "strsim", + "terminal_size", ] [[package]] @@ -435,7 +453,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -487,7 +505,7 @@ dependencies = [ "nom", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -508,6 +526,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +[[package]] +name = "colored" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" +dependencies = [ + "is-terminal", + "lazy_static", + "winapi", +] + [[package]] name = "confique" version = "0.2.5" @@ -670,7 +699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -680,7 +709,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -707,7 +736,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -754,7 +783,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -765,7 +794,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -805,7 +834,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -880,9 +909,9 @@ dependencies = [ [[package]] name = "ego-tree" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68a4904193147e0a8dec3314640e6db742afd5f6e634f428a6af230d9b3591" +checksum = "12a0bb14ac04a9fcf170d0bbbef949b44cc492f4452bd20c095636956f653642" [[package]] name = "either" @@ -1017,9 +1046,19 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" + +[[package]] +name = "fern" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" +dependencies = [ + "colored", + "log", +] [[package]] name = "fiat-crypto" @@ -1047,9 +1086,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "miniz_oxide 0.8.0", @@ -1321,6 +1360,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hmac" version = "0.12.1" @@ -1362,7 +1407,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1629,6 +1674,17 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is-terminal" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -1688,6 +1744,29 @@ dependencies = [ "thiserror", ] +[[package]] +name = "lazy-regex" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda" +dependencies = [ + "lazy-regex-proc_macros", + "once_cell", + "regex", +] + +[[package]] +name = "lazy-regex-proc_macros" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.76", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -1747,9 +1826,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.19" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "libc", @@ -1802,9 +1881,9 @@ dependencies = [ [[package]] name = "luajit-src" -version = "210.5.9+04dca79" +version = "210.5.10+f725e44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e03d48e8d8c11c297d49ea6d2cf6cc0d7657eb3d175219bba47d59a601b7ca9" +checksum = "18a0fa0df28e21f785c48d9c0f0be355cf40658badb667284207dbb4d1e574a9" dependencies = [ "cc", "which", @@ -1895,7 +1974,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -1934,7 +2013,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "wasi", "windows-sys 0.52.0", @@ -2018,6 +2097,7 @@ dependencies = [ "tokio", "toml", "toml_edit", + "ubi", "url", "usage-lib", "versions", @@ -2071,7 +2151,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2169,7 +2249,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -2226,7 +2306,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2394,7 +2474,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2487,7 +2567,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2525,7 +2605,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -2556,6 +2636,12 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "platforms" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" + [[package]] name = "portable-atomic" version = "1.7.0" @@ -2715,9 +2801,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -2877,6 +2963,12 @@ dependencies = [ "windows-registry", ] +[[package]] +name = "result" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194d8e591e405d1eecf28819740abed6d719d1a2db87fc0bcdedee9a26d55560" + [[package]] name = "ring" version = "0.17.8" @@ -3144,9 +3236,9 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -3163,13 +3255,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3183,9 +3275,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -3454,7 +3546,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3476,9 +3568,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.75" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -3506,9 +3598,9 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", "core-foundation", @@ -3568,7 +3660,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand 2.1.0", + "fastrand 2.1.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -3650,7 +3742,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3661,7 +3753,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "test-case-core", ] @@ -3684,7 +3776,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3704,7 +3796,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3791,7 +3883,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -3965,6 +4057,35 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ubi" +version = "0.1.0" +source = "git+https://github.com/houseabsolute/ubi.git?branch=library-ize#a183c01a34860c8e572cc317599c5ac59b6c0f24" +dependencies = [ + "anyhow", + "binstall-tar", + "bzip2", + "clap", + "fern", + "flate2", + "itertools 0.13.0", + "lazy-regex", + "log", + "platforms", + "regex", + "reqwest", + "result", + "serde", + "strum", + "tempfile", + "test-case", + "thiserror", + "tokio", + "url", + "xz", + "zip", +] + [[package]] name = "ucd-trie" version = "0.1.6" @@ -4069,6 +4190,7 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] [[package]] @@ -4237,7 +4359,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -4271,7 +4393,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4389,7 +4511,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4400,7 +4522,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4640,6 +4762,15 @@ dependencies = [ "zip", ] +[[package]] +name = "xz" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c887690ff2a2e233e8e49633461521f98ec57fbff9d59a884c9a4f04ec1da34" +dependencies = [ + "xz2", +] + [[package]] name = "xz2" version = "0.1.7" @@ -4673,7 +4804,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] @@ -4693,7 +4824,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.75", + "syn 2.0.76", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 13ca7dd89..4ea7c9ba6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -126,6 +126,8 @@ which = "6.0.1" xx = { version = "1.0.0", features = ["glob"] } zip = { version = "2", default-features = false, features = ["deflate"] } +ubi = { git = "https://github.com/houseabsolute/ubi.git", branch = "library-ize" } + [target.'cfg(unix)'.dependencies] exec = "0.3" nix = { version = "0.29", features = ["signal", "user"] } diff --git a/docs/cli/index.md b/docs/cli/index.md index 32ce7da78..d8a6b4ab1 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -974,7 +974,6 @@ Examples: $ mise registry node core:node poetry asdf:mise-plugins/mise-poetry - ubi cargo:ubi ``` ## `mise reshim` diff --git a/docs/dev-tools/backends/ubi.md b/docs/dev-tools/backends/ubi.md index 581ad16bf..667d60846 100644 --- a/docs/dev-tools/backends/ubi.md +++ b/docs/dev-tools/backends/ubi.md @@ -4,15 +4,6 @@ You may install GitHub Releases and URL packages directly using [ubi](https://gi The code for this is inside of the mise repository at [`./src/backend/ubi.rs`](https://github.com/jdx/mise/blob/main/src/backend/ubi.rs). -## Dependencies - -This relies on having `ubi` installed. You can install it with or without mise. -Here is how to install `ubi` with mise: - -```sh -mise use -g cargo:ubi -``` - ## Usage The following installs the latest version of goreleaser diff --git a/e2e/backend/test_ubi b/e2e/backend/test_ubi index 1f15844b6..6aa561347 100644 --- a/e2e/backend/test_ubi +++ b/e2e/backend/test_ubi @@ -1,5 +1,3 @@ #!/usr/bin/env bash -curl -sSf -L https://raw.githubusercontent.com/houseabsolute/ubi/master/bootstrap/bootstrap-ubi.sh | TARGET="$HOME/bin" sh - assert "mise x ubi:goreleaser/goreleaser@v1.25.0 -- goreleaser -v | grep -o 1.25.0" "1.25.0" diff --git a/mise.usage.kdl b/mise.usage.kdl index 41c6abedc..67f153768 100644 --- a/mise.usage.kdl +++ b/mise.usage.kdl @@ -734,7 +734,6 @@ cmd "registry" help="[experimental] List available tools" { $ mise registry node core:node poetry asdf:mise-plugins/mise-poetry - ubi cargo:ubi " } cmd "reshim" help="rebuilds the shim farm" { diff --git a/src/backend/ubi.rs b/src/backend/ubi.rs index 3acbb43f5..ed9560f4f 100644 --- a/src/backend/ubi.rs +++ b/src/backend/ubi.rs @@ -1,10 +1,11 @@ use std::fmt::Debug; +use eyre::eyre; + use crate::backend::{Backend, BackendType}; use crate::cache::CacheManager; use crate::cli::args::BackendArg; -use crate::cmd::CmdLineRunner; -use crate::config::{Config, Settings}; +use crate::config::Settings; use crate::env::GITHUB_TOKEN; use crate::github; use crate::install_context::InstallContext; @@ -28,10 +29,9 @@ impl Backend for UbiBackend { } fn get_dependencies(&self, _tvr: &ToolRequest) -> eyre::Result> { - Ok(vec!["cargo:ubi".into()]) + Ok(vec![]) } - // TODO: v0.0.3 is stripped of 'v' such that it reports incorrectly in tool :-/ fn _list_remote_versions(&self) -> eyre::Result> { if name_is_url(self.name()) { Ok(vec!["latest".to_string()]) @@ -49,31 +49,31 @@ impl Backend for UbiBackend { } fn install_version_impl(&self, ctx: &InstallContext) -> eyre::Result<()> { - let config = Config::try_get()?; let settings = Settings::get(); let version = &ctx.tv.version; settings.ensure_experimental("ubi backend")?; // Workaround because of not knowing how to pull out the value correctly without quoting let path_with_bin = ctx.tv.install_path().join("bin"); - let mut cmd = CmdLineRunner::new("ubi") - .arg("--in") - .arg(path_with_bin) - .arg("--project") - .arg(self.name()) - .with_pr(ctx.pr.as_ref()) - .envs(ctx.ts.env_with_path(&config)?) - .prepend_path(ctx.ts.list_paths())?; + let mut builder = ubi::UbiBuilder::new() + .project(self.name()) + .install_dir(path_with_bin); if let Some(token) = &*GITHUB_TOKEN { - cmd = cmd.env("GITHUB_TOKEN", token); + builder = builder.github_token(token); } if version != "latest" { - cmd = cmd.arg("--tag").arg(version); + builder = builder.tag(version); } - cmd.execute() + let u = builder.build().map_err(|e| eyre!(Box::new(e)))?; + + let rt = tokio::runtime::Builder::new_current_thread() + .enable_io() + .build()?; + rt.block_on(u.install_binary()) + .map_err(|e| eyre!(Box::new(e))) } } diff --git a/src/registry.rs b/src/registry.rs index 60d8a7d13..f283918f3 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -5,7 +5,6 @@ use once_cell::sync::Lazy; use std::collections::BTreeMap; const _REGISTRY: &[(&str, &str)] = &[ - ("ubi", "cargo:ubi"), ("cargo-binstall", "cargo:cargo-binstall"), // ("elixir", "asdf:mise-plugins/mise-elixir"), ]; From 6c6e9196a367f947edb6e7f09b8d4efdcb6ebd34 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Sun, 23 Jun 2024 16:27:43 +0800 Subject: [PATCH 02/10] Move variable declaration to where it's used --- src/backend/ubi.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/ubi.rs b/src/backend/ubi.rs index ed9560f4f..7cb72e8b8 100644 --- a/src/backend/ubi.rs +++ b/src/backend/ubi.rs @@ -50,7 +50,6 @@ impl Backend for UbiBackend { fn install_version_impl(&self, ctx: &InstallContext) -> eyre::Result<()> { let settings = Settings::get(); - let version = &ctx.tv.version; settings.ensure_experimental("ubi backend")?; // Workaround because of not knowing how to pull out the value correctly without quoting let path_with_bin = ctx.tv.install_path().join("bin"); @@ -63,6 +62,7 @@ impl Backend for UbiBackend { builder = builder.github_token(token); } + let version = &ctx.tv.version; if version != "latest" { builder = builder.tag(version); } From c97d809d7c3078e4392cd2e9d0dfe31afcf39bc8 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Sun, 23 Jun 2024 16:29:46 +0800 Subject: [PATCH 03/10] Support passing exe and matching args to ubi backend --- src/backend/ubi.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/backend/ubi.rs b/src/backend/ubi.rs index 7cb72e8b8..167ed610c 100644 --- a/src/backend/ubi.rs +++ b/src/backend/ubi.rs @@ -67,6 +67,15 @@ impl Backend for UbiBackend { builder = builder.tag(version); } + let exe = std::env::var("MISE_TOOL_OPTS__EXE").unwrap_or(String::new()); + if !exe.is_empty() { + builder = builder.exe(&exe); + } + let matching = std::env::var("MISE_TOOL_OPTS__MATCHING").unwrap_or(String::new()); + if !matching.is_empty() { + builder = builder.matching(&matching); + } + let u = builder.build().map_err(|e| eyre!(Box::new(e)))?; let rt = tokio::runtime::Builder::new_current_thread() From e8b19640cfa7f9d2e81b8ac919deb6ad721413e4 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Tue, 2 Jul 2024 15:21:09 -0500 Subject: [PATCH 04/10] Remove unneeded boxing --- src/backend/ubi.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/backend/ubi.rs b/src/backend/ubi.rs index 167ed610c..2e0660802 100644 --- a/src/backend/ubi.rs +++ b/src/backend/ubi.rs @@ -76,13 +76,12 @@ impl Backend for UbiBackend { builder = builder.matching(&matching); } - let u = builder.build().map_err(|e| eyre!(Box::new(e)))?; + let u = builder.build().map_err(|e| eyre!(e))?; let rt = tokio::runtime::Builder::new_current_thread() .enable_io() .build()?; - rt.block_on(u.install_binary()) - .map_err(|e| eyre!(Box::new(e))) + rt.block_on(u.install_binary()).map_err(|e| eyre!(e)) } } From 2303ab7cab8da95b40090bd1ac713ea1f8405685 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Tue, 2 Jul 2024 15:22:48 -0500 Subject: [PATCH 05/10] Fix issue found by clippy --- src/backend/ubi.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/ubi.rs b/src/backend/ubi.rs index 2e0660802..e417a3d39 100644 --- a/src/backend/ubi.rs +++ b/src/backend/ubi.rs @@ -67,11 +67,11 @@ impl Backend for UbiBackend { builder = builder.tag(version); } - let exe = std::env::var("MISE_TOOL_OPTS__EXE").unwrap_or(String::new()); + let exe = std::env::var("MISE_TOOL_OPTS__EXE").unwrap_or_default(); if !exe.is_empty() { builder = builder.exe(&exe); } - let matching = std::env::var("MISE_TOOL_OPTS__MATCHING").unwrap_or(String::new()); + let matching = std::env::var("MISE_TOOL_OPTS__MATCHING").unwrap_or_default(); if !matching.is_empty() { builder = builder.matching(&matching); } From 2ab262515d82e71ec13de1137d773b9ae6758b44 Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Sun, 14 Jul 2024 11:20:02 -0500 Subject: [PATCH 06/10] Import ubi --- src/backend/ubi.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/ubi.rs b/src/backend/ubi.rs index e417a3d39..1307f62ef 100644 --- a/src/backend/ubi.rs +++ b/src/backend/ubi.rs @@ -1,6 +1,7 @@ use std::fmt::Debug; use eyre::eyre; +use ubi::UbiBuilder; use crate::backend::{Backend, BackendType}; use crate::cache::CacheManager; @@ -54,7 +55,7 @@ impl Backend for UbiBackend { // Workaround because of not knowing how to pull out the value correctly without quoting let path_with_bin = ctx.tv.install_path().join("bin"); - let mut builder = ubi::UbiBuilder::new() + let mut builder = UbiBuilder::new() .project(self.name()) .install_dir(path_with_bin); From 23eecad525d96d850658c4cf561b763299b53d5e Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Tue, 23 Jul 2024 21:47:38 -0500 Subject: [PATCH 07/10] Use a released version of ubi --- Cargo.lock | 5 +++-- Cargo.toml | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 592c0fd08..f2488fc92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4059,8 +4059,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ubi" -version = "0.1.0" -source = "git+https://github.com/houseabsolute/ubi.git?branch=library-ize#a183c01a34860c8e572cc317599c5ac59b6c0f24" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b22346bf4219ee3fba90734b4a0cc1a14c6a3d7c84fa6cff68c9a82293874972" dependencies = [ "anyhow", "binstall-tar", diff --git a/Cargo.toml b/Cargo.toml index 4ea7c9ba6..7cbd1423a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,6 +117,7 @@ tokio = { version = "1.37.0", features = [ ] } toml = { version = "0.8.12", features = ["parse"] } toml_edit = { version = "0.22.12", features = ["parse"] } +ubi = "0.1.0" url = "2.5.0" usage-lib = { version = "0.3", features = ["clap"] } versions = { version = "6.2.0", features = ["serde"] } @@ -126,8 +127,6 @@ which = "6.0.1" xx = { version = "1.0.0", features = ["glob"] } zip = { version = "2", default-features = false, features = ["deflate"] } -ubi = { git = "https://github.com/houseabsolute/ubi.git", branch = "library-ize" } - [target.'cfg(unix)'.dependencies] exec = "0.3" nix = { version = "0.29", features = ["signal", "user"] } From 393a3a85232ee9fecd3c3b85c845c41263ab6aab Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Tue, 3 Sep 2024 08:25:07 -0500 Subject: [PATCH 08/10] test: remove unnecessary test with baked-in ubi --- e2e/backend/test_ubi_token | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 e2e/backend/test_ubi_token diff --git a/e2e/backend/test_ubi_token b/e2e/backend/test_ubi_token deleted file mode 100644 index 03f57810e..000000000 --- a/e2e/backend/test_ubi_token +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash - -unset GITHUB_TOKEN GITHUB_API_TOKEN - -# Create an ubi stub that just output the value of GITHUB_TOKEN -cat >~/bin/ubi <<'EOF' -#!/usr/bin/env bash -echo "token=$GITHUB_TOKEN" -EOF -chmod u+x ~/bin/ubi -export PATH="$HOME/bin:$PATH" - -# This should reuse the existing GITHUB_TOKEN variable -assert_contains "GITHUB_TOKEN=foobar mise install -f ubi:goreleaser/goreleaser@v1.25.0 2>&1" "token=foobar" - -# This should use the GITHUB_API_TOKEN variable -assert_contains "GITHUB_API_TOKEN=foobar mise install -f ubi:goreleaser/goreleaser@v1.25.0 2>&1" "token=foobar" - -# This should prefer GITHUB_API_TOKEN -assert_contains "GITHUB_TOKEN=foobar GITHUB_API_TOKEN=barquz mise install -f ubi:goreleaser/goreleaser@v1.25.0 2>&1" "token=foobar" From 014b96f9d28e49b80e55a0dae64597db4c3910d6 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Tue, 3 Sep 2024 08:25:07 -0500 Subject: [PATCH 09/10] test: remove unnecessary test with baked-in ubi --- Cargo.lock | 173 ++++++++++++++++++++--------------------------------- Cargo.toml | 2 +- 2 files changed, 67 insertions(+), 108 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 626c294c6..8aec70e9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -441,7 +441,6 @@ dependencies = [ "anstyle", "clap_lex", "strsim", - "terminal_size", ] [[package]] @@ -453,7 +452,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -505,7 +504,7 @@ dependencies = [ "nom", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -526,17 +525,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" -[[package]] -name = "colored" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f741c91823341bebf717d4c71bda820630ce065443b58bd1b7451af008355" -dependencies = [ - "is-terminal", - "lazy_static", - "winapi", -] - [[package]] name = "confique" version = "0.2.5" @@ -699,7 +687,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -709,7 +697,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -736,7 +724,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -783,7 +771,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -794,7 +782,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -834,7 +822,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -1046,19 +1034,18 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] [[package]] -name = "fern" -version = "0.6.2" +name = "fastrand" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" -dependencies = [ - "colored", - "log", -] +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "fiat-crypto" @@ -1314,7 +1301,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.5.0", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -1360,12 +1347,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - [[package]] name = "hmac" version = "0.12.1" @@ -1407,7 +1388,7 @@ dependencies = [ "markup5ever", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -1607,9 +1588,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -1674,17 +1655,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is-terminal" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" -dependencies = [ - "hermit-abi 0.4.0", - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -1764,7 +1734,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -1980,7 +1950,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -2019,7 +1989,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", "wasi", "windows-sys 0.52.0", @@ -2060,7 +2030,7 @@ dependencies = [ "home", "humantime", "indenter", - "indexmap 2.5.0", + "indexmap 2.4.0", "indicatif", "indoc", "insta", @@ -2157,7 +2127,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -2255,7 +2225,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] @@ -2312,7 +2282,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -2480,7 +2450,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -2501,7 +2471,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.5.0", + "indexmap 2.4.0", ] [[package]] @@ -2573,7 +2543,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -2611,7 +2581,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -2759,9 +2729,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ "bytes", "pin-project-lite", @@ -2777,9 +2747,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" dependencies = [ "bytes", "rand", @@ -2794,15 +2764,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -2969,12 +2939,6 @@ dependencies = [ "windows-registry", ] -[[package]] -name = "result" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194d8e591e405d1eecf28819740abed6d719d1a2db87fc0bcdedee9a26d55560" - [[package]] name = "ring" version = "0.17.8" @@ -3202,13 +3166,13 @@ dependencies = [ [[package]] name = "self-replace" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ec815b5eab420ab893f63393878d89c90fdd94c0bcc44c07abb8ad95552fb7" +checksum = "f7828a58998685d8bf5a3c5e7a3379a5867289c20828c3ee436280b44b598515" dependencies = [ - "fastrand", + "fastrand 1.9.0", "tempfile", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -3267,7 +3231,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -3552,7 +3516,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -3574,9 +3538,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -3666,7 +3630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand", + "fastrand 2.1.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -3748,7 +3712,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -3759,7 +3723,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", "test-case-core", ] @@ -3782,7 +3746,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -3802,7 +3766,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -3889,7 +3853,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -3953,7 +3917,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.4.0", "serde", "serde_spanned", "toml_datetime", @@ -4065,16 +4029,14 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ubi" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a7544f61b3a3aac5735543b455269275be3f71f76917574a6ad25ad037ddcce" +checksum = "18d478e9147a27f8a8d973dead8057eb4cac66ec9e4ecbcfd46545a80375802c" dependencies = [ "anyhow", "binstall-tar", "bzip2", - "clap", "document-features", - "fern", "flate2", "itertools 0.13.0", "lazy-regex", @@ -4082,13 +4044,10 @@ dependencies = [ "platforms", "regex", "reqwest", - "result", "serde", "strum", "tempfile", - "test-case", "thiserror", - "tokio", "url", "xz", "zip", @@ -4215,7 +4174,7 @@ checksum = "90e782a5477c492c1c900deafb948024689d2e169c603b780e269f782cd03b7b" dependencies = [ "clap", "heck 0.5.0", - "indexmap 2.5.0", + "indexmap 2.4.0", "itertools 0.13.0", "kdl", "log", @@ -4276,7 +4235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74d3110af29f3d681ae75f6645e6d7b3e19fb4dadccd126654d75958f878f1ec" dependencies = [ "homedir", - "indexmap 2.5.0", + "indexmap 2.4.0", "itertools 0.13.0", "log", "mlua", @@ -4367,7 +4326,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -4401,7 +4360,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4424,9 +4383,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.5" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -4519,7 +4478,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -4530,7 +4489,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -4812,7 +4771,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -4832,7 +4791,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.76", ] [[package]] @@ -4851,7 +4810,7 @@ dependencies = [ "displaydoc", "flate2", "hmac", - "indexmap 2.5.0", + "indexmap 2.4.0", "lzma-rs", "memchr", "pbkdf2", diff --git a/Cargo.toml b/Cargo.toml index 64f867a22..0e1533e2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,7 +117,7 @@ tokio = { version = "1.37.0", features = [ ] } toml = { version = "0.8.12", features = ["parse"] } toml_edit = { version = "0.22.12", features = ["parse"] } -ubi = {version = "0.1", default-features = false} +ubi = {version = "0.2", default-features = false} url = "2.5.0" usage-lib = { version = "0.3", features = ["clap"] } versions = { version = "6.2.0", features = ["serde"] } From bacf4bfc763ec54de30037792f852e0fc191b81e Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Tue, 3 Sep 2024 08:30:51 -0500 Subject: [PATCH 10/10] chore: ubi 0.2 --- docs/cli/exec.md | 3 +-- docs/cli/global.md | 6 ++---- docs/cli/index.md | 19 +++++++------------ docs/cli/install.md | 6 ++---- docs/cli/local.md | 6 ++---- docs/cli/ls.md | 3 +-- docs/cli/plugins/ls-remote.md | 1 + docs/cli/prune.md | 3 +-- docs/cli/use.md | 3 +-- 9 files changed, 18 insertions(+), 32 deletions(-) diff --git a/docs/cli/exec.md b/docs/cli/exec.md index 580f9e07b..4c9da75d0 100644 --- a/docs/cli/exec.md +++ b/docs/cli/exec.md @@ -7,8 +7,7 @@ Execute a command with tool(s) set use this to avoid modifying the shell session or running ad-hoc commands with mise tools set. -Tools will be loaded from .mise.toml/.tool-versions, though they can be overridden with -args +Tools will be loaded from .mise.toml/.tool-versions, though they can be overridden with args Note that only the plugin specified will be overridden, so if a `.tool-versions` file includes "node 20" but you run `mise exec python@3.11`; it will still load node@20. diff --git a/docs/cli/global.md b/docs/cli/global.md index 720dd04db..2401bd3a1 100644 --- a/docs/cli/global.md +++ b/docs/cli/global.md @@ -4,10 +4,8 @@ Sets/gets the global tool version(s) Displays the contents of global config after writing. -The file is `$HOME/.config/mise/config.toml` by default. It can be changed with -`$MISE_GLOBAL_CONFIG_FILE`. -If `$MISE_GLOBAL_CONFIG_FILE` is set to anything that ends in `.toml`, it will be parsed as -`.mise.toml`. +The file is `$HOME/.config/mise/config.toml` by default. It can be changed with `$MISE_GLOBAL_CONFIG_FILE`. +If `$MISE_GLOBAL_CONFIG_FILE` is set to anything that ends in `.toml`, it will be parsed as `.mise.toml`. Otherwise, it will be parsed as a `.tool-versions` file. Use MISE_ASDF_COMPAT=1 to default the global config to ~/.tool-versions diff --git a/docs/cli/index.md b/docs/cli/index.md index 4482ad641..9ccc72e1d 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -372,8 +372,7 @@ Execute a command with tool(s) set use this to avoid modifying the shell session or running ad-hoc commands with mise tools set. -Tools will be loaded from .mise.toml/.tool-versions, though they can be overridden with -args +Tools will be loaded from .mise.toml/.tool-versions, though they can be overridden with args Note that only the plugin specified will be overridden, so if a `.tool-versions` file includes "node 20" but you run `mise exec python@3.11`; it will still load node@20. @@ -504,8 +503,7 @@ Installs a tool version to `~/.local/share/mise/installs//` Installing alone will not activate the tools so they won't be in PATH. To install and/or activate in one command, use `mise use` which will create a `.mise.toml` file in the current directory to activate this tool when inside the directory. -Alternatively, run `mise exec @ -- ` to execute a tool without creating -config files. +Alternatively, run `mise exec @ -- ` to execute a tool without creating config files. Tools will be installed in parallel. To disable, set `--jobs=1` or `MISE_JOBS=1` @@ -531,8 +529,7 @@ Options: -v, --verbose... Show installation output - This argument will print plugin output such as download, configuration, and compilation - output. + This argument will print plugin output such as download, configuration, and compilation output. Examples: @@ -628,8 +625,7 @@ Options: Only show tool versions currently specified in a the global .tool-versions/.mise.toml -i, --installed - Only show tool versions that are installed (Hides tools defined in - .tool-versions/.mise.toml but not installed) + Only show tool versions that are installed (Hides tools defined in .tool-versions/.mise.toml but not installed) -J, --json Output in JSON format @@ -870,6 +866,7 @@ The full list is here: https://github.com/jdx/mise/blob/main/src/default_shortha Examples: $ mise plugins ls-remote + Usage: plugins ls-remote [OPTIONS] Options: @@ -953,8 +950,7 @@ Options: Do not actually delete anything --configs - Prune only tracked and trusted configuration links that point to non-existent - configurations + Prune only tracked and trusted configuration links that point to non-existent configurations --tools Prune only unused versions of tools @@ -1717,8 +1713,7 @@ Options: Remove the plugin(s) from config file -p, --path - Specify a path to a config file or directory If a directory is specified, it will look for - .mise.toml (default) or .tool-versions + Specify a path to a config file or directory If a directory is specified, it will look for .mise.toml (default) or .tool-versions --pin Save exact version to config file diff --git a/docs/cli/install.md b/docs/cli/install.md index 3c4561533..59072f516 100644 --- a/docs/cli/install.md +++ b/docs/cli/install.md @@ -9,8 +9,7 @@ Installs a tool version to `~/.local/share/mise/installs//` Installing alone will not activate the tools so they won't be in PATH. To install and/or activate in one command, use `mise use` which will create a `.mise.toml` file in the current directory to activate this tool when inside the directory. -Alternatively, run `mise exec @ -- ` to execute a tool without creating -config files. +Alternatively, run `mise exec @ -- ` to execute a tool without creating config files. Tools will be installed in parallel. To disable, set `--jobs=1` or `MISE_JOBS=1` @@ -36,8 +35,7 @@ Options: -v, --verbose... Show installation output - This argument will print plugin output such as download, configuration, and compilation - output. + This argument will print plugin output such as download, configuration, and compilation output. Examples: diff --git a/docs/cli/local.md b/docs/cli/local.md index 201a9042f..0eb05a610 100644 --- a/docs/cli/local.md +++ b/docs/cli/local.md @@ -20,16 +20,14 @@ Arguments: Options: -p, --parent Recurse up to find a .tool-versions file rather than using the current directory only - by default this command will only set the tool in the current directory - ("$PWD/.tool-versions") + by default this command will only set the tool in the current directory ("$PWD/.tool-versions") --pin Save exact version to `.tool-versions` e.g.: `mise local --pin node@20` will save `node 20.0.0` to .tool-versions --fuzzy - Save fuzzy version to `.tool-versions` e.g.: `mise local --fuzzy node@20` will save `node - 20` to .tool-versions This is the default behavior unless MISE_ASDF_COMPAT=1 + Save fuzzy version to `.tool-versions` e.g.: `mise local --fuzzy node@20` will save `node 20` to .tool-versions This is the default behavior unless MISE_ASDF_COMPAT=1 --remove Remove the plugin(s) from .tool-versions diff --git a/docs/cli/ls.md b/docs/cli/ls.md index ace24019a..40e6f97da 100644 --- a/docs/cli/ls.md +++ b/docs/cli/ls.md @@ -25,8 +25,7 @@ Options: Only show tool versions currently specified in a the global .tool-versions/.mise.toml -i, --installed - Only show tool versions that are installed (Hides tools defined in - .tool-versions/.mise.toml but not installed) + Only show tool versions that are installed (Hides tools defined in .tool-versions/.mise.toml but not installed) -J, --json Output in JSON format diff --git a/docs/cli/plugins/ls-remote.md b/docs/cli/plugins/ls-remote.md index 2ef77c090..282c8bda2 100644 --- a/docs/cli/plugins/ls-remote.md +++ b/docs/cli/plugins/ls-remote.md @@ -10,6 +10,7 @@ The full list is here: https://github.com/jdx/mise/blob/main/src/default_shortha Examples: $ mise plugins ls-remote + Usage: plugins ls-remote [OPTIONS] Options: diff --git a/docs/cli/prune.md b/docs/cli/prune.md index c81901ce4..8e5b5a4c3 100644 --- a/docs/cli/prune.md +++ b/docs/cli/prune.md @@ -19,8 +19,7 @@ Options: Do not actually delete anything --configs - Prune only tracked and trusted configuration links that point to non-existent - configurations + Prune only tracked and trusted configuration links that point to non-existent configurations --tools Prune only unused versions of tools diff --git a/docs/cli/use.md b/docs/cli/use.md index 1d3003d32..ef12738c1 100644 --- a/docs/cli/use.md +++ b/docs/cli/use.md @@ -46,8 +46,7 @@ Options: Remove the plugin(s) from config file -p, --path - Specify a path to a config file or directory If a directory is specified, it will look for - .mise.toml (default) or .tool-versions + Specify a path to a config file or directory If a directory is specified, it will look for .mise.toml (default) or .tool-versions --pin Save exact version to config file