News for hackers. Stuff that matters.
Re:Rust required to build Gecko by sayrer on Friday December 16, 2016 @01:12AM (#13191432)
Great! Now use a build system that downloads the compiler too. For example, Bazel will download a copy of the Go compiler if you are using it to build Go programs.
Re:Rust required to build Gecko by dozzie on Friday December 16, 2016 @03:39AM (#13191915)
Actually, no, please don't. Build system should not download shit from the internets. Build system should only build.
Re:Rust required to build Gecko by berdario on Friday December 16, 2016 @03:49AM (#13191963)
I've already read this refrain: it seems to make sense, but I cannot really justify why "build systems should only build" should be the case

What's the advantage over a build system that downloads the dependencies, but which gives you the ability to prefetch all the dependencies (so you can reliably do work without connectivity after prefetching)?

Re:Rust required to build Gecko by dozzie on Friday December 16, 2016 @04:21AM (#13192067)
To clarify: I'm not against managing (downloading) dependencies. I just want two separate steps: [download things] and [compile things].

This separation allows to build the project off-line, which is not an uncommon scenario. There are environments that have the direct internet access prohibited e.g. by a company policy. There are environments that have it difficult (e.g. are behind a proxy). There are distribution package builders (RPM, DEB), which have a policy of only working on local sources.

And then there is build reproducibility. If external network is involved, the whole reproducibility idea goes out of the window. Remember the left-pad farce? Part of the cause was idiotic split to microdependencies, but part was that everybody used external network for their build process.

Re:Rust required to build Gecko by chriswarbo on Friday December 16, 2016 @06:51AM (#13192626)
> Remember the left-pad farce? Part of the cause was idiotic split to microdependencies, but part was that everybody used external network for their build process.

Another part was using location-addressable storage for dependencies, rather than content-addressable. If dependencies used something like magnet links, IPFS, etc. then nobody would really care if some particular machine stopped serving some particular file.

Re:Rust required to build Gecko by forgottenpass on Friday December 16, 2016 @08:56AM (#13193217)
nobody would really care if some particular machine stopped serving some particular file.

Yes they would. Because such systems can only serve files that exist on at least one node, people who want to rely on such a system to serve a given file must run their own node to host every file they care about the availability of.

The topological properties of distribution are different, but the existence of the local cache to provide dependability is not avoided.

Re:Rust required to build Gecko by berdario on Friday December 16, 2016 @05:21AM (#13192269)
> To clarify: I'm not against managing (downloading) dependencies. I just want two separate steps: [download things] and [compile things].

Fair enough, but if you have outdated dependency artifacts, it doesn't make sense to compile without fetching them, and so I think it's reasonable to make the 2nd step depend on the 1st one (and thus make it execute automatically)

I understand that keeping the 2 of them too-close might inadvertently conflate the 2 concerns (the build step becomes impossible to run without the download step) even if the design goals explictly thought of them as being able to be run independently, so this might be an argument for "builds should only build", but I'm not sold on it yet

> And then there is build reproducibility. If external network is involved, the whole reproducibility idea goes out of the window. Remember the left-pad farce? Part of the cause was idiotic split to microdependencies, but part was that everybody used external network for their build process.

Well, the build systems that I have in mind are Stack ( http://haskellstack.org/ ) and Nix ( http://nixos.org/nix/ )

Both of them have an heavy emphasis on reproducibility, and yet both of them automatically download dependencies.

(the Hydra Nix continuous integration systems OTOH run build and test steps with limited/no network connectivity, to enforce that separation of concerns)

(the microdependencies btw wasn't a problem that caused build non-reproducibility, microdependencies only made it worse when the shit hit the fan)

Also, there are 2 different reproducible build failures: it doesn't build (bad) or it builds but the artifact is not identical (worse)... downloading dependencies from the internet can only cause problems of the first type, if you have a sane way of fetching them

sane means: either you have the hashes of the dependencies to check, or you can trust the archive to always give you the same files when you ask it for a snapshot... and for security reasons you'd still check the crypto signature on the hashes to verify that nothing has been tampered in the mirror from which you downloaded

(Unfortunately, not only Npm but also Hackage afaik have that anti-feature that allows you to reupload a "bugfix" with the same version number... so we cannot always trust that the systems that we're using are sane, which OTOH is impossible also due to DMCA or other law/court shenanigans: if your dependency violates someone's copyright, it might end up disappearing from the snapshots)

Re:Rust required to build Gecko by datalist on Friday December 16, 2016 @05:32AM (#13192305)
> if you have outdated dependency artifacts, it doesn't make sense to compile without fetching them

I am sorry, I'd contest that. There are often cases where one might not want to use the most current version of some library (incompatibility, undesired features, etc.).

This entire forced update approach is already unpleasant enough in the context of applications (most notably on Android and IOS) but becomes unbearable for software development. While one might argue it could still make some sense for the former, as average users might stay forever with old versions and potential security issues, that argument should not be valid in a "professional" context - where the "users" know about the implications - as it should be given with software engineering.

Re:Rust required to build Gecko by berdario on Friday December 16, 2016 @07:33AM (#13192801)
> I am sorry, I'd contest that. There are often cases where one might not want to use the most current version of some library (incompatibility, undesired features, etc.)

I think we're misunderstanding each other.

What I meant is that if you have foo-1.2 in your dependencies.conf, and you have previously downloaded foo-1.1 it doesn't make sense to compile, because the result of the compilation will most likely not be what you want

Re:Rust required to build Gecko by aninhumer on Friday December 16, 2016 @09:10AM (#13193299)
Sure, but that doesn't mean you need to combine downloading and building.

You can just have the build say "foo-1.2 not found. Latest version is foo-1.1", and the developer can decide how to respond.

Re:Rust required to build Gecko by berdario on Friday December 16, 2016 @09:26AM (#13193410)
Well, there are 3 cases:

- "usual" case (if you agree): dependencies will be downloaded from the Internet, single command download+build is useful

- in a bank/SC environment: the developer configured a proxy/local mirror of the package repositories, and the dependencies will be downloaded automatically, single command download+build is useful

- in a bank/SC environment: manual process to obtain and add locally the dependencies, the build/dev system has limited networking: automatically download fails, single command download+build is not useful but not harmful either

Having a "prefetch" and "offline-build" commands are perfectly fine, but I don't see the reason why the default shouldn't be a "build" command that does prefetch+offline-build

Re:Rust required to build Gecko by setori88 on Friday December 16, 2016 @10:45AM (#13194000)
Fractalide [1] just removed cargo from it's build system, and opted for nix to take up the role [2] of cargo.

[1] https://github.com/fractalide/fractalide

[2] https://github.com/fractalide/nixcrates

Re:Rust required to build Gecko by easytiger on Friday December 16, 2016 @05:35AM (#13192313)
Try living off the grid (ala any bank) and see how easy it is for online dependant build systems. Java maven stuff is bad enough already
Re:Rust required to build Gecko by Freak_NL on Friday December 16, 2016 @08:07AM (#13192961)
Maven facilitates downloading all dependencies in one go, exactly for this scenario:

    mvn dependency:copy-dependencies
And when you build a project once, all downloaded dependencies are cached locally indefinitely. That is, you can furnish a Maven build with offline dependencies.

Normally you do want to simply have your build download (and cache locally) a new version of a dependency, but an internet connection is not required if you have the dependencies available locally. Maven will always look in your local repository first, and will not try to download anything, except if you are depending on a SNAPSHOT version of something (which implies that the build should always check for a newer version).

Re:Rust required to build Gecko by forgottenpass on Friday December 16, 2016 @08:50AM (#13193181)
exactly for this scenario

Not really. Building from local sources only or "living off the grid" as parent poster put it typically isn't just about temporary loss of Internet connectivity, but instead serves as a shorthand for a more complicated set of requirements.

Generally speaking there will be (at least) disaster recovery requirements such that a computer with a fresh OS install and access to the local very-well-backed-up archives can produce a build. And the local archives typically have exactly one entry point so that legal and process controls can be applied as they go in.

So the problem isn't how to cache dependencies for a working directory, but how to get, archive them, and distribute them to a development team easily. A lot of package mangers approach supporting this kind of use case, but still need a fair bit of customization and manual steps if not new tooling built around them. And all that infrastructure also has to meet qualification criteria (through testing).

It gets to be enough that any tool that decides to add in their own half-assed download manager will be quite annoying to anyone that doesn't use "YOLO" as their quality management system.

Re:Rust required to build Gecko by berdario on Friday December 16, 2016 @09:33AM (#13193446)
This was the comment that most clearly explains the issue, I'd say.

I think that this is an issue of properly covering a use-case, and having simple configuration options to avoid manual and cumbersome steps... But I don't think this means that a build system shouldn't default to downloading its deps.

Basically, if "build systems should only build" means

- build systems would be better off with an offline build mode available

I agree 100%... Otherwise, if it's

- build systems shouldn't have an option to automatically download the dependencies and then build

I'm still in disagreement

Re:Rust required to build Gecko by forgottenpass on Friday December 16, 2016 @10:47AM (#13194016)
Ignoring what any particular toolset chooses to do, building software and package management can conceptually be separated.

Of course they get intermixed in practice, package management provides build prerequisites, and completely separate tools are not necessarily conductive to getting information from the build system (or dependency list in the tarball) to the package manager. Or for the download/installation provided by the package manager to be at the perfect scope for the software build.

I, unlike grandparent poster, am not making statements of "ought" for build systems. Just providing context.

However, I can still generically say, the tightness of the build and package management limits user flexibility. I'ts not even a particularly interesting phenomenon. It's just another case of software coupling. There are benefits to high coupling and benefits to low coupling. Typically tight coupling means the normal use case works better at the cost of all abnormal use cases. It's the same-old-same-old of all software design.

----

As a side note, I will say that in my experience an inflexible or awkward to use "offline" build mode is not an offline build mode. If "offline build mode" means:

-The tarball contains (or build system generates) a list of files that can just as easily be fetched with `wget -i deps.txt` and dropped into a subdirectory manually.

That's cool. If it's:

-I have to reverse engineer a one-off package manager architecture, write a script to fetch build-deps externally and hack the build to support my particular flavor of offline build because it's not the type of offline build envisioned by the tool author

Then that's bunk.

Re:Rust required to build Gecko by lmm on Friday December 16, 2016 @11:27AM (#13194340)
> Ignoring what any particular toolset chooses to do, building software and package management can conceptually be separated.

I'm not sure they can, or at least not without creating a circular dependency. It is greatly advantageous for build steps to be first-class packages that can use the library ecosystem etc.

Re:Rust required to build Gecko by snuxoll on Friday December 16, 2016 @11:30AM (#13194374)
Nothing is stopping you from tarring up ~/.m2 and distributing it, though most people just keep a local maven repo up instead.
Re:Rust required to build Gecko by tupshin on Friday December 16, 2016 @08:27AM (#13193056)
This capability is still a work in progress for rust/cargo, but check out

http://doc.crates.io/faq.html#how-can-cargo-work-offline

Re:Rust required to build Gecko by tedmielczarek on Monday December 19, 2016 @06:11AM (#13210722)
Note that for the Firefox build we're using cargo-vendor to store all of our crates.io dependencies in the Firefox tree: https://github.com/alexcrichton/cargo-vendor/ https://dxr.mozilla.org/mozilla-central/source/third_party/r...
Re:Rust required to build Gecko by datalist on Friday December 16, 2016 @04:02AM (#13192007)
Separation of concerns

On one hand frameworks and code in general becomes more and more bloated and incomprehensible these days, due to an overzealous approach in the aforementioned. On the other hand tools are getting cramped with features which were never in their original scope.

The leftpad issue was only one example of that lets-inject-third-party-code-on-the-fly mentality.

Re:Rust required to build Gecko by datalist on Friday December 16, 2016 @03:49AM (#13191962)
That cannot be emphasised enough. Unfortunately it falls on deaf ears. If a compile does not download at least 56 megabytes these days you can consider it a failure ;).
Re:Rust required to build Gecko by phyzome on Friday December 16, 2016 @08:58AM (#13193230)
How do you picture those files getting onto your computer?
Re:Rust required to build Gecko by datalist on Friday December 16, 2016 @09:31AM (#13193438)
The same way they always got there.
Re:Rust required to build Gecko by derefr on Friday December 16, 2016 @01:18AM (#13191456)
It does. As it says in the announcement.
Re:Rust required to build Gecko by sayrer on Friday December 16, 2016 @01:24AM (#13191475)
It says you have to update the rust compiler on your own: "You can stay current by running `rustup update`."
Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @01:28AM (#13191481)
I believe running mach bootstrap again will just work (if not we can make that happen).

I don't think it's a big deal that the possibly-sudo-requiring step is kept separate and not automatically invoked on build.

Re:Rust required to build Gecko by sayrer on Friday December 16, 2016 @01:30AM (#13191489)
Then you don't understand why (or agree that) Bazel or something similar is of value.
Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @01:34AM (#13191503)
Please explain why you think this is of value. To me it seems like an explicit vs implicit thing; and I can easily imagine people not wanting their build step to magically touch their system setup. I have a pretty custom Rust setup, I would not be happy if Firefox would silently change that every time I built things.
Re:Rust required to build Gecko by sayrer on Friday December 16, 2016 @01:43AM (#13191539)
It wouldn't touch their system setup--that's the point.

You get reproducible builds because the build happens in its own sandbox, ideally. But it's not absolute.

There's a continuum here: it's not awesome to have builds from source for every library if you know you're building inside a defined Docker image, for example.

Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @02:07AM (#13191612)
Yeah, that sounds useful. However, I would caution against making such a thing the default since it would bloat the space it takes on disk. In the past when I was a student with a crappy laptop I never worked on Chrome because it just took too much disk space to build and I didn't have enough. Not sure if it's because it built all dependencies locally instead of relying on the OS or something else.

So yeah, would be nice to have, but I'd be wary about making it the default.

Re:Rust required to build Gecko by sayrer on Friday December 16, 2016 @02:13AM (#13191639)
These systems tend to shift the burden to the collective. There may be some burden on disk or network that I don't experience in California, but I find these kinds of systems win for me.
Re:Rust required to build Gecko by yazaddaruvala on Friday December 16, 2016 @06:29AM (#13192527)
Honestly, I never knew the size of the divide (or that it existed) between the enterprise development community and the open source development community. I've only now started to notice it as I pay attention to Rust's build systems get designed, and other details around the Rust community evolve.

I find it fascinating that lessons aren't being learned from build systems which are built in the enterprise like Bazel, Pants, etc (honestly, I'm disappointed one of those two wasn't just adopted by the Rust community - unclear but I think they didn't know about them?).

Similarly, notice how "Java shops" have for many years enforced ever increasingly complex build pipelines (Javadoc, Junit, JaCoCo, Findbugs, ...). But these tools are slow, end up with long standing bugs when versions bump, and generally end up limited.

I find it fascinating however, that only two of the above steps (Docs, Tests) are first class in Rust. Why only those two? Why not learn from the whole Java build pipeline? Why does the compiler's test infra not spit out metadata about lines/branches covered? Why is clippy, like Findbugs, separate from the compiler? Isn't "better code" by definition better for everyone.

It should be relatively easy for these to be built into the compiler. While some like test coverage data is really hard to get as separate tool (especially when optimizations are on). However, Rust developers have valid points like "separation of concerns". Its hard to argue with them, after all we are only on the sidelines, they are actually in the thick of it. But again, there just seems to be a divide, and its interesting to see which features/lessons are adopted, vs which features/lessons are "not worth the trouble".

FWIW (my stab at a reason for this divide), I think its largely a problem of peers. In the enterprise, you work with great developers and you work with not so great developers. Most of these are fresh college/code-bootcamp developers but there are some rare bad experienced developers. At least in the field of building languages (maybe open source in general) you get to be very selective. Essentially, you only get peers who are experts (even if some of them do start off making changes while in college or without any formal education - also keep in mind the selection bias of people curious and motivated to help a project they aren't being paid for). Compounded with few strict deadlines, this basically means everyone is on their A-game all the time. eg. "Why would you need metrics about how many lines+branches of code are tested? and you want to potentially fail the build if it doesn't meet some threshold?? Some things are hard to test! Shouldn't the implementor get to decide how much testing is the appropriate amount of testing?"

P.S. Please, anyone, correct me where I'm wrong. I too am on only one side of this divide.

Re:Rust required to build Gecko by lambda on Friday December 16, 2016 @11:30AM (#13194373)
Bazel was first released to the public in March, 2015. By that time, Cargo had already been in development for over a year, had reached release 0.1.0, and was already the official build tool for most Rust projects.

Furthermore, Bazel and Cargo are aimed at slightly different use-cases. Cargo is tailored towards Rust, is integrated with a Rust package repository, and can use it's knowledge of Rust to allow for builds of pure-Rust projects with a lot less configuration. Bazel is a more general purpose build system, but that means it requires a little more configuration. There's no reason you couldn't use Bazel for building a larger project that includes Rust and C, C++, Java, or other languages that need to be built, but Cargo makes it a lot easier and simpler to handle pure-Rust projects than it would be in Bazel.

Many of the other tools that you mention don't require just more support from the build tool, but also significant engineering effort on the part of the compiler, or a separate static analyzer, or other development process tools. These tools are desired, there just isn't anyone who has had the time to design and build them.

As to why Clippy is separate from the compiler, there are a couple of reasons. Adding more lints to the compiler, especially ones that are turned on by default, can cause problems as well. Any time you add a new lint, you may break people's code that has #![deny(warnings)] turned on. Even if people don't, a lot of people will still try to rewrite code to make it comply with lints; but that in itself can cause problems. I've seen many bugs introduced over the years by people trying to do too many lint cleanups at once, and making mistakes in some of their cleanups. For this reason, the Rust compiler is fairly conservative about adding new lints..

That said, it sounds like there are plans to integrate Clippy with the compiler and cargo, but probably as an opt-in separate command rather than being included in the default set of warnings: https://www.reddit.com/r/rust/comments/5ibr2a/cargo_check_ha...

Code coverage is another example. You can use some existing code-coverage tools with Rust (https://users.rust-lang.org/t/tutorial-how-to-collect-test-c...). Because there are tools out there that work, there's less of a pressing need to get code coverage integrated with the Rust toolchain; I think that it would be a good idea to do eventually, as it will make it easier to do cross-platform and out of the box, but for now it's not the highest priority.

So, I don't think that any of these omissions are due to a difference of philosophy; just a difference of focus. Rust is all about admitting that programmers aren't perfect, and that better tooling can help avoid mistakes and thus make developers more productive. Right now, that focus is on things like improving the compiler (adding MIR, which allows for fixing several bugs in the compiler and doing some Rust-specific optimizations before getting to LLVM), implementing the Rust Language Server which can be used as a backend for IDEs, improving the ability of the compiler to do incremental and parallel builds, and adding language features with a focus on making Rust easier to use.

Re:Rust required to build Gecko by yazaddaruvala on Friday December 16, 2016 @04:44PM (#13197162)
Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @01:03PM (#13195274)
> but I think they didn't know about them?

They didn't exist at the time. cargo was built using lessons learned from other package managers, however.

> Why is clippy, like Findbugs, separate from the compiler?

The compiler didn't want to bloat its lints. Being out of tree let us iterate quickly. It lets us work on extremely useful lints which as a side effect have false positives (there are a lot of patterns it catches which might be buggy but sometimes have legit use cases that are hard for clippy to detect and ignore). It lets us add controversial lints. In general a separation between the "core" lints (which everyone usually agrees on passing, and cover a small set of bare-minimum issues) and the clippy lints (which not everyone agrees on, and cover a wide range of issues which don't always apply to your codebase) is nice to have.

There are many reasons to not want to run clippy, one of them being that's it's too strict/annoying. In Servo we can't run clippy because someone needs to go through it and update Servo over the thousands of warnings clippy produces when run on Servo (many of which are false positives). I occasionally do some of this, but clippy grows pretty quickly too so each time I do it there are new things. (I'm waiting for rustfix to mature so that I can automate a lot of this).

So, to me, clippy should be something you have to decide to use.

We do plan to make clippy part of the rust distribution (bundled with cargo and friends), it's just not happened yet since it's blocked on a bunch of things.

Clippy not being part of the default pipeline is just an artifact of its immaturity. It's still used by a lot of people despite not getting free publicity from being a default which is promising, though.

I don't see why there's much value being assigned to "first class" tooling in Rust. code coverage and clippy are a `cargo install` away.

> Most of these are fresh college/code-bootcamp developers but there are some rare bad experienced developers

There are a LOT of new/inexperienced programmers in the Rust community. You're right that there's still some selection bias, but Rust tends to be pretty welcoming. I've mentored people who've only done very basic programming in making Servo pull requests. Some of the sporadic clippy contributors are pretty new to programming.

> Why would you need metrics about how many lines+branches of code are tested?

I have never seen opposition to code coverage in Rust in that form. In general folks in Rust are happy to have more kinds of checks lying around.

It's not part of the pipeline mostly because it's a cargo install away. If your project needs it, it's pretty easy to make it part of your workflow.

There is an argument to be made that making it part of the pipeline will mean that more people will be driven to use it, which is great. You'd have to take it up with the tools team and community if you think this is something that needs to happen; I am mostly ambivalent about the idea.

Re:Rust required to build Gecko by yazaddaruvala on Friday December 16, 2016 @04:44PM (#13197159)
Hey sorry, clearly my comment came across as "Rust doesn't have X, when it should!". Clearly poorly communicated on my part. I really meant to be discussing: How there are two populations each with very different sets of perspectives/priorities.

I was trying to discuss the divide (maybe come up with reasons for it - potentially improve it), not the lack or need for tools. I was just providing concrete examples using Java vs Rust build pipelines. It might have been better if I had stuck to abstract examples like: "I find it fascinating when something like X is so obviously a priority to me(us), but it takes a lot of effort to convince others that it is a priority at all."

I hope that is more clear.

Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @05:18PM (#13197406)
Ah, I see. Not really sure how to address that. I will point out that folks do use kcov for Rust, so I wouldn't say it's "not a priority at all", more like the status quo is considered good enough.
Re:Rust required to build Gecko by steveklabnik on Friday December 16, 2016 @11:20AM (#13194265)
> I find it fascinating that lessons aren't being learned from build systems which are built in the enterprise

What specifically makes you think lessons aren't being learned?

> honestly, I'm disappointed one of those two wasn't just adopted by the Rust community - unclear but I think they didn't know about them?

Bazel had its first release in March 2015, and wasn't even considered beta ready until later that year. Pants had its 0.0.17 release, the very first public one, in July of 2014.

Cargo was announced in March 2014, earlier than both.

> Why only those two?

Well, those two are necessary. Other tooling is nice, but not the bare minimum needed. We need to stay focused, but more on that later.

> Why not learn from the whole Java build pipeline?

I have not dealt with the Java-specific tools you're talking about in a very long time, but pipelines have advantages too. A few slow tools doesn't mean the whole concept is bad.

> Why is clippy, like Findbugs, separate from the compiler?

Rust cares a _lot_ about stability. Adding new lints is extremely difficult, because they can break people's builds. Clippy being a separate tool means that they can iterate on lints at a different release cadence than the compiler itself, and aren't bound by our mega strict breaking changes policies.

> In the enterprise, you work with great developers and you work with not so great developers.

I assure you, it is very much the same in open source. ;)

So, we do very much care about Rust's usage in enterprise scenarios. For example, Mozilla in many ways feels exactly like an enterprise customer of ours. It was a huge amount of technical (and social) work to get to this point, and a lot of that involved negotiating how the builds would actually work. Our perspective is that Cargo is a world-class tool for building code, but that's only possible because it's focused on _Rust code_. So the strategy should be, how can we best integrate Cargo with these more generic build systems? We've already taken a number of steps forward on this front, and there's more to come.

Most of these features lacking in Cargo are due to a lack of some kind of champion to lay out the specific needs; we don't want to just build features and hope they're useful. In the past, we've had several people come to us with "here's my issue getting Rust in my workplace", and that experience has been valuable. We're a small crew, we need to focus in order to keep shipping quality stuff. We don't have the ability to just toss some people on it, for whatever value of it, and get it done.

Re:Rust required to build Gecko by yazaddaruvala on Friday December 16, 2016 @04:48PM (#13197186)
https://news.ycombinator.com/item?id=13197159

> Cargo was announced in March 2014, earlier than both.

Thats fair, and a part of what I meant about "they didn't know about them", because working for Amazon right out of college, I've been using things like Bazel/Docker/Travis for 5+ years now.

I actually meant it as a discredit to people who work in the industry for not exposing these tools earlier. I did a poor job of communicating that (it was after all like 3 am :P).

Re:Rust required to build Gecko by steveklabnik on Friday December 16, 2016 @05:49PM (#13197617)
It's all good! Just setting the record straight :)
Re:Rust required to build Gecko by __s on Friday December 16, 2016 @07:50AM (#13192874)
I'm on both sides, & I wish on the enterprise side we had what Python has (bugs.python.org & rietveld & good DVCS). But my enterprise experience is at a place with a dozen people & we use very few tools. It's a C# shop mostly
Re:Rust required to build Gecko by dathinab on Friday December 16, 2016 @09:47AM (#13193543)
I think the answer for many of your questions is "available resources", Mozilla has only limited resources for rust and while rust has a very nice community driving rust, it is a big difference to e.g. google which probably has more paid developers on the Bazel build system than Mozilla on the whole programming language...

So instead of choosing a large feature set at the beginning and the box it through, they choose to have a more thin compiler, standard library etc. but make it extendable, so that it can be extended and integrate with other systems. Also you should not forget that Rust is still very young for a programming language so cargo is everything but done. Cargo is more a unified interface combining the compiler and the crates package repository than a full fledged build system. Given the available resources and time for building rust, I thing choosing to (for now) not include a fist class rust coverage system, debugger etc. is a sane choice, especially because all this things are available as external tools (debugger=gdb, coverage=kcov, etc.).

Also there are discussions/issues about enabling the integration with "enterprise" build systems, they just currently don't have a high priority and happen mostly in the background. So it's probably just a matter of time until you can use rust with a "enterprise" build system like Bazel.

Wrt. clippy integration in rust, it is mostly about keeping the compiler smaller and easier to maintain. Through it should be noted, that all "important" lints are in rustc, clippy just provides more useful ones. By keeping both projects separated it is possible to iterate both of them independent of the other. Which can be quite useful in open source development. Also don't enterprise systems also have a separate linter? (And no "better code" is not better code for every one, as the definition for what good code is can change quite a bit depending on the person, e.g. wrt. variable shadowing)

Lastly I don't think your reasoning about peers holds, you don't really have the choice to be selective about people working on the project, at last not if you have open source project on the scale of rust. Through you might be able to have more strict requirements for code quality. Nevertheless given how rustc catches a lot of possible bugs, and how to community is, I would be surprised if there would not be some less experienced programmers contributing to the compiler. But then at last Mozilla also uses rust in production, so some parts have deadlines and even if not it's quite different for them then a `A-game`classification. Also it's not so, that you can't have metrics about lines/branch coverage, failed the build on certain thresholds, etc. It's just not necessary a build-in feature, through available nevertheless. Also it would be really strange if a programming language / build tool would decide which amount of coverage is ok, it's something the project manager/programmer has to decide (once) and then configure the build tool to enforce it (I most likely did misunderstood you on the last line ;-) ).

Ups, I wrote much to much.

TL;TR: 1) rust has less (programmer) resources 2) it's still young, tools like cargo, or the testing API are everything but complete. Through they do there job good enough for now.

Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @01:08PM (#13195312)
> Through it should be noted, that all "important" lints are in rustc, clippy just provides more useful ones.

This is expressed pretty nicely, thank you. I was struggling to express this in my other comment. rustc has all the lints which:

- Everyone mostly agrees upon

- Have rare false positives

- Are of the kind you'd expect from a good compiler

It doesn't have 150 lints because 150 lints would be annoying, and would drown out the "important" lints. I work on clippy, and I find this distinction very useful. When rustc tells you to fix something, you fix it. Clippy lints help /inform/, and you may ignore them often. But you don't always need to listen to clippy. If I wrote a bot that fixed all rustc warnings I'm sure people would be fine with just blindly running it. I cannot say the same about clippy (not because of bugs), and that's a good thing.

Re:Rust required to build Gecko by cpeterso on Friday December 16, 2016 @01:17PM (#13195373)
Have any lints prototyped in clippy been adopted by rustc?
Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @01:41PM (#13195581)
This was initially the goal of clippy; but rustc has a policy of "no new lints", partially because clippy exists :)

The plan instead is to polish clippy and distribute it via rustup.

Re:Rust required to build Gecko by steveklabnik on Friday December 16, 2016 @02:02PM (#13195767)
It's "no new lints without an RFC." Some believe that this is equivalent to "no new lints", but the door isn't actually totally shut.
Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @02:45PM (#13196127)
Practically, it pretty much is.

Yes, you can add new lints with an RfC. However, the bar for inclusion is very high.

I'm totally okay with the status quo, but I very much disagree that there is scope for uplifting lints to rustc from clippy with the current policies.

Re:Rust required to build Gecko by cpeterso on Friday December 16, 2016 @03:42PM (#13196589)
We've come full circle: C lint was created as a standalone program because C compilers were just about compiling code. :)

On one hand, I see how it is annoying when a compiler complains about code patterns that are not worth errors and could be false positives. OTOH, I feel like a language designed for safety should try to warn about as many bugs as possible. Would any of clippy's lints pass every Rust crate tested on Crater? Maybe those could be come rustc errors.

For fun:

  Lint, a C Program Checker (1977)
  http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.56.1841
The separation of function between lint and the C compilers has both historical and practical rationale. The compilers turn C programs into executable files rapidly and efficiently. This is possible in part because the compilers do not do sophisticated type checking, especially between separately compiled programs. Lint takes a more global, leisurely view of the program, looking much more carefully at the compatibilities.
Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @05:15PM (#13197393)
> Would any of clippy's lints pass every Rust crate tested on Crater?

lolnope

Well, there are lint-checking-lints, and there are very few linters out there, and clippy passes clippy, so those would pass. A couple other obscure lints that check for things that in practice never happen. Too obscure to be included in rustc I guess.

IMO a lint passing all of crater is a very good reason for it to not be included in rustc.

Re:Rust required to build Gecko by steveklabnik on Friday December 16, 2016 @11:21AM (#13194269)
Bazel already does have Rust support, by the way: https://github.com/bazelbuild/rules_rust
Re:Rust required to build Gecko by yazaddaruvala on Friday December 16, 2016 @04:48PM (#13197189)
Re:Rust required to build Gecko by wereHamster on Friday December 16, 2016 @01:41AM (#13191530)
You have to update the C++ compiler on your own, too. And the libc headers.
Re:Rust required to build Gecko by tedmielczarek on Monday December 19, 2016 @06:24AM (#13210760)
There's still a bit of an ideological divide between the Bazel "all your build dependencies are checked-in" and the autotools "you must provide these build dependencies" model. I'm not sure we'd ever drop support for building on systems that aren't Tier-1 to us, but I could see us getting closer to the Bazel model for the platforms we actually ship on.
Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @01:18AM (#13191451)
./mach bootstrap does this for Gecko.
Re:Rust required to build Gecko by sayrer on Friday December 16, 2016 @01:28AM (#13191482)
It look like "mach" is a tool that helps with Makefiles. I am not sure you understood what I wrote.

Or, maybe all of the environment variables I used when I worked on Firefox just happen to be the same, but the build system is totally different.

Re:Rust required to build Gecko by Manishearth on Friday December 16, 2016 @01:30AM (#13191488)
mach is the entry point of the build system. mach build builds it, mach bootstrap fetches prerequisites.