8 ms·
> Maybe it was a reaction against the Java-style reverse DNS notation I suspect it was less a reaction against anything and more just following the norms estab
by lolinder 3y ago
> Maybe it was a reaction against the Java-style reverse DNS notation
I suspect it was less a reaction against anything and more just following the norms established by most other package managers. NPM, PyPI, RubyGems, Elixir's Hex, Haskell's Cabal... I'm having a hard time thinking of a non-Java package manager that was around at the time Rust came out that didn't have a single, global namespace. Some have tried to fix that since then, but it was just the way package managers worked in 2014/2015.
- jiggawatts 3y agoYes, and all of those have had major security issues caused by their lack of foresight. "We're pretending security is not an issue." has been the feedback every time this is raised with the Cargo team. To be honest, it's turned me off Rust a little bit. The attitude of "Rust is memory-safe, so we don't need any other form of security." is not a good one.
- muldvarp 3y ago> "We're pretending security is not an issue." has been the feedback every time this is raised with the Cargo team. Do you have a specific link where I can read this response, because this is not at all the responses I have read.
- jiggawatts 3y agoJust some random Cargo security-related issues I noticed: - No strong link between the repo and the published code. - Many crates were spammed that were just a wrapper around a popular C/C++ library. There's no indication of this, so... "surprise!"... your compiled app is now more unsafe C/C++ code than Rust. - Extensive name squatting, to the point that virtual no library uses the obvious name, because someone else got to it first. The aformentioned C/C++ libraries were easy to spit out, so they often grabbed the name before a Rust rewrite could be completed and published. So you now go to Cargo to find a Rust library for 'X' and you instead have to use 'X-rs' because... ha-ha, it's actually a C/C++ package manager with some Rust crates in there also. - Transitive dependencies aren't shown in the web page. - No enforcement or indication of safe/unsafe libs, nostd, etc... - No requirement for MFA, which was a successful attack vector on multiple package managers in the past. DISCLAIMER: Some of the above may have been resolved since I last looked. Other package managers also do these things (but that's not a good thing). In my opinion, any package manager that just lets any random person upload "whatever" is outright dangerous and useless to the larger ecosystem of developers in a hurry who don't have the time to vet every single transitive dependency every month. Package managers need to grow up and start requiring a direct reference to a specific Git commit -- that they store themselves -- and compile from scratch with an instrumented compiler that spits out metadata such as "connects to the Internet, did you know?" or "is actually 99% C++ code, by the way".
- bjourne 3y agoSure, but all the drawbacks you enumerate are also advantages for gaining critical mass. A free-for-all package repository is attractive to early adopters because they can become the ones to plug the obvious holes in the standard library. Having N developers each trying to make THE datetime/logging/webframework/parsing library for Rust is good for gaining traction. You end up with a lot of bad packages with good names though.
- rat87 3y ago> Extensive name squatting, to the point that virtual no library uses the obvious name, because someone else got to it first. Maybe the obvious names should have been pre banned. But I don't see the issue with non-obvious names either way you're going to have to get community recommendation/popularity to determine if brandonq/xml is better or worse then parsers/xml
- jiggawatts 3y agoIn ASP.NET land, I regularly work on projects where there is an informal rule that only Microsoft-published packages can be used, unless there's good reason. You don't want to be using Ivan Vladimir's OAUTH package to sign in to Microsoft Entra ID. That probably has an FSB backdoor ready to activate. Why use that, when there's an equivalent Microsoft package? When any random Chinese, Russian, or Israeli national can publish "microsoftauth", you just know that some idiot will use it. That idiot may be me. Or a coworker. Or a transitive dependency. Or a transitive dependency introduced after a critical update to the immediate dependency. Or an external EXE tool deployed as a part of a third-party ISV binary product. Or... Make the only path lead to the pit of success, because the alternative is to let people wander around and fall into the pit of failure.
- Fluorescence 3y agofwiw but when I saw a 3rd party library pretty much exactly like "microsoftauth" on nuget, I reported it and it was swiftly removed. I think we need to encourage a culture that package managers are our shared garden and we must all help in the weeding.
- pcwalton 3y ago> "We're pretending security is not an issue." has been the feedback every time this is raised with the Cargo team. Literally nobody has said this. > The attitude of "Rust is memory-safe, so we don't need any other form of security." is not a good one. Fortunately it's an attitude that nobody in the Rust project has!
- Freedom2 3y ago> Literally nobody has said this. I know of a few people, personally, who have said this.
- FridgeSeal 3y agoOk, but like, were any of them people of note, actively working on the project? Because it seems like the people who are working on the project aren’t saying that.
- jiggawatts 3y agoThe people that are working on the project haven't implemented namespaces, or any other security feature really, so what they say is immaterial. What they do is the only thing that matters.
- carols10cents 3y agoHow do namespaces measurably increase security?
- richbell 3y agoThey reduce the risk of supply chain attacks like typo squatting or Dependency confusion.
- littlestymaar 3y agoFunnily enough, they in fact increase it.
- lucideer 3y ago> I'm having a hard time thinking of a non-Java package manager that was around at the time Rust came out that didn't have a single, global namespace The implication here is that namespaces in package managers weren't a known concept. Outside Java, NPM - probably the biggest at the time - not only supported them but was actively encouraging them due to collective regret around going single-global in the beginning. Composer is another popular example that actually enforced them. Not only was namespacing a known widespread option, with well documented benefits, it was one that was enthusiastically argued for within the Rust community, and rejected.
- lolinder 3y agoNPM added namespaces in version 2, which was released in Sep 2014, just 2 months before cargo was announced. I don't remember anyone making a big deal about using scopes in NPM for several years after that, it was just there as an option. The announcement blog post of v2 only gives two paragraphs to scoped packages and explicitly frames the feature as being for enterprises and private modules [0]: > The most prominent feature driving the release of npm 2 didn’t actually need to be in a new major version at all: scoped packages. npm Enterprise is built around them, and they’ll also play a major role when private modules come to the public npm registry. My memory is that the industry as a whole didn't really start paying attention to the risks posed by dependencies in package managers until the left pad incident. To be clear, I'm not saying that it was a good idea to not have a better namespace system or that they were completely ignorant of better options, just that they were very much following the norms at the time. [0] https://blog.npmjs.org/post/98131109725/npm-2-0-0.html https://blog.npmjs.org/post/98131109725/npm-2-0-0.html
- devman0 3y agoThe left pad issue was kind of wild coming from the enterprise Java space. Supply chain attacks against open source software were already being taken pretty seriously, my last company had it's own Maven repository manager running that was used to stage and vet packages before they could be used in production.
- 3y ago
- thirdplace_ 3y agophp's composer[0] in 2012 had package namespaces [0] https://getcomposer.org/ https://getcomposer.org/
- lolinder 3y agoSorta—it looks like they were mostly just using that system by convention until May 2015, when they finally become enforced [0]. Still, that's a good one that I hadn't thought of, and they at least had the convention in place. [0] https://github.com/composer/packagist/issues/163#issuecomment-99673878 https://github.com/composer/packagist/issues/163#issuecommen...
- selcuka 3y ago> I'm having a hard time thinking of a non-Java package manager that was around at the time Rust came out that didn't have a single, global namespace. Technically not in the same category, but Docker Hub (2014) had namespaces.
- stcroixx 3y agoPerl’s CPAN was around in the 90’s and all modules were namespaced.
- lolinder 3y agoFair enough. As I noted to another commenter, I'm not trying to say there was no prior art (if nothing else there was Maven), just that they were following the overwhelming majority of mainstream languages at the time.
- jeremyjh 3y ago> just that they were following the overwhelming majority of mainstream languages at the time. They were trying to do better than mainstream languages in other areas and succeeded. IIRC on this front they just decided Ruby's bundler was the bee's knees.
- nindalf 3y agoThe same developer who worked on bundler also worked on the initial version of cargo. That’s why they’re similar. And at that time, it was a good idea. Ruby was popular and bundler + gem ecosystem was a big reason for its popularity. No one was worried that Rust might become so popular that it might outgrow the bundler model. That was only a remote possibility to begin with.
- pdimitar 3y agoA mistake that many programmers make, as if baking one more feature on top would have made any difference that wouldn't be amortized in just a few weeks... Sigh.
- jmyeet 3y agoI'm honestly astounded at how badly many languages have implemented dependency management, particularly when Java basically got this right almost 20 years ago (Maven) and others have made the mistakes that Java fixed. With Maven you get: 1. Flexible version (of requirements) specification; 2. Yes, source code had domain names in packages but that came from Java and you can technically separate that in the dependency declaration; 3. You can run local repos, which is useful for corporate environments so you can deploy your own internal packages; and 4. Source could be included or not, as desired. Yes, it was XML and verbose. Gradle basically fixed that if you really cared (personally, I didn't). Later comes along Go. No dependency management at the start. There ended up being two ways of specifying dependencies. At least one included putting github.io/username/package into your code. That username changes and all your code has to change. Awful design. At least domains forced basically agreed upon namespacing.
- cgh 3y agoYes, #3 in particular is important for many large corps where one team develops a library that may be pulled in by literally thousands of other developers.
- beautron 3y ago> Later comes along Go. No dependency management at the start. There ended up being two ways of specifying dependencies. At least one included putting github.io/username/package into your code. That username changes and all your code has to change. Awful design. "github.io/username/package" is using a domain name, just like Java. Changing the username part is like changing the domain name--I don't see how this is any worse in Go than in Java. If you don't like that there's a username in there, then don't put one in there to begin with. Requiring a username has nothing to do with Go vs. Java, but rather is because the package's canonical location is hosted on Github (which requires a username). I don't know why so many programmer's use a domain they don't control as the official home of their projects--it seems silly to me (especially for bigger, more serious projects).
- devman0 3y agoSlight difference is that it wouldn't break existing builds if you changed namespaces in Java. The maven central repo does not allow packages to be rescinded once they are published. So that old version of package xyz will still resolve in your tagged build years from now even if the project rebrands/changes namespaces.