aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mason-core/installer
Commit message (Collapse)AuthorAgeFilesLines
* feat(compiler): make `supported_platforms` a universal source field (#2002)William Boman2025-08-074-20/+0
| | | | | | 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(pypi): pass --no-user flag (#1958)William Boman2025-05-191-0/+4
| | | Fixes #1937.
* docs: update references to mason-org/mason.nvim (#1925)William Boman2025-05-061-4/+4
|
* feat: associate package instances with registry source and record it in receiptWilliam Boman2025-05-061-0/+5
|
* refactor(registry): change lua registries to not instantiate Package themselvesWilliam Boman2025-05-022-9/+0
| | | | | | | | Instead of having Lua registries instantiate package instances themselves we now do it in the installer of Lua registry sources. This aligns the behaviour of the Lua registry protocol with the other registry protocols.
* feat(context): add ctx:await()William Boman2025-02-191-0/+37
|
* refactor: turn StdioSink into a proper classWilliam Boman2025-02-1910-17/+43
|
* fix(expr): also interpolate table keysWilliam Boman2025-02-191-0/+13
|
* refactor!: change Package APIWilliam Boman2025-02-1922-182/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+0
|
* refactor: standardize constructors and improve inheritance constructionWilliam Boman2025-02-192-33/+33
|
* feat(linker): use relative targets for symlinks (#1525)William Boman2025-02-191-19/+14
| | | | Closes #1156.
* refactor(path): use InstallLocation to produce paths, remove static path methodsWilliam Boman2025-02-191-30/+30
|
* refactor(installer): move initializations to InstallContext constructorWilliam Boman2025-02-192-2/+1
|
* refactor: add InstallLocation.global()William Boman2025-02-191-12/+12
|
* chore(compilers): remove default environment from github build compilerWilliam Boman2025-02-192-4/+4
|
* refactor!: refactor installer internals and add new Package class methods ↵William Boman2025-02-1935-628/+914
| | | | | | | | | | | | | | | | | | | (#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-161-3/+2
|
* refactor!: consolidate Lua registry sources and the Package API (#1498)William Boman2025-02-161-40/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **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-162-5/+94
|
* fix(pypi): prefer stock python3 if it satisfies version requirement (#1736)Inhyuk Cho2024-07-091-0/+30
|
* tests(pypi): fix assertions (#1750)William Boman2024-07-081-0/+2
|
* fix(pypi): allow access to system site packages by default (#1584)Silico_Biomancer2024-07-071-0/+6
| | | Co-authored-by: William Boman <william@redwill.se>
* feat(pypi): improve resolving suitable python version (#1725)William Boman2024-06-012-2/+108
|
* fix(pypi): exclude python3.12 from candidate list (#1722)William Boman2024-05-311-1/+1
| | | Support for python3.12 among pypi packages is pretty poor, this limits the upper bound to python3.11 instead.
* tests: remove old spec (#1634)William Boman2024-02-251-70/+0
|
* feat(pypi): attempt more python3 candidates (#1608)William Boman2024-01-251-0/+7
|
* feat: add support for openvsx sources (#1589)William Boman2024-01-068-121/+361
|
* fix(cargo): don't attempt to fetch versions when version targets commit SHA ↵William Boman2023-12-291-0/+12
| | | | (#1585)
* fix(pypi): support MSYS2 virtual environments on Windows (#1547)William Boman2023-11-082-1/+14
|
* fix(std): use gtar if available (#1433)3uryd1ce2023-08-191-49/+70
| | | Closes #1415.
* feat(cargo): support fetching versions for git crates hosted on github (#1459)William Boman2023-08-191-0/+20
|
* fix(installer): retain unmapped source fields (#1399)William Boman2023-07-212-0/+34
| | | Fixes #1398.
* feat(installer): write more installation output to stdout (#1376)William Boman2023-06-289-10/+116
| | | This should give better insights into the installation progress.
* refactor(installer): hoist version validation to the compiled installation ↵William Boman2023-06-178-174/+88
| | | | entrypoint (#1357)
* feat(installer): lock package installation (#1290)William Boman2023-05-181-0/+44
|
* fix(pypi): also provide install_extra_args to pypi.install (#1263)William Boman2023-04-261-1/+5
| | | Closes #1224.
* fix(context): don't write exec wrapper file if it already exists (#1261)William Boman2023-04-261-0/+44
|
* refactor(linker): copy_file instead of rename on Windows (#1254)William Boman2023-04-231-7/+8
| | | | | | | | Renaming the file will move it from its original installation directory. While reaching into package installation directories is unsupported and not recommended, it seems to be done pretty broadly. In order to avoid unnecessarily breaking people's configs we copy the file instead, for now. (tip: use the stable locations inside $MASON/share $MASON/opt $MASON/bin, if a package is missing a link please open an issue/PR). This will be reversed back to use uv_fs_rename() in 1.x.x.
* fix(linker): don't symlink on Windows (#1253)William Boman2023-04-231-2/+54
| | | | | | | | | | | | | | | | | 1) FAT (FAT32, exFAT, etc.) file systems doesn't support symlinks. 2) You need administrator access in order to create symlinks. This was working for me locally because I'm running a NTFS fs with "Developer Mode" enabled in Windows 10, which bypasses administrator requirement for mklink. Instead we uv_fs_rename() links. This should effectively be the same, but will require special handling down the road if/when for example multiple package versions can be installed at the same time. When unlinking a package the renamed files should me moved back into the package installation directory, instead of simply being unlinked (i.e. removed). Closes #1251.
* fix(expr): fix strip_{prefix,suffix} (#1249)William Boman2023-04-221-0/+20
|
* refactor(schemas): don't vendor schemas in mason.nvim (#1248)William Boman2023-04-221-4/+14
| | | | | Instead, schemas are now defined in the package registry and downloaded during installation. See https://github.com/mason-org/mason-registry/pull/1319.
* feat(installer): add generic build provider (#1228)William Boman2023-04-186-53/+371
|
* refactor(expr): remove redundant core filters and always stringify reduced ↵William Boman2023-04-181-0/+101
| | | | | value (#1227) The removed filters are not used by mason-registry and are too Lua-specific in nature.
* feat(github): add $MASON_VERSION to build context (#1218)William Boman2023-04-161-1/+7
|
* fix(github): use evaluated out_file as asset file value (#1208)William Boman2023-04-121-1/+63
| | | | | | | | | | | | | | | | | This makes it so that after parsing the source, the `{{source.asset.file}}` context value points to the downloaded file, rather than the raw value. This is helpful for source definitions such as: ```yaml source: id: pkg:github/mrjosh/helm-ls@v0.0.3 asset: - target: win_x64 file: helm_ls_windows_amd64:helm_ls_windows_amd64.exe # … bin: # This now evaluates to "helm_ls_windows_amd64.exe" rather than "helm_ls_windows_amd64:helm_ls_windows_amd64.exe". helm_ls: "{{source.asset.file}}" ```
* refactor(std): quiet git checkout (#1186)William Boman2023-04-061-1/+1
|
* fix(npm): set install-strategy on npm >= 9 (#1179)William Boman2023-04-041-1/+29
| | | Closes #1175.
* style: enforce import order (#1092)William Boman2023-03-1227-63/+63
| | | | | * chore(workflows): update dependencies * style: enforce import order
* feat: add github registry source capabilities (#1091)William Boman2023-03-1225-2/+2344
|