Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ jobs:
- run: |
cargo build --all-features
echo "$PWD/target/debug" >> "$GITHUB_PATH"
- name: cache mise
uses: actions/cache@v4
with:
key: mise-tools-ubuntu-latest-${{ hashFiles('.mise.lock') }}
restore-keys: mise-tools-ubuntu-latest
path: |
~/.local/share/mise/installs
~/.local/share/mise/plugins
- run: mise install
- run: npm install
- run: mise run render
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/release-fig.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: release-fig
on:
push:
tags:
Expand All @@ -19,13 +20,6 @@ jobs:
- run: mkdir -p "$HOME/bin" && echo "$HOME/bin" >> "$GITHUB_PATH"
- run: npm i
- run: cargo build --all-features && cp target/debug/mise "$HOME"/bin
- uses: actions/cache/restore@v4
with:
path: |
~/.local/share/mise/installs
~/.local/share/mise/plugins
key: mise-tools-ubuntu-latest-${{ hashFiles('.mise.lock') }}
restore-keys: mise-tools-ubuntu-latest
- run: mise install
- run: mise run render:fig
- name: Create Autocomplete PR ## Create the autocomplete PR using this action
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ jobs:
- run: mkdir -p "$HOME/bin" && echo "$HOME/bin" >> "$GITHUB_PATH"
- run: npm i
- run: cargo build --all-features && cp target/debug/mise "$HOME"/bin
- uses: actions/cache/restore@v4
with:
path: |
~/.local/share/mise/installs
~/.local/share/mise/plugins
key: mise-tools-ubuntu-latest-${{ hashFiles('.mise.lock') }}
restore-keys: mise-tools-ubuntu-latest
- run: mise install
- run: mise run release-plz
env:
Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches: ["main"]
workflow_dispatch:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -47,14 +48,6 @@ jobs:
cargo build --all-features
echo "$PWD/target/debug" >> "$GITHUB_PATH"
- run: npm i
- name: cache mise
uses: actions/cache@v4
with:
key: mise-tools-${{ matrix.os }}-${{ hashFiles('.mise.lock') }}
restore-keys: mise-tools-${{ matrix.os }}
path: |
~/.local/share/mise/installs
~/.local/share/mise/plugins
- run: mise install
- run: mise x -- cargo nextest run --all-features
- run: cargo deny check
Expand All @@ -79,14 +72,6 @@ jobs:
- run: |
cargo build --all-features
echo "$PWD/target/debug" >> "$GITHUB_PATH"
- name: cache mise
uses: actions/cache@v4
with:
key: mise-tools-ubuntu-latest-${{ hashFiles('.mise.lock') }}
restore-keys: mise-tools-ubuntu-latest
path: |
~/.local/share/mise/installs
~/.local/share/mise/plugins
- run: mise install
- run: mise run test:shuffle

Expand Down Expand Up @@ -197,3 +182,15 @@ jobs:
retry_wait_seconds: 30
max_attempts: 2
command: pwsh e2e-win\run.ps1
hyperfine:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: curl https://mise.run | sh
- run: cargo build --release
- run: echo "$PWD/target/release" >> "$GITHUB_PATH"
- run: mise i
- run: mise x hyperfine -- hyperfine --warmup 10 --min-runs 200 "$HOME/.local/bin/mise env" "target/release/mise env"
- run: mise x hyperfine -- hyperfine --warmup 10 --min-runs 200 "$HOME/.local/bin/mise ls" "target/release/mise ls"
13 changes: 0 additions & 13 deletions .mise.local.toml

This file was deleted.

4 changes: 3 additions & 1 deletion .mise.toml → mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ THIS_PROJECT = "{{config_root}}-{{cwd}}"

[tools]
#node = 'lts'
python = { version = "latest" }
shellcheck = "0.10"
shfmt = "3"
jq = "latest"
Expand Down Expand Up @@ -134,3 +133,6 @@ run = "mise tasks run -- docker:cargo run --"
[tasks."docker:e2e"]
description = "run e2e tests inside of development docker container"
run = "mise tasks run docker:mise run test:e2e"

[tasks."test:shuffle"]
run = "cargo +nightly test --all-features -- -Z unstable-options --shuffle"
20 changes: 13 additions & 7 deletions src/backend/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ use crate::backend::Backend;
use crate::cache::{CacheManager, CacheManagerBuilder};
use crate::cli::args::BackendArg;
use crate::cmd::CmdLineRunner;
use crate::config::{Config, Settings, SETTINGS};
use crate::config::{Config, SETTINGS};
use crate::env::GITHUB_TOKEN;
use crate::file;
use crate::http::HTTP_FETCH;
use crate::install_context::InstallContext;
use crate::toolset::{ToolRequest, ToolVersion};
use crate::toolset::ToolRequest;

#[derive(Debug)]
pub struct CargoBackend {
Expand Down Expand Up @@ -82,7 +82,7 @@ impl Backend for CargoBackend {
))?;
}
cmd
} else if self.is_binstall_enabled(&ctx.tv) {
} else if self.is_binstall_enabled(ctx) {
let mut cmd = CmdLineRunner::new("cargo-binstall").arg("-y");
if let Some(token) = &*GITHUB_TOKEN {
cmd = cmd.env("GITHUB_TOKEN", token)
Expand Down Expand Up @@ -127,12 +127,18 @@ impl CargoBackend {
}
}

fn is_binstall_enabled(&self, tv: &ToolVersion) -> bool {
let settings = Settings::get();
if !settings.cargo.binstall || file::which_non_pristine("cargo-binstall").is_none() {
fn is_binstall_enabled(&self, ctx: &InstallContext) -> bool {
if !SETTINGS.cargo.binstall {
return false;
}
let opts = tv.request.options();
if file::which_non_pristine("cargo-binstall").is_none()
&& !self
.dependency_toolset()
.is_ok_and(|ts| ts.which("cargo-binstall").is_some())
{
return false;
}
let opts = ctx.tv.request.options();
if opts.contains_key("features") || opts.contains_key("default-features") {
info!("not using cargo-binstall because features are specified");
return false;
Expand Down
14 changes: 8 additions & 6 deletions src/eager.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::backend;
use crate::cli::version::VERSION;
use crate::plugins::VERSION_REGEX;
use crate::toolset::install_state;
use once_cell::sync::Lazy;
use std::path::PathBuf;
use std::sync::Mutex;
Expand All @@ -13,17 +15,17 @@ pub fn early_init() {
rayon::spawn(|| {
let _ = &*VERSION;
});
// rayon::spawn(|| {
// let _ = install_state::list_backends();
// });
rayon::spawn(|| {
let _ = install_state::init();
});
}

pub static CONFIG_FILES: Lazy<Mutex<Vec<PathBuf>>> = Lazy::new(|| Mutex::new(Vec::new()));

/// run after SETTING has been loaded
pub fn post_settings() {
time!("post_settings");
// rayon::spawn(|| {
// let _ = load_tools();
// });
rayon::spawn(|| {
backend::load_tools();
});
}
6 changes: 6 additions & 0 deletions src/toolset/install_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ pub struct InstallStateTool {
static INSTALL_STATE_PLUGINS: Mutex<Option<InstallStatePlugins>> = Mutex::new(None);
static INSTALL_STATE_TOOLS: Mutex<Option<InstallStateTools>> = Mutex::new(None);

pub fn init() -> Result<()> {
drop(init_plugins()?);
drop(init_tools()?);
Ok(())
}

fn init_plugins() -> Result<MutexGuard<'static, Option<BTreeMap<String, PluginType>>>> {
let mut mu = INSTALL_STATE_PLUGINS.lock().unwrap();
if mu.is_some() {
Expand Down
20 changes: 0 additions & 20 deletions tasks.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
## `a1`

- **Usage**: `a1`

## `a2`

- **Usage**: `a2`

## `b1`

- Depends: a1, a2

- **Usage**: `b1`

## `build`

- **Usage**: `build`
- **Aliases**: `b`

## `c1`

- Depends: b1

- **Usage**: `c1`

## `ci`

- Depends: format, build, test
Expand Down