I made a mistake merge. Reverting it in c778945806 undid the state
on master, but now I realize it crippled the git merge mechanism.
As the merge contained a mix of commits from `master..staging-next`
and other commits from `staging-next..staging`, it got the
`staging-next` branch into a state that was difficult to recover.
I reconstructed the "desired" state of staging-next tree by:
- checking out the last commit of the problematic range: 4effe769e2
- `git rebase -i --preserve-merges a8a018ddc0` - dropping the mistaken
merge commit and its revert from that range (while keeping
reapplication from 4effe769e2)
- merging the last unaffected staging-next commit (803ca85c20)
- fortunately no other commits have been pushed to staging-next yet
- applying a diff on staging-next to get it into that state
We expose it on the top level, but I don't think it makes sense to pull
it from a specific version of the rust tools when it is in fact version
agnostic.
This reverts a tiny portion of 912dca193a.
Due to a recent change in rustc 1.45.0, rustfmt now requires two
additional environment variables to be set in order to build
successfully: `CFG_RELEASE` and `CFG_RELEASE_CHANNEL`.
rls has racer baked in which needs to know where the rust source
is to be able to do completion for std libs. By default rls will use:
$(rustc --print sysroot)/lib/rustlib/src/rust/src
which is nonexistent, this commit sets the correct source path
in a same way like it's done in racer expression.
There are several tarballs (such as the `rust-lang/rust`-source) with a
`Cargo.toml` at root and several sub-packages (with their own Cargo.toml)
without using workspaces[1].
In such a case it's needed to move into a subdir to only build the
specified sub-package (e.g. `rustfmt` or `rsl`), however the artifacts
are at `/target` in the root-dir of the build environment. This breaks
the build since `buildRustPackage` searches for executables in `target`
(which is at the build-env's root) at the end of the `buildPhase`.
With the optional `buildAndTestSubdir`-argument, the builder moves into
the specified subdir using `pushd`/`popd` during `buildPhase` and
`checkPhase`.
Also moved the logic to find executables and libs to the end of the `buildPhase`
from a custom `postBuild`-hook to fix packages with custom `build`/`install`-procedures
such as `uutils-coreutils`.
[1] https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html
Kept 1.42 around for Thunderbird.
i686-apple-darwin is no longer supported upstream. We could still
support building it, for this one release, since we have the binary
for the previous release, (or bootstrap it for future releases from
Rust 1.42,) but since this release is the one that drops support, I
think it makes sense to do it now. (And probably nobody is using it
anyway.)