News for hackers. Stuff that matters.
Re:Asdf – An Extendable Version Manager by nikolay on Wednesday February 03, 2021 @04:23PM (#26019303)
I've been using it and has contributed to it, but I wish it supported out of the box GitHub-based release binaries as 90% of my code for different vendors was relatively the same, so, instead of having multiple identical repositories, I created one, which uses introspection [0].

I wish this was available out of the box to handle literary 90% of the tools.

Also, I typically pair it with direnv [1] for even more magic.

[0]: https://github.com/Banno/asdf-hashicorp

[1]: https://direnv.net/

Re:Asdf – An Extendable Version Manager by philsnow on Wednesday February 03, 2021 @10:59PM (#26022417)
Seeing all the love for direnv makes me feel like I'm the only one taking crazy pills.

Direnv breaks referential transparency of the shell. I heavily use my shell history to riff on commandlines I've entered in the past. If direnv is in the mix, my shell pipelines sometimes have to have `cd` in them, often in subshells because that works better for me than pushd/popd.

pyenv/rbenv/asdf do the same thing, but you can have a "global" version pinned and do all your shell-related package installs there, so it doesn't end up being that bad. Though, this still breaks when I happen to be sitting in a directory on my system that has a .python-version file. All of a sudden my "global"ly installed python packages don't work. I greatly prefer tools like pipx / pipsi for this purpose (is there a language-agnostic pipx-alike? or is that nix?) because the shims they install usually work no matter what my shell environment/CWD is.

.... Maybe most of my ire is because my only exposure to direnv is because at least one repo at my day job uses it. For me it's not so much "customize your environment any way you want", it's "oh did you run that command from projectdir/foo instead of projectdir/foo/bar? That doesn't work". Debugging the interactions between people's individual poetry/pipenv/pip/rbenv/direnv/etcetcetc setups and project-based setups is the bane of my work life.

Re:Asdf – An Extendable Version Manager by meatcar on Thursday February 04, 2021 @01:38AM (#26023210)
You can just not hook direnv into your shell, and use `direnv exec` kind of like pipx.

Tools like asdf, direnv, nix-shell, etc. just encapsulate the environment and help set up some guarantees. The referential transparency of shells is something that these tools help enforce, if anything.

I agree that frequent jumping between the fragmented environments is pain point in software development these days. That's due to a lack of tooling to support the new workflow, in my opinion. I hope enough people feel this pain that we see some solutions.

Having an expressive shell like https://starship.rs helps keep you oriented as a sort of HUD. Nix is definitely a life-saver, but you can probably roll your own nix-a-likes. Encapsulate all the "global" precious tools, hardening them against changes in the "local" shell environment. Whether through wrapper scripts, containerization, or what have you, the building blocks are there, the "best practices" are still being created.

Re:Asdf – An Extendable Version Manager by nikolay on Thursday February 04, 2021 @12:55AM (#26023034)
Although I agree in general, direnv is pretty transparent. For example, you need to approve any change in .envrc and it's pretty verbose. It also solves another big issue for me - I no longer have to install globals like with "npm i -g"and I can use "pip install --user" without trading off convenience and using weird relative bin paths!
Re:Asdf – An Extendable Version Manager by mwudka1 on Wednesday February 03, 2021 @05:08PM (#26019804)
Thank you for asdf-hashicorp. We use it at HashiCorp.
Re:Asdf – An Extendable Version Manager by nikolay on Wednesday February 03, 2021 @05:35PM (#26020107)
You're welcome!
Re:Asdf – An Extendable Version Manager by s0l1dsnak3123 on Wednesday February 03, 2021 @07:15PM (#26021010)
I've also written a handful of plugins for asdf, and this is exactly my experience also - I even used the asdf-hashicorp library as the basis for https://github.com/vmware-tanzu/asdf-carvel

Seems like a lot of duplicated work across all these plugins

Re:Asdf – An Extendable Version Manager by dnautics on Wednesday February 03, 2021 @05:48PM (#26020260)
Direnv/asdf is crazy fantastic. I was afraid asdf and direnv would fall into the venv/conda hell that is python, but it. Just. Isn't.
Re:Asdf – An Extendable Version Manager by ahawkins on Wednesday February 03, 2021 @04:47PM (#26019587)
Thank you for asdf-hashicorp. We use it at Skillshare.
Re:Asdf – An Extendable Version Manager by nikolay on Wednesday February 03, 2021 @05:36PM (#26020110)
Thank you! It's nothing special.
Re:Asdf – An Extendable Version Manager by nine_k on Thursday February 04, 2021 @12:20AM (#26022874)
Magic. This is not what I'd like to see around my code and my systems. I'd prefer everything about them to be transparent and explainable.

(My favorite worth-1000-words picture about that is e.g. here: http://www.tshirtvortex.net/free-magic/)

Re:Asdf – An Extendable Version Manager by burlesona on Wednesday February 03, 2021 @04:27PM (#26019352)
Thanks for sharing direnv, I didn’t know about that but I’ve wished for it before. Great find :)
Re:Asdf – An Extendable Version Manager by fiddlerwoaroof on Wednesday February 03, 2021 @07:33PM (#26021135)
I use nix/direnv/lorri to manage all my projects. It’s easily the best def experience, once you get over the learning curve for nix.
Re:Asdf – An Extendable Version Manager by nikolay on Wednesday February 03, 2021 @05:36PM (#26020112)
It's a gem, really.
Re:Asdf – An Extendable Version Manager by johnwyles on Wednesday February 03, 2021 @08:07PM (#26021359)
Can this replace the broken and horrible tools of rbenv, pyenv, and pipenv? I shudder whenever a new version comes out what it does to my shell when I have a broken version (included as the latest from the output from pyenv globals or some such)
Re:Asdf – An Extendable Version Manager by frizkie on Wednesday February 03, 2021 @09:54PM (#26022044)
I'm not understanding what you mean about *env. I use rbenv and I'm a maintainer of crenv for Crystal, I never have any issues with how they are implemented.

Can you be more specific? Maybe something's broken.

Re:Asdf – An Extendable Version Manager by BerislavLopac on Thursday February 04, 2021 @12:36AM (#26022950)
pyenv and pipenv are two very different things. pipenv is desperately broken, and should be avoided; Poetry is one good alternative. pyenv, on the other hand, is great.