by AndyKelley · 2y ago · 0 comments
This is not an acceptable way to install anything on Linux. If you want to target Linux users you can't distribute with a shell script for installation.
I get that the idea is to reduce friction to installation and trying it out, but most Linux users - the ones you want filing bug reports anyway - are ones who will do due diligence and inspect the shell script to see what kind of opinions it makes about how to install the software.
For example, I see that the shell script downloads a tarball and unpacks it to `~/.local`, then tries to mess with my PATH variable.
Well, my local directory is `~/local`. So that's not where I want it. Actually, I would want it in `~/local/zed`, isolated from the rest of the installations in there. Then the PATH variable stuff just creates junk files since I don't use zsh. So I end up having to figure out the URL to the tarball and install it myself.
My point is that if you just listed the download link to the tarball, it would actually be closer to your own goal of reducing installation friction. The shell script is so much more friction because I have to read bash code instead of just clicking a download link.
"[...]And of course, the journey isn't over yet-we'd love your help, particularly if you're excited about:
- Helping bring Zed to your distro. Either by packaging Zed or by making Zed work the way it should in your environment (we know many people want to manage language servers by themselves).[...]"
Give them a hand ;) https://zed.dev/docs/development/linux#notes-for-packaging-z...
I do think that my work contributes to help with this use case. Looking elsewhere on this thread I see that they are having problems fetching and running a nodejs binary successfully. Fortunately, nodejs is a piece of software that can be built and distributed statically. I have not packaged up this one in such a manner but I have done a proof of concept with CPython: https://github.com/allyourcodebase/cpython
That said, if they want to allow users to install Zed through a system package manager, they will need to cooperate with the system and rely on system nodejs instead of trying to fetch it at runtime. Fetching and running software at runtime is fundamentally incompatible with the core mission of Linux distributions (curation, vetting, and compatibility patching of all software that is to be run on the system).
But Linux does provide a very simple and easy way to do this — Flatpaks. They're completely distro-independent, allow you to package up and distribute exactly the dependencies and environment your program needs to run with no distro maintainers fucking with it, allow you to request permission to talk to the graphics drivers and anything else you need, and you can build it and distribute it directly yourself without having to go through a million middlemen. It's pretty widely used and popular, and has made the silent majority of Linux users' lives much better, although there's a minority of grognards that complain endlessly about increased disk usage.
Of course that has the problem that vendoring always has; you have pinned every dependency, which is great for making the software work, but you miss out on security updates.
You might want to tell the rest of the software world how unnacceptable it is, because a huge amount of software, and especially dev tooling, is installed in this exact way.
It's especially hard for young or fast moving projects, most distro packaging just isn't very compatible with this velocity.
I'm personally on NixOS , which usually makes it easy to always get the latest and greatest, but eg would I really want to add a third party apt repository for Zed, which introduces complications and also can make changes to my whole system, rather than just having zed install itself in a local user-owned directory? I don't want to end up with 15 different third party apt repositories... adding those actually provides a higher amount of trust than shell scripts that only run with user permissions.
And there are similar considerations for most other distros. Arch is probably the only other one, next to nix, where it's quite easy to stay up to date.
(zed is already an official Arch package, btw, and before that it already was in aur, and of course it is in nixpkgs already)
It's not ideal, but whenever some pattern propagates across the ecosystem, there are probably valid reasons why.
I would love to add 15 different third party apt repositories, I wish more projects used them, you're running whatever binary they give you anyway
I guess this is just another example of how hard it is to please all linux users!
To be fair though, with the lack of security and isolation on Linux a malicious binary can already do a huge amount of damage.
It’s impossible to please everyone. Pipe to sh is simple, transparent, and easy to do. If reading through 200 lines of installation script is too much then reading through thousands of lines of Zed’s code base will certainly be too much.
They also list other ways of installing https://zed.dev/docs/linux
Not so transparent[1]. Packages from a package repo are signed, usually with keys not stored on the same server so if someone nefarious breached a server they can easily replace a bash script, they can't re-sign and replace a package.
Sure it's safe if you download the script then review it then install it, but hey, you reviewed it last time, it's probably unchanged, what's the harm of piping it directly to bash next time you need to get set
https://web.archive.org/web/20240228190305/https://www.idont...
If you think this is not acceptable, check out what they did last week: https://news.ycombinator.com/item?id=40902826
No it doesn't.
Tailscale's shell script is entirely optional and installs a distro/package manager specific package. It also doesn't mess with your PATH variable.
They maintain packages for most popular distros as you can see here https://pkgs.tailscale.com/stable/.
The sibling comments are just spreading misinformation because those people were too lazy to actually look anything up.
Why not? It worked for me.
(Actually it's most probably a spectrum rather than a binary division, but I'm no philosopher or sociologist, so for example's sake I'll operate with this simplified model here.)
The world en masse is generally preferring the latter (picking the easiest solutions, no matter how shitty they are - that's how we ended up with what we have today*), but among the engineers there are a significant number of people who believe that's how things should be.
There are numerous issues with copying and pasting `curl | bash` invocations from random webpages: all sorts of potential security issues, the installed software (if it works) could be installed in a way different from how your OS/distribution does things (or from your personal preferences), leading to all sorts of future issues, etc etc. Someone probably has a good write-up on this already. But - yeah - on the other hand, it works for number of people.
___
*) And, of course, the opinions if what we have today is "good progress" or "unbearable crap" also vary.
There are close to zero people who tend to think like that among actual engineers. That's why we have reliable transportation and bridges and skyscrapers that work for (soon to be) centuries. On the other hand, we have lots of them among self-professed "engineers" who have changed many monikers over the past couple of decades and will probably call themselves "gods" in a few more years down the line.
Oops. My apologies - I meant exactly that, that a significant number of engineers believe in correctness and sound approaches, but I had a brain fart writing that comment. It should've been "believe in the former".
No idea about how many non-software engineers take various shortcuts, though. But I think there's a non-negligible number of electronics engineers who do so - I'm not an expert in that field, but it's not unheard of skipping coupling capacitors or using a resistor divider instead of a voltage regulator to cut down the costs (because that still works... until it doesn't, of course).
And here is even more correct one: https://zed.dev/docs/development/linux
...
The world en masse is generally preferring the latter (picking the easiest solutions, no matter how shitty they are - that's how we ended up with what we have today
), but among the engineers there are a significant number of people who believe that's how things should be.*I often have trouble articulating this at work. I will steal this and use something like it when advocating for correctness as opposed to shitty short sighted solutions. Thanks
Even just as a two liner leaves people a copy of what they ran if something goes awry.
It's there https://zed.dev/docs/linux#downloading-manually, it just doesn't show up as the default installation method.
You can just move it after. .local is different from local so there is no clash.
Some talks I have given on this topic:
https://www.youtube.com/watch?v=pq1XqP4-qOo
https://www.youtube.com/watch?v=CwXixVcliP0
So, I think "entitled" is the wrong insult. "arrogant" would be more accurate.