Hey, @Pietro Albini, I think now that we've merged the RFC about transitioning to rust-analyzer, it makes sense to package it as a rustup component.
I have two questions:
so, it depends how you want to ship it
the easiest way is to just have it as a component, shipping it with nightlies
the initial work needed is to add it as a submodule, and hook it up with the build system to build RA in dist builders and prepare a tarball for it
cc @simulacrum on that
yeah that seems like the right approach
how long does rust-analyzer take to build?
then the release process bits need to be updated to also ship RA only with nightly
and finally you need to coordinate with kinnison (on discord) to setup the bits on the rustup side
once the initial implementation is done, the only maintenance overhead is to send a PR bumping the submodule every time you want to update rustup
since RA is not really affected by rustc changes you can even
r+ rollup the PRs updating RA, since they won't break the build anyway (granted they build beforehand)
r? simulacrum on the build system bits,
r? me or mark on the release process bits, and
r? kinnison for the rustup bits
besides, I can't wait for RA to be available through rustup :heart:
yep, this sounds right. if it turns out that RA takes too long for our CI we can also explore taking binary artifacts and reuploading them, but I would rather not do that if at all possible to avoid.
The last commit took ~5m30s to build and test the
rust-analyzer executable and ~3m to just build it. Building and testing the vscode extension is less than 1min.
hm okay so seems probably well within fine
This might be the
debug build though, the release build for me is
real 495.99s user 3226.26s sys 29.97s rss 1087380k
Could you give a link for "and hook it up with the build system" part?
I imagine I can try to look how this is done for cargo and rustup, but, if you can just point me to the relevant file, that would help
sure! well, kind of
and then once you've configured the tool there and in builder.rs (the comment lies, you want builder not build, if you could fix that while there that'd be great)
you will need to add some code to dist.rs in bootstrap, following something like what we do for miri probably (miri is also nightly-only)
presumably rust analyzer will always build so we won't need any toolstate shenanigans
once that's done you'll want to post a PR and we can merge that, and then I forget if we need some polish somewhere else
iirc there's a bit you need to add to the manifest generator but I can't recall right now where that lives
@simulacrum the PR fails tidy check for code inside rust-analyze repository (we have test files with all kinds of weird shenanigans). Presumably, I should just exclude the whole submodule from tidy, right?
Yep! Look in src/tools/tidy, there should be at least one ignore list, maybe more
And the second question: how do I actually kick the
./x.py dist I thik doesn't build tools?
./x.py dist rls fails with assert about
ah you may need to enable extended in config.toml
@matklad should be able to grep for it
@simulacrum can I force-push branches with review fixes, or would it break the try build?
should be fine
Seems like try succeded. How do I grab the artifacts?
rustup-toolchain-install-master, but I can take a stab at it
seems to work for me (haven't tried running but the binary is there and ldd and running it doesn't just break completely)
$ ~/.rustup/toolchains/8e490eadad848809668611e7ae2a4b6ce5118bc1/bin/rust-analyzer --version
@matklad I'd be happy to r+ the PR with commits squashed into one -- have we gotten FCP from the relevant teams yet? I think so via RFC but I'll leave that to you to decide and feel free to r=me on the PR if so once you squash things down.
Yeah, I think it's fine to r+ -- there was an RFC, and reverting should be easy
So, I see rust-analyzer at https://static.rust-lang.org/dist/rust-nightly-x86_64-unknown-linux-gnu.tar.gz !
Next stop -- adding rustup component
rustup component add rust-analyzer-preview works now!
Is there anything I have to do/uninstall if I want to switch from
cargo xtask install to the rustup-shipped version?
Depending on your editor, you can set
rust-analyzer.serverPath to point to it
I don't think there's a
rustup shim, so it might not be in
yeah, symlink works nicely, cool :)