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

Add a new asdf direnv install command #180

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Conversation

jfly
Copy link
Contributor

@jfly jfly commented Aug 23, 2023

Before this diff, it was difficult to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

$ asdf install poetry 1.5.1
No version is set for command python3
Consider adding one of the following versions in your config file at
python 3.10.2
python 3.8.10
curl: (23) Failure writing output to destination

Cleanup: Something went wrong!

48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global python or
python3. While I could install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see this poetry
issue

and this homebrew issue).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since homebrew
changed they way they build binaries, which broke poetry
install
.

As a happy side effect, we can now run direnv reload for the user,
which saves them a step whenever they need to install missing
dependencies.

@jfly jfly requested a review from a team as a code owner August 23, 2023 00:27
@jfly jfly force-pushed the jfly/add-asdf-direnv-install branch 2 times, most recently from 2a8ebfa to 9d6c88c Compare August 23, 2023 00:29
@jfly jfly mentioned this pull request Aug 23, 2023
Before this diff, it was difficult to install tools that depend on
other tools. For example, here's what happens if I try to install a
version of poetry on my machine:

    $ asdf install poetry 1.5.1
    No version is set for command python3
    Consider adding one of the following versions in your config file at
    python 3.10.2
    python 3.8.10
    curl: (23) Failure writing output to destination

    Cleanup: Something went wrong!

    48 /home/jeremy/.asdf/plugins/poetry/bin/install: POETRY_HOME=$install_path python3 - --version "$version" $flags

This is because my system doesn't actually have a global `python` or
`python3`. While I *could* install python with my system's package
manager, I'd rather re-use my asdf-managed python if at all possible.
Plus, poetry's installer doesn't even work with the 2 most popular ways
of installing python systemwide on macOS (see [this poetry
issue](python-poetry/install.python-poetry.org#24 (comment))
and [this homebrew issue](Homebrew/homebrew-core#138159)).

I know this doesn't solve the general build-dependencies issue: asdf is
not a full package manager and I doubt it ever will become one. I do
think this fairly minor change is worth implementing though, as it will
solve a pain point my team has started running into ever since [homebrew
changed they way they build binaries, which broke poetry
install](Homebrew/homebrew-core#138159).

As a happy side effect, we can now run `direnv reload` for the user,
which saves them a step whenever they need to install missing
dependencies.
@jfly jfly force-pushed the jfly/add-asdf-direnv-install branch from 9d6c88c to c9ff9dc Compare August 23, 2023 00:39
@jfly
Copy link
Contributor Author

jfly commented Nov 20, 2023

We've been running with this for a few months @joinhonor and it works. I'm going to merge this up.

@jfly jfly merged commit a2219c2 into master Nov 20, 2023
13 checks passed
@jfly jfly deleted the jfly/add-asdf-direnv-install branch November 20, 2023 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant