Skip to content

Commit 6d5ea67

Browse files
author
Rahul Iyer
committed
Merge branch 'main' into feat/1888/pnpm-installer
2 parents 85a0d50 + 57e5a8a commit 6d5ea67

File tree

22 files changed

+181
-113
lines changed

22 files changed

+181
-113
lines changed

.github/workflows/cbfmt.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Download Shellharden
2626
run: |
2727
mkdir /tmp/shellharden && cd $_
28-
curl -fsSL -o shellharden.tar.gz https://github.com/alsuren/cargo-quickinstall/releases/download/shellharden-4.2.0-x86_64-unknown-linux-gnu/shellharden-4.2.0-x86_64-unknown-linux-gnu.tar.gz
28+
curl -fsSL -o shellharden.tar.gz https://github.com/anordal/shellharden/releases/download/v4.3.1/shellharden-x86_64-unknown-linux-gnu.tar.gz
2929
tar -xvf shellharden.tar.gz
3030
mv shellharden /usr/local/bin/
3131
- name: Run cbfmt check

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Changelog
22

3+
## [2.1.0](https://github.com/mason-org/mason.nvim/compare/v2.0.1...v2.1.0) (2025-09-30)
4+
5+
6+
### Features
7+
8+
* **compiler:** make `supported_platforms` a universal source field ([#2002](https://github.com/mason-org/mason.nvim/issues/2002)) ([7dc4fac](https://github.com/mason-org/mason.nvim/commit/7dc4facca9702f95353d5a1f87daf23d78e31c2a))
9+
10+
11+
### Bug Fixes
12+
13+
* **process:** close check handles ([#1995](https://github.com/mason-org/mason.nvim/issues/1995)) ([a1fbecc](https://github.com/mason-org/mason.nvim/commit/a1fbecc0fd76300e8fe84879fb1531f35cf7b018))
14+
* **pypi:** add support for "compatible release" (~=) PEP440 expressions ([#2000](https://github.com/mason-org/mason.nvim/issues/2000)) ([9e25c98](https://github.com/mason-org/mason.nvim/commit/9e25c98d4826998460926f8c5c2284848d80ae89))
15+
* **spawn:** always expand executable path on Windows ([#2021](https://github.com/mason-org/mason.nvim/issues/2021)) ([a83eabd](https://github.com/mason-org/mason.nvim/commit/a83eabdc8c49c0c93bf5bb162fa3b57404a9d095))
16+
* **ui:** only set border to none if `'winborder'` doesn't exist ([#1984](https://github.com/mason-org/mason.nvim/issues/1984)) ([3671ab0](https://github.com/mason-org/mason.nvim/commit/3671ab0d40aa5bd24b1686562bd0a23391ecf76a))
17+
18+
## [2.0.1](https://github.com/mason-org/mason.nvim/compare/v2.0.0...v2.0.1) (2025-07-25)
19+
20+
21+
### Bug Fixes
22+
23+
* **fetch:** add busybox wget support ([#1829](https://github.com/mason-org/mason.nvim/issues/1829)) ([8024d64](https://github.com/mason-org/mason.nvim/commit/8024d64e1330b86044fed4c8494ef3dcd483a67c))
24+
* **pypi:** pass --no-user flag ([#1958](https://github.com/mason-org/mason.nvim/issues/1958)) ([1aceba8](https://github.com/mason-org/mason.nvim/commit/1aceba8bc158b5aaf90649077cad06744bc23ac4))
25+
* **registry:** ensure there's no duplicate registry entries ([#1957](https://github.com/mason-org/mason.nvim/issues/1957)) ([3501b0f](https://github.com/mason-org/mason.nvim/commit/3501b0f96d9f2f878b1947cf3614bc02d053a0c0))
26+
* **spawn:** fix calling vim.fn when inside fast event loop on Windows ([#1950](https://github.com/mason-org/mason.nvim/issues/1950)) ([888d6ee](https://github.com/mason-org/mason.nvim/commit/888d6ee499d8089a3a4be4309d239d6be1c1e6c0))
27+
* **spawn:** fix locating exepath on Windows systems using a Unix `'shell'` ([#1991](https://github.com/mason-org/mason.nvim/issues/1991)) ([edd8f7b](https://github.com/mason-org/mason.nvim/commit/edd8f7bce8f86465349b24e235718eb3ea52878d))
28+
329
## [2.0.0](https://github.com/mason-org/mason.nvim/compare/v1.11.0...v2.0.0) (2025-05-06)
430

531
This release has been an ongoing effort for quite some time now and is now ready for release. Most users should not

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<code>:help mason.nvim</code>
1717
</p>
1818
<p align="center">
19-
<sup>Latest version: v2.0.0</sup> <!-- x-release-please-version -->
19+
<sup>Latest version: v2.1.0</sup> <!-- x-release-please-version -->
2020
</p>
2121

2222
## Table of Contents

lua/mason-core/fs.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ local function make_module(uv)
7878
end
7979
end
8080

81+
---@param path string
82+
function M.rmdir(path)
83+
log.debug("fs: rmdir", path)
84+
uv.fs_rmdir(path)
85+
end
86+
8187
---@param path string
8288
---@param new_path string
8389
function M.rename(path, new_path)

lua/mason-core/installer/InstallHandle.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ function InstallHandle:terminate()
173173
end
174174
end
175175
check:stop()
176+
check:close()
176177
if not self:is_closed() then
177178
self:close()
178179
end

lua/mason-core/installer/compiler/compilers/cargo.lua

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,37 @@
11
local Result = require "mason-core.result"
22
local _ = require "mason-core.functional"
33
local providers = require "mason-core.providers"
4-
local util = require "mason-core.installer.compiler.util"
54

65
local M = {}
76

87
---@class CargoSource : RegistryPackageSource
9-
---@field supported_platforms? string[]
108

119
---@param source CargoSource
1210
---@param purl Purl
1311
function M.parse(source, purl)
14-
return Result.try(function(try)
15-
if source.supported_platforms then
16-
try(util.ensure_valid_platform(source.supported_platforms))
17-
end
18-
19-
local repository_url = _.path({ "qualifiers", "repository_url" }, purl)
12+
local repository_url = _.path({ "qualifiers", "repository_url" }, purl)
2013

21-
local git
22-
if repository_url then
23-
git = {
24-
url = repository_url,
25-
rev = _.path({ "qualifiers", "rev" }, purl) == "true",
26-
}
27-
end
14+
local git
15+
if repository_url then
16+
git = {
17+
url = repository_url,
18+
rev = _.path({ "qualifiers", "rev" }, purl) == "true",
19+
}
20+
end
2821

29-
---@type string?
30-
local features = _.path({ "qualifiers", "features" }, purl)
31-
local locked = _.path({ "qualifiers", "locked" }, purl)
22+
---@type string?
23+
local features = _.path({ "qualifiers", "features" }, purl)
24+
local locked = _.path({ "qualifiers", "locked" }, purl)
3225

33-
---@class ParsedCargoSource : ParsedPackageSource
34-
local parsed_source = {
35-
crate = purl.name,
36-
version = purl.version,
37-
features = features,
38-
locked = locked ~= "false",
39-
git = git,
40-
}
41-
return parsed_source
42-
end)
26+
---@class ParsedCargoSource : ParsedPackageSource
27+
local parsed_source = {
28+
crate = purl.name,
29+
version = purl.version,
30+
features = features,
31+
locked = locked ~= "false",
32+
git = git,
33+
}
34+
return Result.success(parsed_source)
4335
end
4436

4537
---@async

lua/mason-core/installer/compiler/compilers/gem.lua

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
local Result = require "mason-core.result"
22
local _ = require "mason-core.functional"
33
local providers = require "mason-core.providers"
4-
local util = require "mason-core.installer.compiler.util"
54

65
local M = {}
76

87
---@class GemSource : RegistryPackageSource
9-
---@field supported_platforms? string[]
108
---@field extra_packages? string[]
119

1210
---@param source GemSource
1311
---@param purl Purl
1412
function M.parse(source, purl)
15-
return Result.try(function(try)
16-
if source.supported_platforms then
17-
try(util.ensure_valid_platform(source.supported_platforms))
18-
end
19-
20-
---@class ParsedGemSource : ParsedPackageSource
21-
local parsed_source = {
22-
package = purl.name,
23-
version = purl.version,
24-
extra_packages = source.extra_packages,
25-
}
26-
return parsed_source
27-
end)
13+
---@class ParsedGemSource : ParsedPackageSource
14+
local parsed_source = {
15+
package = purl.name,
16+
version = purl.version,
17+
extra_packages = source.extra_packages,
18+
}
19+
return Result.success(parsed_source)
2820
end
2921

3022
---@async

lua/mason-core/installer/compiler/compilers/pypi.lua

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,28 @@ local Result = require "mason-core.result"
22
local _ = require "mason-core.functional"
33
local providers = require "mason-core.providers"
44
local settings = require "mason.settings"
5-
local util = require "mason-core.installer.compiler.util"
65

76
local M = {}
87

98
---@class PypiSource : RegistryPackageSource
109
---@field extra_packages? string[]
11-
---@field supported_platforms? string[]
1210

1311
---@param source PypiSource
1412
---@param purl Purl
1513
function M.parse(source, purl)
16-
return Result.try(function(try)
17-
if source.supported_platforms then
18-
try(util.ensure_valid_platform(source.supported_platforms))
19-
end
20-
21-
---@class ParsedPypiSource : ParsedPackageSource
22-
local parsed_source = {
23-
package = purl.name,
24-
version = purl.version --[[ @as string ]],
25-
extra = _.path({ "qualifiers", "extra" }, purl),
26-
extra_packages = source.extra_packages,
27-
pip = {
28-
upgrade = settings.current.pip.upgrade_pip,
29-
extra_args = settings.current.pip.install_args,
30-
},
31-
}
32-
33-
return parsed_source
34-
end)
14+
---@class ParsedPypiSource : ParsedPackageSource
15+
local parsed_source = {
16+
package = purl.name,
17+
version = purl.version --[[ @as string ]],
18+
extra = _.path({ "qualifiers", "extra" }, purl),
19+
extra_packages = source.extra_packages,
20+
pip = {
21+
upgrade = settings.current.pip.upgrade_pip,
22+
extra_args = settings.current.pip.install_args,
23+
},
24+
}
25+
26+
return Result.success(parsed_source)
3527
end
3628

3729
---@async

lua/mason-core/installer/compiler/init.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ end
7272

7373
---@param source RegistryPackageSource
7474
---@param version string?
75+
---@return RegistryPackageSource
7576
local function coalesce_source(source, version)
7677
if version and source.version_overrides then
7778
for i = #source.version_overrides, 1, -1 do
@@ -117,6 +118,10 @@ function M.parse(spec, opts)
117118

118119
local source = coalesce_source(spec.source, opts.version)
119120

121+
if source.supported_platforms then
122+
try(util.ensure_valid_platform(source.supported_platforms))
123+
end
124+
120125
---@type Purl
121126
local purl = try(Purl.parse(source.id))
122127
log.trace("Parsed purl.", source.id, purl)

lua/mason-core/installer/context/init.lua

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,19 @@ function InstallContext:promote_cwd()
8686
-- 2. Prepare for renaming cwd to destination
8787
if platform.is.unix then
8888
-- Some Unix systems will raise an error when renaming a directory to a destination that does not already exist.
89-
fs.async.mkdir(install_path)
89+
fs.sync.mkdir(install_path)
9090
end
91-
-- 3. Update cwd
91+
-- 3. Move the cwd to the final installation directory
92+
local rename_success, rename_err = pcall(fs.sync.rename, cwd, install_path)
93+
if not rename_success then
94+
-- On some file systems, we cannot create the directory before renaming. Therefore, remove it and then rename.
95+
log.trace("Call to uv_fs_rename() while promoting cwd failed.", rename_err)
96+
fs.sync.rmdir(install_path)
97+
assert(fs.sync.dir_exists(cwd), "Current working directory no longer exists after retrying uv_fs_rename().")
98+
fs.sync.rename(cwd, install_path)
99+
end
100+
-- 4. Update cwd
92101
self.cwd:set(install_path)
93-
-- 4. Move the cwd to the final installation directory
94-
fs.async.rename(cwd, install_path)
95102
end
96103

97104
---@param rel_path string The relative path from the current working directory to change cwd to. Will only restore to the initial cwd after execution of fn (if provided).

0 commit comments

Comments
 (0)