Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkgx --ensure make uses the system make if poss #1133

Merged
merged 1 commit into from
Feb 24, 2025
Merged

pkgx --ensure make uses the system make if poss #1133

merged 1 commit into from
Feb 24, 2025

Conversation

mxcl
Copy link
Member

@mxcl mxcl commented Feb 24, 2025

No description provided.

@mxcl mxcl changed the title pkgx --ensure make, uses the system make if poss pkgx --ensure make uses the system make if poss Feb 24, 2025
@mxcl mxcl force-pushed the ensure branch 2 times, most recently from 2b748cd to 17b48fa Compare February 24, 2025 19:11
@coveralls
Copy link

Coverage Status

coverage: 89.373% (-1.0%) from 90.34%
when pulling bc9be97 on ensure
into 118c17e on main.

@mxcl
Copy link
Member Author

mxcl commented Feb 24, 2025

There are edge cases that this does not handle, ottomh: pkgx -e +git would not work.

Also, importantly, pkgx -e deno^2 will not check the version of the thing we are ensuring. So maybe this should not be added in fact.

A mash script would be fairly trivial to write and would at least make it clear that the feature is more flakey.

@mxcl mxcl merged commit 17e3e61 into main Feb 24, 2025
18 checks passed
@mxcl mxcl deleted the ensure branch February 24, 2025 20:16
@jhheider
Copy link
Contributor

jhheider commented Feb 24, 2025

Also, importantly, pkgx -e deno^2 will not check the version of the thing we are ensuring. So maybe this should not be added in fact.

this could range from easy to fully impossible to ensure, depending on the package in question. even parsing and hoping if the package supports --version|-V would be fraught.

which suggests that maybe this should take a [binname] rather than a [pkgspec]. at least ensuring a binary is on the path is reasonably trivial.

$ pkgx --ensure=make,git,clang make foo

@mxcl
Copy link
Member Author

mxcl commented Feb 24, 2025

We could add something to package.yml to parse versions but that’s a lot of additional metadata for a feature that is only “nice”. So yeah your suggestion is better, though I am leaning towards this should be a mash script.

$ pkgx mash pkgx/fallback git clone […]

@jhheider
Copy link
Contributor

it's a lot of additional characters, but since it's maximally useful in scripts and README's, it's far from impossible.

@mxcl
Copy link
Member Author

mxcl commented Feb 24, 2025

Additionally, foo --version is hardly a well defined API though we could mandate a check when we build new versions to ensure we still can parse it ofc.

@mxcl
Copy link
Member Author

mxcl commented Feb 26, 2025

k I added mash pkgx/ensure, usage:

$ mash pkgx/ensure git --version
$ eval "$(mash pkgx/ensure +git)"

So I will revert this due to it not being possible to do properly with the full range of pkgx use. The mash script is much simpler too.

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.

3 participants