Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Bloated Google-cloud-CLI contains an entire Python installation (~300MB) (issuetracker.google.com)
45 points by tonymet on Feb 6, 2024 | hide | past | favorite | 27 comments


It's the output of Bazel's py_binary rule that includes a py_runtime to create a single hermetic executable file that can be deployed anywhere.


While Bazel's python rules would do something similar, this doesn't look like it's the output of a Bazel build. The directory (bundledpythonunix) is not something Bazel's python rules generates, and the 3.11.7 python binary differs from what rules_python would include today.


Googles own firebase is 1/4 of the size and expects node installed


Might be leftovers from complaints during Python 2 to 3 shift.


This is an artifact of Google's policy to vendor every. single. dependency. Ironically, it makes building their stuff from source an absolute pain; if you think a vendored Python is bad, try building Android and post about it when it's done tomorrow.


I'm sure they're very interested in supply chain attacks for operating system used by billions just to save you some time on your workstation at home.


There are ways to prevent malicious dependencies without having to vendor them.


That’s typical for embedded. Yocto and buildroot do everything from scratch too.


The linked issue reads: google-cloud-cli python module is also large at > 1.1GB which is much much worse than ~300MB, is this a mistake in the title?


you're right the 1.1GB is the main issue and the 300gb python installation is the biggest component


Hot take, but if you have to deal with environments being an afterthought in most scripting languages, and you need to ship a specific version of that scripting language, what else are you supposed to do? Most electron apps do the same thing.


don’t measure yourself against a low bar


Why not check for a dep or remote it ?


I do not use Python or Perl. If I need either of them, e.g., for compiling some other software, I install them, do the compilation, then uninstall. Python is popular but it is slow. This has been admiitted countless times on HN and elsewhere. If Python was not slow by design then why is such an incredible amount of work put into trying to "speed it up".


Python could be 10x slower and still be very useful in a lot of applications.


I mean... yeah? I don't understand why your comment is phrased like you're speaking some truth nobody wants to admit. Python traded off speed for flexibility etc. This is neither news nor some kind of mortal sin


There are HN commenters and people who blog about programming that attempt to argue against any statement that Python is slow.^1 This comment I am replying to is itself defensive. If Python is slow and everyone knows and accepts it as true then why does the statement "Python is slow" consistently trigger defensive comments. Why am I even having to bother typing this reply. Why would anyone care enough to make some "counterargument" if anyone states that Python is slow, or I state I am not using it because it is slow. Python is already an overwhelmingly popular language choice.

1. For example,

https://news.ycombinator.com/item?id=31200989

https://news.ycombinator.com/item?id=35906158

https://news.ycombinator.com/item?id=22040899

https://news.ycombinator.com/item?id=16978932

https://news.ycombinator.com/item?id=31845729


??

In your links, I see either a) people responding because some commenter is being weirdly aggressive about an issue that is not controversial and that nobody is on the other side of (like me, responding to you, right now), or b) people pretty calmly and lucidly discussing the relative merits of small performance improvements vs the required development time, or increased complexity, or some other tradeoff. You know, engineering.


What you don't see is how many upvotes I got for stating that Python is slow.

It would seem I am not the only one who notices the constant, absurd attempts to discount this simple fact.

The title of this submission is "Bloated Google-cloud-CLI contains an entire Python installation (~300MB)"

I avoid Python wherever possible.


> It would seem I am not the only one who notices the constant, absurd attempts to discount this simple fact.

Or... they upvoted you because Python being slow is a simple, obvious, uncontroversial truth that nobody disagrees with?

Do you understand that I'm not trying to disagree with you on that point? The point is not that you're wrong about Python being slow, it's that you're wrong that this is somehow a secret nobody wants to admit, and you're wrong that this is somehow an evil thing that Python should be shunned for. There are no "constant, absurd attempts to discount this simple fact." The discussions you linked aren't doing that, they're just talking about the relative cost and importance of improving that slowness.

Python is slow because accepting slowness lets the language be simpler, more flexible, and sometimes more expressive. For some use cases, this is an excellent tradeoff. For other use cases it's a terrible one. I don't understand why you see this as some kind of moral crusade.


"Python is slow." <--- HN commenters like "gipp" will be unable to control their urge to "defend" their favorite scripting language. They will interpet this statement to mean nonsense such as "this is somehow an evil thing that Python should be shunned for". They will treat this statement as an invitation to discuss the "tradeoffs" of Python.

Let's try this one more time. "Python is slow. It's bloated. I do not use it."

There is nothing about "secrets" or "evil" or "moral crusade" or some other hyperbolic nonsense. There is nothing to interpret. I do not care about Python's tradeoffs. I do not care why it is slow.

More replies rambling on about Python only ilustrate the point I am making.


LOL just read that article yesterday about how optimizations on binaries for rust can go from 40mb down to 10mb with a few compiler flags, people here worrying about that kinda optimization and googles just shipping entire python installs inside of their cli install lol


Risking downvotes, but I guess Google can afford to move CLIs to Go or Rust. Go, for sure.


> Risking downvotes

Do you really care that much? It should not be an obstacle to your opinion!


Yeah well, bloated Debian install contains an entire perl installation + modules (~40MB).


I don't blame them for not wanting to be at the mercy of users' local Python installation (https://xkcd.com/1987/)


yep i had this issue just recently.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: