News for hackers. Stuff that matters.
Re:The Rust community's crate host by conradk on Thursday November 20, 2014 @02:52PM (#8637750)
Here is the most important part to me:

"Take care when publishing a crate, because a publish is permanent. The version can never be overwritten, and the code cannot be deleted. There is no limit to the number of versions which can be published, however."

That. Is. Awesome.

Re:The Rust community's crate host by zrail on Thursday November 20, 2014 @02:55PM (#8637770)
This has been true of CPAN for a long time, and comes as a result of it being a network of FTP mirrors. I don't know when people decided it was a good idea to be able to yank a package (for example, from rubygems). It just complicates the whole setup and makes it less flexible.
Re:The Rust community's crate host by steveklabnik on Thursday November 20, 2014 @02:56PM (#8637779)
I can speak to the Rubygems case: you'd be surprised at how often people publish proprietary/private information, and then need to pull it down. It happens often enough to actually be a burden on the Rubygems team (at least, when I used to co-work with one of them) that they left 'yank' in.
Re:The Rust community's crate host by anuragbiyani on Thursday November 20, 2014 @04:17PM (#8638204)
> you'd be surprised at how often people publish proprietary/private information, and then need to pull it down.

But once published, isn't such information already compromised for all practical purposes ?

I can understand the legal reason behind "pulling it down" (using someone else's IP, etc), but practically speaking the private information once published cannot really be "undone" (at best you can make it hard to find, and disassociate from yourself).

Re:The Rust community's crate host by codexon on Thursday November 20, 2014 @04:56PM (#8638418)
Let's say you accidentally published your name, address, and social security number.

If it is only up for 1 hour, the chances that anyone malicious sees it is low.

If it is there forever, the chances that someone malicious eventually sees it approaches 100%.

Re:The Rust community's crate host by colordrops on Thursday November 20, 2014 @04:26PM (#8638256)
What you are saying makes sense, but you are taking on the entire copyright argument with this logic.
Re:The Rust community's crate host by leoc on Thursday November 20, 2014 @03:08PM (#8637837)
Licensing problems or other legal hassles are also foreseeable enough that you'd want to be ready for them.
Re:The Rust community's crate host by izietto on Thursday November 20, 2014 @03:04PM (#8637813)
I think description should be mandatory
Re:The Rust community's crate host by baq on Thursday November 20, 2014 @04:24PM (#8638243)
homepage, too
Re:The Rust community's crate host by pauljz on Thursday November 20, 2014 @07:41PM (#8639141)
For what it's worth this is also true of NuGet:

"NuGet.org does not support permanent deletion of packages, because that would break anyone who is depending on it remaining available. This is particularly true when using the workflow that restores packages on build.

Instead, NuGet.org supports a way to 'unlist' a package, which can be done in the package management page on the web site. When a package is unlisted, it no longer shows up in search and in any package listing, both on NuGet.org and from the NuGet Visual Studio extension (or nuget.exe). However, it remains downloadable by specifying its exact version, which is what allows the Restore workflow to continue working.

If you run into an exceptional situation where you think one of your packages must be deleted, this can be handled manually by the NuGet team. e.g. if there is a copyright infringement issue, or potentially harmful content, that could be a valid reason to delete it."

(Source: http://docs.nuget.org/docs/Creating-Packages/Creating-and-Pu...)

Re:The Rust community's crate host by conradk on Thursday November 20, 2014 @03:02PM (#8637804)
That's great ! Definitely a argument in favor of Perl. Being more used to NPM (for Javascript) and knowing that you can (or at least you could) unpublish a package, I'm glad to see that with Rust, I won't have to worry about dependencies disappearing for no reason.
Re:The Rust community's crate host by ceejayoz on Thursday November 20, 2014 @03:49PM (#8638041)
CPAN as an argument in favor of Perl? That's a new one on me...
Re:The Rust community's crate host by conradk on Thursday November 20, 2014 @04:00PM (#8638113)
Isn't CPAN for Perl ? I don't actually know CPAN. All I'm saying is that having a package manager that doesn't allow removing packages is an advantage IMO.
Re:The Rust community's crate host by ceejayoz on Thursday November 20, 2014 @04:33PM (#8638289)
Yes, CPAN is for Perl. I'm just saying I've never heard of a particularly good experience with CPAN.

CPAN packages can't really be uninstalled (http://stackoverflow.com/questions/2626449/how-can-i-de-inst...) and seem to be unnaturally prone to dependency hell.

Re:The Rust community's crate host by dllthomas on Thursday November 20, 2014 @04:35PM (#8638304)
I've had particularly good experiences with CPAN. Long enough ago I don't remember the details, and I wasn't doing anything exceptionally complicated, but I remember being favorably impressed and able to get my work done without hiccups.
Re:The Rust community's crate host by jdev30 on Thursday November 20, 2014 @05:19PM (#8638528)
Same here. Its infrequent that I go to CPAN and I am unable to find a package that will help along.

The concern about running the entire test suite on module installation really isnt a problem if you think about. Additionally you are able to force the install if it fails on account of a test.

Re:The Rust community's crate host by chromatic on Thursday November 20, 2014 @05:09PM (#8638482)
CPAN dependency resolution seems worse than with other package managers for two reasons. First, CPAN prefers to install the most recent version of a dependency (rather than pinning to a specific version). Second, the default CPAN client behavior is to run the entire automated test suite for every distribution it installs.

While that behavior feeds back into improved quality for responsive maintainers, it takes additional time during installation. When combined with point #1, it can make dependency chains seem more fragile.

Re:The Rust community's crate host by serve_yay on Thursday November 20, 2014 @03:36PM (#8637992)
Huh, I can think of a lot of reasons to take a package down. Though I agree that "sorry you fucked up, too bad" seems a whole lot easier to implement.
Re:The Rust community's crate host by idbentley on Thursday November 20, 2014 @03:43PM (#8638019)
Can you clarify this?

Generally, if you've published a package, it's possible someone has downloaded it. If you take it down, that's going to be strange and unexpected behaviour for those people.

Re:The Rust community's crate host by FlyingAvatar on Thursday November 20, 2014 @04:46PM (#8638377)
Someone has maliciously posted a package with illegal content.

Someone has accidentally posted a package that contains a 2TB file, and now all mirrors have to sync it.

Someone accidentally puts their personal information in a package.

Re:The Rust community's crate host by darklajid on Thursday November 20, 2014 @06:31PM (#8638881)
Illegal: There are legal ways to make that initial statement ("Cannot be deleted") false. If you're uploading a crate that offers nude pictures of random celebrities the guys at cargo.io will find a way to make this go away.

2TB file: That's .. nonsense. I assume guards are in place to prevent the oldest form of DOS attacks. If not, the guys at cargo.io will learn and .. make that go away?

Personal information: That looks like the only case where I sympathize with the guy uploading stuff. That said, this is how the net works? Publishing sensitive stuff to Github means that it might be out there forever (force pushing a new history doesn't mean that no one cloned the stuff before or just grabbed a zip of the current head).

For me its a win. I certainly can imagine some scenarios that might be painful, but .. that usually boils down to your third example, a developer error. The usual issue with 'removing packages' is that the user suffers. My gut feeling is that there are far more users that get 404s than developers that share their API keys.

Re:The Rust community's crate host by dbaupp on Thursday November 20, 2014 @06:35PM (#8638894)
There's currently a 10MB limit on uploaded packages.
Re:The Rust community's crate host by riffraff on Friday November 21, 2014 @04:54AM (#8640561)
there are a few possible cases of users suffering:

* you push a revision which introduces a bug

* you push a release which introduces involuntary API breakage

* the new release has a glaring security issue

* release X relies on a third party which has changed (think: some web service) and therefore doesn't work anymore

Sure, you can push a newer release but you don't want _anyone_ to be using the old one.

I'm not saying yanking is good, but maybe a notification system "this package should not be used, upgrade to XXX" would be useful.

Re:The Rust community's crate host by serge2k on Sunday November 23, 2014 @03:15AM (#8648151)
Vendor guidance would be great.
Re:The Rust community's crate host by ecdavis on Thursday November 20, 2014 @04:23PM (#8638236)
If you accidentally published sensitive info in that package you may want to contain the damage.
Re:The Rust community's crate host by kbenson on Thursday November 20, 2014 @10:46PM (#8639720)
Then contact the people that run cargo.io and see if they are sympathetic and what options exist in the circumstances. Setting a sane standard of "no, you can't fuck up everybody that has depended on your public package" is a good thing.
Re:The Rust community's crate host by baq on Thursday November 20, 2014 @04:23PM (#8638238)
same with git rebase on master branches and yet people do that sometimes. there'll always be use cases for deleting a package from anywhere no matter what repo we're talking about.
Re:The Rust community's crate host by Jabbles on Thursday November 20, 2014 @03:42PM (#8638014)
I would like to contrast the underlying philosophy here to that of Go.

As you may be aware, there is limited support for versioning APIs using "go get" (Go's nearest equivalent of this). The developers of Go argue that the maintenance of your dependencies is your responsibility, and you should clone everything you need to your own environment. That gives you ultimate control, allowing you to pull and update them as you require, modify and bugfix as you see fit, and makes it hard, if not impossible, to end up relying on two packages with different versions.

If a project B depends on project A, then they must collaborate in some way to make sure that there are no breaking changes introduced between (minor) versions. If another project C also depends on A, then they must both use the same version of A if they are to be used together. The maintainers of A, B and C all have a duty to ensure that their code remains up-to-date and backwards compatible.

It seems that Rust values a different freedom. By specifying the exact version you require, there is no need to keep separate projects in sync. The flexibility comes at a cost; you may find you have different versions of many dependencies. Because they are not required to, maintainers may neglect the tedious task of keeping their projects' dependencies up-to-date, requiring bugfixes in multiple places in your own codebase.

Clearly, some of the smartest minds in our industry disagree what the best tradeoff is. It is interesting to see the range of opinion though.

Re:The Rust community's crate host by steveklabnik on Thursday November 20, 2014 @03:46PM (#8638030)
Small nits about the way this works:

> By specifying the exact version you require,

This is only half true. It comes in two steps: you specify a _kind_ of version that you require, like

    foo = "^1.2.0"
and then, during the build step, it resolves all of the dependencies and their dependencies (etc) and writes the exact version out to a file. So you do end up with specific ones, but you won't neccesarily end up with multiple versions.

This also matters because...

> maintainers may neglect the tedious task of keeping their projects' dependencies up-to-date,

You just run 'cargo update' and it will re-calculate that dependency graph, and re-write out the lock file. You're as up to date as you can be. Of course, if that fix is only available in a range outside you've specified, that's different.

Re:The Rust community's crate host by mercurial on Friday November 21, 2014 @03:24AM (#8640348)
? As you may be aware, there is limited support for versioning APIs using "go get" (Go's nearest equivalent of this). The developers of Go argue that the maintenance of your dependencies is your responsibility, and you should clone everything you need to your own environment. That gives you ultimate control, allowing you to pull and update them as you require, modify and bugfix as you see fit, and makes it hard, if not impossible, to end up relying on two packages with different versions.

That's the last time where I heard about this wonderful idea that vendoring everything is a solution, because versioning is hard: https://www.kickstarter.com/projects/2066438441/haunts-the-m...

I'll take the solution where I can send a PR to the maintainer with updated dependencies over this sort of thing any day.

Re:The Rust community's crate host by demarq on Friday November 21, 2014 @01:52AM (#8640138)
"The developers of Go argue that the maintenance of your dependencies is your responsibility" THIS!

I should also state I fall on the extreme end of the spectrum. My belief is that the moment you depend on upstream package X it is wholly your responsibility to track changes and adapt your code accordingly. I don't believe software versioning does anything but encourage poor security, performance and general fragmentation.

I believe that before pushing your changes to a remote repo, you locally check that everything is stable, meaning there is no dev branch or stable releases just one true master branch!

If you don't want the bleeding edge then don't 'git pull'. simple!

Re:The Rust community's crate host by dbaupp on Friday November 21, 2014 @08:21AM (#8641105)
Cargo gives you exactly this, btw: if you don't want to change the version of upstream code on which you depend, don't run `cargo update`. (This applies to both git dependencies and registry dependencies.)
Re:The Rust community's crate host by demarq on Friday November 21, 2014 @09:11AM (#8641308)
believe me I will 'cargo update' always! the problem is those who don't and still go on to publish libraries, what happens when he needs version 2.1 of X while another library needs version 3.4? And thus anyone who depends on these two libraries now ends up with duplicate libs. What if they also depend on other libs with the same problem...

The world goes boom! exponential overload!

... at least it get's really frustrating after a while, twice the space, twice the compilation time. And you'll know at least one of the libs has bugs lurking in it that have been fixed elsewhere except in that lib:(

Re:The Rust community's crate host by andrewchambers on Thursday November 20, 2014 @04:46PM (#8638374)
Go is always statically linked at the moment so it makes more sense in that scenario.
Re:The Rust community's crate host by pcwalton on Thursday November 20, 2014 @06:16PM (#8638828)
I don't think that the linking semantics make much of a difference in what you should do with your source. Rust is, in fact, usually statically linked as well. Dynamically linked Rust crates are supported, but are uncommon in practice. (The most common use cases for dynamically linked Rust crates at the moment are compiler plugins and embedding Rust into other languages.)
Re:The Rust community's crate host by andrewchambers on Monday November 24, 2014 @04:15PM (#8654779)
For a dynamic library you need to ensure your source will work with the version range the package manager allows to be installed. Which may or may not be the most up to date version.

Subtle things in dynamic linking may break applications when dependency versions are changed.

Static linking lets you bundle whatever version is known to work, including the most up to date versions.

Re:The Rust community's crate host by pjc50 on Thursday November 20, 2014 @05:26PM (#8638568)
the code cannot be deleted

Well, that's a problem waiting to happen. Infringing source? Malicious material? It's a publishing facility and so will be abused.

Re:The Rust community's crate host by whyever on Thursday November 20, 2014 @08:33PM (#8639316)
Exceptions can be treated exceptionally. No need to allow deleting as part of everyday usage.