aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/installer
Commit message (Collapse)AuthorAgeFilesLines
* fix(installer): update cwd after uv_fs_rename() was successful (#2033)HEADmainWilliam Boman2025-11-141-8/+8
| | | | Also moves to fs.sync calls over fs.async to avoid unnecessary async coroutine overhead.
* fix(installer): attempt to recover from known fs error while finalizing ↵Sam-Briney2025-11-141-1/+8
| | | | | installation on some file systems (#1933) Co-authored-by: William Boman <william@redwill.se>
* feat(compiler): make `supported_platforms` a universal source field (#2002)William Boman2025-08-074-63/+44
| | | | | | Previously this field had to be handled separately in each source type. This backwards-compatible change makes `supported_platforms` a universal top-level field on the `source:` object, meaning it'll be parsed for each source type.
* fix(process): close check handles (#1995)Mirek Długosz2025-07-281-0/+1
|
* fix(pypi): pass --no-user flag (#1958)William Boman2025-05-191-0/+1
| | | Fixes #1937.
* feat: associate package instances with registry source and record it in receiptWilliam Boman2025-05-061-0/+1
|
* refactor(command): use callback in Package:install() when running ↵William Boman2025-03-031-1/+1
| | | | :MasonInstall in headless mode
* fix(uninstaller): only unlink if recipt is foundWilliam Boman2025-03-031-1/+2
|
* refactor(registry): refactor registry initializationWilliam Boman2025-03-031-3/+2
|
* style: fix stylua and selene errorsWilliam Boman2025-02-201-1/+0
|
* feat(context): add ctx:await()William Boman2025-02-191-0/+6
|
* refactor: turn StdioSink into a proper classWilliam Boman2025-02-1916-67/+45
|
* feat(context): add ctx:fetch()William Boman2025-02-191-0/+12
|
* fix(expr): also interpolate table keysWilliam Boman2025-02-191-0/+3
|
* refactor!: change Package APIWilliam Boman2025-02-1915-130/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the following public APIs: **(_breaking_) Events on the `Package` class** The `uninstall:success` event on the `Package` class now receives an `InstallReceipt` as argument, instead of an `InstallHandle`. This receipt is an in-memory representation of what was uninstalled. There's also a new `uninstall:failed` event for situations where uninstallation for some reason fails. Note: this also applies to the registry events (i.e. `package:uninstall:success` and `package:uninstall:failed`). --- **(_breaking_) `Package:uninstall()` is now asynchronous and receives two new arguments, similarly to `Package:install()`** While package uninstallations remain synchronous under the hood, the public API has been changed from synchronous -> asynchronous. Users of this method are recommended to provide a callback in situations where code needs to execute after uninstallation fully completes. --- **(_breaking_) `Package:get_install_path()` has been removed. --- **`Package:install()` now takes an optional callback** This callback allows consumers to be informed whether installation was successful or not without having to go through a different, low-level, API. See below for a comparison between the old and new APIs: ```lua -- before local handle = pkg:install() handle:once("closed", function () -- ... end) -- after pkg:install({}, function (success, result) -- ... end) ```
* fix(pypi): remove -U flag and fix log messageWilliam Boman2025-02-191-2/+1
|
* refactor: standardize constructors and improve inheritance constructionWilliam Boman2025-02-197-47/+69
|
* fix(location): use correct registry pathWilliam Boman2025-02-191-1/+1
|
* feat(linker): use relative targets for symlinks (#1525)William Boman2025-02-191-7/+9
| | | | Closes #1156.
* refactor(path): use InstallLocation to produce paths, remove static path methodsWilliam Boman2025-02-193-14/+60
|
* refactor(installer): move initializations to InstallContext constructorWilliam Boman2025-02-194-21/+23
|
* refactor: add InstallLocation.global()William Boman2025-02-191-0/+5
|
* chore: remove todo commentWilliam Boman2025-02-191-1/+0
| | | | Using sync is actually preferable here (and likely in many other places) to avoid async context & continuation overhead.
* chore(compilers): remove default environment from github build compilerWilliam Boman2025-02-191-7/+1
|
* refactor!: refactor installer internals and add new Package class methods ↵William Boman2025-02-1930-509/+611
| | | | | | | | | | | | | | | | | | | (#1523) This contains the following changes: 1) `Package:install()` now accepts a second, optional, callback argument which is called when installation finishes (successfully or not). 2) Adds a `Package:is_installing()` method. This contains the following breaking changes: 1) `Package:install()` will now error when called while an installation is already ongoing. Use the new `Package:is_installing()` method to check whether an installation is already running. This also refactors large portions of the tests by removing test globals, removing async_test, and adding the `mason-test` Lua module instead. Test helpers via globals are problematic to work with due to not being detected through tools like the Lua language server without additional configuration. This has been replaced with a Lua module `mason-test`. `async_test` has also been removed in favour of explicitly making use of the `mason-core.async` API. These changes stands for a significant portion of the diff.
* refactor(receipt): change receipt structure and remove old builder APIs (#1521)William Boman2025-02-163-9/+6
|
* fix(installer): schedule back to main loop before executing installer ↵William Boman2025-02-161-0/+1
| | | | functions (#1516)
* refactor!: consolidate Lua registry sources and the Package API (#1498)William Boman2025-02-164-21/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **This removes the following APIs:** - `Package:check_new_version()`. Instead use the new `Package:get_latest_version()`. **This has a breaking change in the following APIs:** - `Package:get_installed_version()` now no longer takes a callback but instead returns the installed version or `nil` if not installed. <details> <summary>To handle these breaking changes in plugins, leverage the `mason.version` module, for example:</summary> ```lua local mason_version = require("mason.version") local registry = require("mason-registry") local pkg = registry.get_package("rust-analyzer") if mason_version.MAJOR_VERSION < 2 then -- before pkg:check_new_version(function (success, new_version) -- … end) pkg:get_installed_version(function (success, installed_version) -- … end) else -- after local new_version = pkg:get_latest_version() local installed_version = pkg:get_installed_version() fi ``` </details> --- <details> <summary>This change also introduces breaking changes for Lua registry sources, by consolidating the package schema with the registry.</summary> The following is an example of a package defined in a Lua registry, following the new schema: ```lua local Pkg = require("mason-core.package") return Pkg.new { schema = "registry+v1", name = "ripgrep", description = "ripgrep recursively searches directories for a regex pattern while respecting your gitignore.", homepage = "https://github.com/BurntSushi/ripgrep", licenses = { Pkg.License.MIT }, languages = {}, categories = {}, source = { id = "pkg:mason/ripgrep@13.0.0", ---@param ctx InstallContext ---@param purl Purl install = function(ctx, purl) -- Arbitrary installation code. end, }, bin = { rg = "./bin/rg", }, } ``` </details>
* refactor!: remove old managers (#1497)William Boman2025-02-165-7/+58
|
* fix(pypi): prefer stock python3 if it satisfies version requirement (#1736)Inhyuk Cho2024-07-091-2/+4
|
* fix(pypi): allow access to system site packages by default (#1584)Silico_Biomancer2024-07-071-1/+2
| | | Co-authored-by: William Boman <william@redwill.se>
* feat(pypi): improve resolving suitable python version (#1725)William Boman2024-06-012-17/+75
|
* fix(pypi): exclude python3.12 from candidate list (#1722)William Boman2024-05-311-1/+0
| | | Support for python3.12 among pypi packages is pretty poor, this limits the upper bound to python3.11 instead.
* fix: fix usage of deprecated Neovim APIs (#1703)William Boman2024-05-112-2/+2
|
* fix(pypi): fix variable shadowing (#1610)William Boman2024-01-291-1/+3
|
* feat(pypi): attempt more python3 candidates (#1608)William Boman2024-01-251-12/+59
|
* fix(golang): fix fetching package versions for packages containing subpath ↵William Boman2024-01-221-1/+1
| | | | specifier (#1607)
* feat: don't use vim.g.python3_host_prog as a candidate for python (#1606)William Boman2024-01-211-7/+1
| | | | This is inconsistent with how other system dependencies are resolved and is not documented anywhere.
* feat: add support for openvsx sources (#1589)William Boman2024-01-0611-143/+225
|
* fix(cargo): don't attempt to fetch versions when version targets commit SHA ↵William Boman2023-12-291-0/+7
| | | | (#1585)
* fix(pypi): support MSYS2 virtual environments on Windows (#1547)William Boman2023-11-081-17/+26
|
* chore: decrease log level (#1467)William Boman2023-08-251-1/+1
|
* fix(std): use gtar if available (#1433)3uryd1ce2023-08-191-1/+4
| | | Closes #1415.
* feat(cargo): support fetching versions for git crates hosted on github (#1459)William Boman2023-08-191-0/+14
|
* chore(logging): fix log string (#1444)William Boman2023-08-091-1/+1
|
* fix(installer): retain unmapped source fields (#1399)William Boman2023-07-211-2/+1
| | | Fixes #1398.
* fix(linker): ensure exec wrapper target is executable (#1380)William Boman2023-06-282-19/+21
| | | Fixes #1368.
* feat(installer): write more installation output to stdout (#1376)William Boman2023-06-2811-4/+19
| | | This should give better insights into the installation progress.
* chore(ci): upgrade linter versions (#1377)William Boman2023-06-281-10/+16
|
* fix(installer): timeout schema download after 5s (#1374)William Boman2023-06-281-1/+10
| | | Closes #1361.