6 ms·
It was removed here, with a partial explanation: https://github.com/rust-lang/rust/commit/fca66702a44038b14d8f9bd282ad56c04e9fdcf6 https://github.com/rust-lang
by Retr0spectrum 10y ago
It was removed here, with a partial explanation:
https://github.com/rust-lang/rust/commit/fca66702a44038b14d8f9bd282ad56c04e9fdcf6 https://github.com/rust-lang/rust/commit/fca66702a44038b14d8...
"Adding blank lines means two steps from different defines will not end up on the same line."
- deleted 10y ago[deleted]
- kibwen 10y agoI was about to say, don't bother submitting a patch to fix this, as last week rustc completely moved away from make, deleting all its makefiles in the process: https://github.com/rust-lang/rust/pull/39431 https://github.com/rust-lang/rust/pull/39431 I'm curious how OP even ended up trawling old versions of rustc's makefiles from 2014. I bet there's an interesting story there. :P
- krupan 10y agoSo they switched from make to something called rustbuild, it appears. A quick search didn't turn up any details on rustbuild for me. Is it something very rust specific, or could I use it for other projects?
- steveklabnik 10y agoIt is specific to the compiler. https://github.com/rust-lang/rust/tree/master/src/bootstrap https://github.com/rust-lang/rust/tree/master/src/bootstrap It basically consists of: 1. A python script to make sure you have the correct environment, and that kicks off cargo to compile the program used in step 2. ("rustbuild" proper.) 2. A Rust program that manages the full build (remember, Rust is bootstrapped, so there's three stages...) 3. That build kicks off a number of "cargo build"s for all the components and glues the final result together. For any project written in Rust, pure Cargo should be enough.
- RX14 10y agoI've always been a bit confused about Rust's need for so many build stages. The project I work on (crystal) only requires you to install a working build of the latest compiler release to build. (the makefile is pretty simple). As far as I know, rust can't bootstrap without downloading a rust release, so can you explain why rust has compiler stages.
- steveklabnik 10y agoSo, there's three stages: 0. This stage is the pre-built compiler 1. This stage is a compiler built with the compiler from stage 0 2. This stage is a compiler built from stage 1. If the process worked, then stage 1 and stage 2's output should be identical. You can skip stage 2 if you want to skip that verification, and that sounds like what Crystal does.
- dbaupp 10y agoAdditionally, if one is building a compiler for other targets (both a compiler that runs on another target, and just a simple cross-compiler), the makefiles/rustbuild need to make sure the appropriate things get cross-compiled in the appropriate stages. Managing this was a source of a lot of complexity in the old makefiles.
- Gankro 10y agoI always mess this up, but here's something from memory: I believe there's ABI things that motivate stage 2. The compiler built in stage 0 has historically had special ifdefs to deal with "features that don't exist in the old snapshot" (we aggressively adopt our own features in the compiler and stdlib, because that's a great way to test them). This implies it can potentially emit binaries with a different ABI from the compilers built in stage 1 and 2. So the compiler that's output from stage 1 can actually have a different ABI from the binaries it produces. Normally this wouldn't matter, but Rust also supports compiler plugins written in Rust. These link directly to the compiler that compiles them. With the stage 1 compiler's quirky ABI, the plugins it compiles might not be able to interact with it. The stage 2 compiler, on the other hand, uses the same set of ifdefs that the stage 1 compiler has. So it was built by a compiler with the same output-ABI as itself, and so plugins have the same ABI. So: * snapshot: Built with snapshot ABI, produces snapshot ABI (snapshots are old stage2 compilers) * stage0-output: built with snapshot ABI, emits stage0 ABI. * stage1-output: built with stage0 ABI, emits not(stage0) ABI. * stage2-output: built with not(stage0) ABI, emits not(stage0) ABI.
- kibwen 10y agoIt's specific to rustc, to satisfy the unique demands of bootstrapping compilers. Unlike the makefiles it leverages Cargo as much as it can, which means that the compiler will gradually become less insular and will also benefit from future Cargo development. Right now the non-Cargo bits are written in Python (which was already required to build LLVM, so this doesn't add any new dependencies), but those bits could pretty much be written in anything, if needed.
- brson 10y agorustbuild is actually pure-Rust. The entire Rust build is written in Rust (Rust is bootstrapped all the way down!). The python scripts are a slim wrapper that downloads the bootstrap compiler to get into the Rust world.
- voltagex_ 10y agoAnyone know how Debian is handling this? Debian packages are not allowed to access the network on build, and (normally) are not allowed to depend on non-Debian binaries.
- brson 10y agorustbuild can optionally build from vendored (in-tree) source of all cargo dependencies, where it does not touch the network, and that's how we expect packagers to build Rust. I believe Debian has their own bootstrap lineage where they bootstrap from Debian's own prior builds, and rustbuild supports this mode; but they also have a fallback for rebootstrapping, with the corresponding policy exceptions. If you are interested, here's a draft Debian Rust packaging policy: https://internals.rust-lang.org/t/debian-rust-packaging-policy-draft/4453 https://internals.rust-lang.org/t/debian-rust-packaging-poli.... It is not about packaging Rust itself though but the challenges of packaging software written in Rust.
- tmzt 10y agoIs any version of rust still buildable from the previous OCaml version? Could it still be bootstrapped from that point?
- pitterpatter 10y agoI blame this twitter thread :P https://twitter.com/Gankro/status/831955401109360640 https://twitter.com/Gankro/status/831955401109360640
- Gankro 10y agoI have no regrets. Everyone should get to know the fear and joy of this Makefile.
- tambourine_man 10y agoThat was it indeed :)
- estsauver 10y agoThe thing I actually kind of think is amazing is that someone said "This isn't working... why don't I try putting in a $(nop) here...?"
- chc 10y agoMaybe there was something else there before, and it stopped working when they removed it, so they tried adding back the most minimal thing they could think of as a sanity check.
- hn_user2 10y ago"Why doesn't this work?". Add debug statement. "Huh, now this works". Take out debug statement. "Huh, now it doesn't work". Try no-op. Table flip. Commit.
- Beltiras 10y agoI love Heisenbugs because I have seen one in the wild. It's the most absurd thing ever.
- josefx 10y agoMaybe they even knew that white space would work. However some people (including me) wouldn't even look twice before they remove white space. An explicit no-op on the other hand would get my attention.
- msbarnett 10y agoMakefiles, where whitespace is the cause of, and solution to, all of your problems.
- trendia 10y agoWhitespace [0], where whitespace is the cause of, and solution to, all of your problems. [0] https://en.wikipedia.org/wiki/Whitespace_(programming_language) https://en.wikipedia.org/wiki/Whitespace_(programming_langua...
- WildUtah 10y agoI have my editor set to expand tabs to spaces. It plays havoc with Whitespace programs. Leaves all the comments intact, though.
- projektir 10y ago> "Adding blank lines means two steps from different defines will not end up on the same line." Do I even want to know why this is the case?
- bluepnume 10y agoWouldn't the $(nop) still have been better (more explicit, less likely to be accidentally removed) than the switch to blank lines?