Skip to content

fix(lockfile): place lockfile alongside config file#7360

Merged
jdx merged 1 commit intomainfrom
fix/lockfile-placement-config-dir
Dec 17, 2025
Merged

fix(lockfile): place lockfile alongside config file#7360
jdx merged 1 commit intomainfrom
fix/lockfile-placement-config-dir

Conversation

@jdx
Copy link
Owner

@jdx jdx commented Dec 17, 2025

Summary

  • Fixed lockfile placement to be in the same directory as the config file
  • Previously, configs in subdirectories (.config/mise.toml, .mise/config.toml) would have their lockfile placed at the project root
  • Now the lockfile is placed alongside the config file as documented:
    • .config/mise.toml.config/mise.lock
    • .mise/config.toml.mise/mise.lock

Fixes #7343

Test plan

  • Unit tests pass (cargo test lockfile)
  • E2E tests pass (mise run test:e2e e2e/lockfile/*)

🤖 Generated with Claude Code


Note

Places lockfiles next to their config files (including .config, .mise, conf.d), updates mise lock to resolve paths and scope tools by lockfile directory, and adds unit tests.

  • Lockfile path resolution:
    • Implement lockfile_path_for_config to place lockfiles alongside configs (handles .config/, .mise/, and conf.d -> parent dir).
    • Remove config_root reliance; compute lockfile dir from config path.
  • CLI (src/cli/lock.rs):
    • Use lockfile::lockfile_path_for_config in get_lockfile_path (supports --local).
    • Scope tools to configs sharing the same lockfile directory when building the lock set.
  • Tests:
    • Add test_lockfile_path_for_config covering root, local, .config, .mise, and conf.d cases.

Written by Cursor Bugbot for commit 52dca23. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings December 17, 2025 16:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the lockfile placement behavior to align with the documented approach: lockfiles are now placed in the same directory as their corresponding config file, rather than at the project root.

Key Changes:

  • Removed logic that placed lockfiles at the project root for configs in subdirectories
  • Simplified the lockfile_path_for_config function to always place the lockfile alongside its config file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jdx jdx force-pushed the fix/lockfile-placement-config-dir branch from d99b3cd to e98eb36 Compare December 17, 2025 17:03
Changed lockfile placement to be in the same directory as the config
file, rather than always at the project root. For example:
- `.config/mise.toml` → `.config/mise.lock`
- `.mise/config.toml` → `.mise/mise.lock`

For conf.d directories, the lockfile is placed in the parent directory
so all conf.d files share the same lockfile:
- `.mise/conf.d/foo.toml` → `.mise/mise.lock`

Also updated `cli/lock.rs` to use `lockfile_path_for_config` for
consistency between the lock command and lockfile readers.

Fixes #7343

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jdx jdx force-pushed the fix/lockfile-placement-config-dir branch from e98eb36 to 52dca23 Compare December 17, 2025 17:10
@github-actions
Copy link

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 x -- echo 21.2 ± 1.0 19.5 27.6 1.00
mise x -- echo 21.7 ± 1.0 19.6 24.2 1.02 ± 0.07

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 env 20.6 ± 0.9 18.7 22.9 1.00
mise env 21.1 ± 1.1 19.0 24.6 1.03 ± 0.07

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 hook-env 20.6 ± 0.9 18.8 22.8 1.00
mise hook-env 21.4 ± 1.0 19.3 25.0 1.04 ± 0.07

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2025.12.10 ls 18.1 ± 0.8 16.6 20.0 1.00
mise ls 18.7 ± 1.0 16.9 21.7 1.03 ± 0.07

xtasks/test/perf

Command mise-2025.12.10 mise Variance
install (cached) 113ms 113ms +0%
ls (cached) 67ms 69ms -2%
bin-paths (cached) 75ms 75ms +0%
task-ls (cached) 288ms ⚠️ 2267ms -87%

⚠️ Warning: task-ls cached performance variance is -87%

@jdx jdx enabled auto-merge (squash) December 17, 2025 17:54
@jdx jdx merged commit f659788 into main Dec 17, 2025
42 of 43 checks passed
@jdx jdx deleted the fix/lockfile-placement-config-dir branch December 17, 2025 17:57
jdx pushed a commit that referenced this pull request Dec 18, 2025
### 🚀 Features

- **(alias)** rename alias to tool-alias, add shell-alias command by
@jdx in [#7357](#7357)
- **(upgrade)** display summary of upgraded tools by @jdx in
[#7372](#7372)
- **(vfox)** embed vfox plugin Lua code in binary by @jdx in
[#7369](#7369)

### 🐛 Bug Fixes

- **(aqua)** add start_operations for progress reporting by @jdx in
[#7354](#7354)
- **(github)** improve asset detection for distro-specific and Swift
artifacts by @jdx in [#7347](#7347)
- **(github)** clean up static_helpers.rs and fix archive bin= option by
@jdx in [#7366](#7366)
- **(http)** add start_operations for progress reporting by @jdx in
[#7355](#7355)
- **(lockfile)** place lockfile alongside config file by @jdx in
[#7360](#7360)
- **(progress)** add start_operations to core plugins by @jdx in
[#7351](#7351)
- **(ruby-install)** Use ruby_install_bin to update by @calebhearth in
[#7350](#7350)
- **(rust)** add release_url for rust versions by @jdx in
[#7373](#7373)
- **(schema)** add `tool_alias`, mark `alias` as deprecated by @SKalt in
[#7358](#7358)
- **(toolset)** filter tools by OS in list_current_versions by @jdx in
[#7356](#7356)
- **(ubi)** only show deprecation warning during installation by @jdx in
[#7380](#7380)
- **(ui)** remove noisy "record size" message during install by @jdx in
[#7381](#7381)
- update mise-versions URL to use /tools/ prefix by @jdx in
[#7378](#7378)

### 🚜 Refactor

- **(backend)** unified AssetMatcher with checksum fetching by @jdx in
[#7370](#7370)
- **(backend)** deprecate ubi backend in favor of github by @jdx in
[#7374](#7374)
- **(toolset)** decompose mod.rs into smaller modules by @jdx in
[#7371](#7371)

### 🧪 Testing

- **(e2e)** fix and rename ubi and vfox_embedded_override tests by @jdx
in
[052ea40](052ea40)

### 📦 Registry

- add vfox-gcloud backend for gcloud by @jdx in
[#7349](#7349)
- convert amplify to use github backend by @jdx in
[#7365](#7365)
- add github backend for djinni tool by @jdx in
[#7363](#7363)
- switch glab to native gitlab backend by @jdx in
[#7364](#7364)
- add s5cmd by @jdx in [#7376](#7376)

### Chore

- **(registry)** disable flaky tests for gitu and ktlint by @jdx in
[64151cb](64151cb)
- resolve clippy warnings and add stricter CI check by @jdx in
[#7367](#7367)
- suppress dead_code warnings in asset_matcher module by @jdx in
[#7377](#7377)

### New Contributors

- @calebhearth made their first contribution in
[#7350](#7350)
jekis913 added a commit to jekis913/mise that referenced this pull request Dec 18, 2025
* upstream/main:
  fix(lockfile): place lockfile alongside config file (jdx#7360)
  feat(alias): rename alias to tool-alias, add shell-alias command (jdx#7357)
  fix(aqua): add start_operations for progress reporting (jdx#7354)
  fix(schema): add `tool_alias`, mark `alias` as deprecated (jdx#7358)
  fix(progress): add start_operations to core plugins (jdx#7351)
  fix(toolset): filter tools by OS in list_current_versions (jdx#7356)
  registry: add vfox-gcloud backend for gcloud (jdx#7349)
  fix(github): improve asset detection for distro-specific and Swift artifacts (jdx#7347)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants