aws-sam-cli icon indicating copy to clipboard operation
aws-sam-cli copied to clipboard

Provide linux installation without homebrew

Open SkeLLLa opened this issue 7 years ago • 56 comments

Homebrew is not common tool for linux systems. And it (homebrew) not only consume space and interfere with other tools, but it also works rather bad. Also SAM cli is only one tool that requires homebrew to be installed.

There are a lot of better tools that provide linux system installation. Consider using them instead of uncommon homebrew and will make this tool linux-friendly.

SkeLLLa avatar Sep 22 '19 18:09 SkeLLLa

For starters, I suggest snapcraft (highly), or flatpak (somehow reluctantly), if you want to have one install for multiple environments.

TiS avatar Sep 30 '19 13:09 TiS

@TiS I don't think that this actually need functionality that snapcraft provides. I think it would just some installation script like nvm or even homebrew does curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash.

SkeLLLa avatar Sep 30 '19 15:09 SkeLLLa

please this

rapofran avatar Sep 30 '19 17:09 rapofran

@SkeLLLa did you find some workaround?

rapofran avatar Sep 30 '19 17:09 rapofran

I suggested these tools, because they bundle dependencies. This is good for tools like SAM, if we want them to be independent from OS details and packages.

Coming from Ubuntu, Snapcraft is the most natural choice for me, but I heard many people choose flatpak as better alternative (I don't know why, though, as my personal flatpak experience is quite bad; maybe it's just my luck).

Using just installation script can be tricky, as one has to somehow take into account all of package version differences between systems. Also, installation script makes things like uninstall / upgrade harder to do, while snapcraft / flatpak, being package managers, suport them out of the box.

TiS avatar Sep 30 '19 17:09 TiS

I think the docs are bad written

running pip install aws-sam-cli installs everything OK

rapofran avatar Sep 30 '19 17:09 rapofran

It is a bit peculiar to suggest Linux users to install Homebrew when a simple pip3 install --user aws-sam-cli works.

siwyd avatar Oct 16 '19 10:10 siwyd

Plenty of Mac users refuse to install Homebrew also because it interferes with their alternative distribution preference. Please get rid of Homebrew completely as a dependency for aws-sam-cli. It is completely unnecessary.

dwhitla avatar Nov 13 '19 01:11 dwhitla

apt get install

dwhitla avatar Nov 13 '19 01:11 dwhitla

Agreed, brew is not the recommended approach for linux. Pip makes a lot more sense, and will perform much better in a ci/cd pipeline. Brew is incredibly slow.

darrenweiner avatar Feb 15 '20 22:02 darrenweiner

Agree completely. Homebrew is terrible, and since no other AWS tools (awscli, codedeploy agent, ssm-agent etc) require homebrew it seems rather strange to be an outlier. I am so happy I found this post as I was struggling to get the sam-cli installed properly in a build-agent which uses virtenv's . I switched the install to a simple pip3 install --user and all is well now.

SpyderDave avatar Mar 06 '20 21:03 SpyderDave

It is suggested that pip does not install up-to-date SAM CLI.

  • https://stackoverflow.com/questions/60718834

oonisim avatar Mar 17 '20 08:03 oonisim

@oonisim That is incorrect. The person suggesting that is probably trying to install into an unsupported version of python and pip is selecting an old version that was 'allowed'. You must be using Python3.6+.

jfuss avatar Mar 17 '20 14:03 jfuss

Just an update note on this thread. We are aware of parts of the community not happy with installing Homebrew to install SAM CLI. To provide some context here: when we initially went down the path of installers, Homebrew was a good way to reach a lot of the community. Mac was initially the target but then we learned that it can also support Linux. This allowed us to reach both platforms with a 'single' installation option. We still do not recommend PIP, as it does not provide a reproducible installation and is very easy to screw up your python environment (among other things).

We are looking at improving this experience, most likely targeting Linux first but none of this planned yet, as the team is still discussing things. The two likely options are providing an installation script that could install SAM CLI in an isolated and reproducible fashion (most likely still require a supported version of python on the system) or follow the footsteps on the AWS CLI and vend a single binary that has python bundled with it (similar to how we are currently doing MSI's for windows).

jfuss avatar Mar 17 '20 14:03 jfuss

@jfuss - That sounds reasonable. However ...

I strongly recommend pip. It has provided a perfectly reproducible installation every time I have used it. For the record, pip does what you tell it to do via your requirements manifest. If you restrict its dependencies to exact versions - including the transitive dependencies - then you get an identical installation every time (unless a dependency is no longer available - which is desirable behaviour in this case). If you restrict dependency versions instead to ranges, you may get different versions - but if you have good reason for the ranges then you get what you are expecting for the expected reasons.

As for it screwing up your python environment - if you're using python you should already understand how to configure its environment for you particular operating system. If you don't, then you already have a bigger problem to resolve. Rather than aim for the lowest common denominator at additional inconvenience for people who know how to use their tools, I would recommend following accepted best practice for the environment tool set you are targeting - in this case Python. Understanding how to use that tool set is a separate issue for the user to deal with that is just part of being a developer. No-one is expecting you to handle that too.

If you use or develop with Python on a *nix OS and you aren't sandboxing your tools using virtual envs you are begging for a broken system. If you use and develop with Python on a *nix OS and you don't already know this you should probably stop now and find another vocation.

pip is actually a better tool for this purpose even than the various Linux package managers, because it allows this kind of per-environment sandboxing that is totally within the developer's control. It is also the cross-platform "'single' installation option" you were expecting - incorrectly - in Homebrew.

FWIW I $%^&ing hate Homebrew on Mac. It is a mess, makes a mess of your machine, and should be avoided completely. Pushing it on Linux, where you already have the much better native package managers that Homebrew tried to imitate for Mac users, is just a really poor choice.

dwhitla avatar Mar 18 '20 03:03 dwhitla

@jfuss - Please don't build an installer. The existing ubiquitous python tools are already available in CI/CD systems. Installers are also notorious for leaving crap all over your system when you stop using the tools they installed. At least the existing tools are well known, well understood and well documented. Rather than reinvent another wheel I suggest your time would be better spent, for those served by an installer, documenting best installation practice to help the noobs avoid the pitfalls you are trying to code around for them. Just my $0.02

dwhitla avatar Mar 18 '20 03:03 dwhitla

@dwhitla Thanks for your input however pip does not meet out needs for distribution. It is great for libraries not so great for tools. The language SAM CLI is written in is an implementation of the tool and while some sets of customers are ok with this, others are not. No one should care about the language and we should not be leaking those details back to customers.

Now pip is not reproducible in the way we would need to support it. Sure, we could pin everything but that causes other problems for some customers. Sure, we could document more steps for customers to 'follow' but we do not think that is right either. More steps, restrictions such as python versions supported, etc that we impose have to be followed by all customers. We want to provide a simple installation experience (download this binary), not make it more complex with additional overhead.

Homebrew is cross-platform, as it support linux and Mac. Not everyone hates Homebrew, but we understand that some of our customers are not happy with it (including you).

jfuss avatar Mar 18 '20 14:03 jfuss

I’ve got to say I agree with @dwhitla here. The AWS CLI v2 install process that you’re praising I have to google every time, I need to download a random zip, it’s outside of any standardized package installation tool, it’s not updated automatically, if I want to verify the integrity of the download (which is built in to pip and most other package managers) then I need to follow another 5 step process that I have no chance of memorising on top of the 4 step installation process.

Home brew provides some of these and works well for Mac, but it’s incredibly slow and hacky at best under Linux. It’s also commonly installed on a total of zero Linux distributions.

All of this makes it very cumbersome compared to pretty much all the competitor tooling.

justin8 avatar Mar 18 '20 20:03 justin8

@jfuss - I have been in the situation of deploying end user tools implemented in python and understand that problem. I agree it is not the easy single click experience of say installing an MSI. But the important point for me is that it works in all my CI/CD environments which are virtualised and instantiated on-demand. That is to say all tools required for a build are installed during the build by an automated process - in this case pip.

If you absolutely insist on building your own installer please ensure this use case is considered and supported or you will break about half of your existing users' CI pipelines.

I also don't have Homebrew available on these virtual machines and don't have the option of installing it. Python (and pip) on the other hand, is part of the base Linux image and is the ubiquitous scripting Swiss army knife on most modern *nix platforms. If I have to instead curl some self unpacking zip file from AWS, while that doesn't tick my box for integrity verification which I get for free with existing tools, it is still preferable to hacking up some Homebrew installation with all of its kitchen-sink dependencies for each and every CI build every few minutes.

With pip I can also control the installation such that it doesn't overwrite or mask system libraries or in any other way threaten to brick my development machines. I contain everything in a virtual env and when I stop using AWS CLI I will just delete the virtual env. I have developers on various Linux distros, Mac, BSD and Windows. How do you plan to support BSD and Windows users with Homebrew?

dwhitla avatar Mar 19 '20 01:03 dwhitla

Not everyone hates Homebrew, but we understand that some of our customers are not happy with it (including you).

Not everyone hates Windows, but the fact that it was a completely unnecessary dependency for managing Cisco routers using their supplied management tools made me stop buying Cisco. The point here is you don't need it but have made it a dependency.

dwhitla avatar Mar 19 '20 01:03 dwhitla