aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/installer/registry/link.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-06-28 22:00:41 +0200
committerGitHub <noreply@github.com>2023-06-28 22:00:41 +0200
commit10da1a33b4ac24ad4d76a9af91871720ac6b65e4 (patch)
tree585133a0afd288f349802ae65726e59ab6e1efab /lua/mason-core/installer/registry/link.lua
parentchore(main): release 1.5.0 (#1375) (diff)
downloadmason-10da1a33b4ac24ad4d76a9af91871720ac6b65e4.tar
mason-10da1a33b4ac24ad4d76a9af91871720ac6b65e4.tar.gz
mason-10da1a33b4ac24ad4d76a9af91871720ac6b65e4.tar.bz2
mason-10da1a33b4ac24ad4d76a9af91871720ac6b65e4.tar.lz
mason-10da1a33b4ac24ad4d76a9af91871720ac6b65e4.tar.xz
mason-10da1a33b4ac24ad4d76a9af91871720ac6b65e4.tar.zst
mason-10da1a33b4ac24ad4d76a9af91871720ac6b65e4.zip
fix(linker): ensure exec wrapper target is executable (#1380)
Fixes #1368.
Diffstat (limited to 'lua/mason-core/installer/registry/link.lua')
-rw-r--r--lua/mason-core/installer/registry/link.lua20
1 files changed, 1 insertions, 19 deletions
diff --git a/lua/mason-core/installer/registry/link.lua b/lua/mason-core/installer/registry/link.lua
index 108c4233..85e751b7 100644
--- a/lua/mason-core/installer/registry/link.lua
+++ b/lua/mason-core/installer/registry/link.lua
@@ -129,24 +129,6 @@ local bin_delegates = {
end,
}
----@async
----@param ctx InstallContext
----@param target string
-local function chmod_exec(ctx, target)
- local bit = require "bit"
- -- see chmod(2)
- local USR_EXEC = 0x40
- local GRP_EXEC = 0x8
- local ALL_EXEC = 0x1
- local EXEC = bit.bor(USR_EXEC, GRP_EXEC, ALL_EXEC)
- local fstat = ctx.fs:fstat(target)
- if bit.band(fstat.mode, EXEC) ~= EXEC then
- local plus_exec = bit.bor(fstat.mode, EXEC)
- log.fmt_debug("Setting exec flags on file %s %o -> %o", target, fstat.mode, plus_exec)
- ctx.fs:chmod(target, plus_exec) -- chmod +x
- end
-end
-
---Expands bin specification from spec and registers bins to be linked.
---@async
---@param ctx InstallContext
@@ -187,7 +169,7 @@ local function expand_bin(ctx, spec, purl, source)
end
if platform.is.unix then
- chmod_exec(ctx, target)
+ ctx.fs:chmod_exec(target)
end
expanded_bin_table[bin] = target