Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] ./x test rust-analyzer #136779

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Feb 9, 2025

I somehow made ./x test rust-analyzer work on my machine1, but at what cost?

Not intended for merge but only as a reference. If we do want to land this, I'll need to tidy this up.

Notes:

  • I abused a bunch of cargo features in-rust-tree. It probably doesn't need to be, and simply --cfg might work. I was trying to get the main rust-analyzer tests to build at all. Anything building is already a miracle.
  • I had to slap a bunch of the following to all the r-a crates to get the tests to build at all. I don't 100% understand why, but otherwise I get a whole ton of expected `rustc_lexer` to be available in rlib format build failures.
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(all(feature = "in-rust-tree", test))]
extern crate rustc_driver as _;
  • Skipped one config test that was fixed on r-a master but not synced here in r-l/r yet.

try-job: aarch64-gnu
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: x86_64-msvc-1

Footnotes

  1. x86_64-unknown-linux-gnu, haven't bothered trying this on msvc yet.

@rustbot

This comment was marked as off-topic.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 9, 2025
@jieyouxu jieyouxu added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 9, 2025
@jieyouxu
Copy link
Member Author

jieyouxu commented Feb 9, 2025

Sorry Albert, this PR is purely for reference purposes and is highly experimental.

@jieyouxu jieyouxu added the T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. label Feb 9, 2025
src/tools/rust-analyzer/crates/base-db/src/lib.rs Outdated Show resolved Hide resolved
Comment on lines 33 to 34
[features]
default = []
in-rust-tree = []
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe could be --cfg instead but idk

Comment on lines +402 to +397
// RA's test suite tries to write to the source directory, that can't work in Rust CI.
cargo.env("SKIP_SLOW_TESTS", "1");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this will mean not all r-a tests would be run via ./x test rust-analyzer

src/bootstrap/src/core/build_steps/test.rs Outdated Show resolved Hide resolved
Comment on lines +45 to +47
/// When using `download-rustc`, we need to use a new build of `std` for running unit tests of
/// std itself, but we need to use the downloaded copy of std for linking to rustdoc. Allow this
/// to be overridden by `builder.ensure` from other steps.
Copy link
Member Author

@jieyouxu jieyouxu Feb 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated comment reflow diffs, was annoying when reading these locally, I'll drop these formatting diffs if we want to merge the actual changes.

Comment on lines +114 to +121
trace!(
?force_recompile,
is_git_managed = builder.rust_info().is_managed_git_subrepository(),
download_rustc = builder.download_rustc(),
last_modified_commit =
?builder.config.last_modified_commit(&["library"], "download-rustc", true),
"checking std force-recompile"
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated tracing diff, was mostly to help local debugging, I'd like to upstream some of these tracing bits separately (unrelated to r-a tests).

Comment on lines -1847 to 1965
if let Some(enzyme_install) = enzyme_install {
if builder.config.llvm_enzyme {
let enzyme_install = builder.ensure(llvm::Enzyme { target: build_compiler.host });
let lib_ext = std::env::consts::DLL_EXTENSION;
let src_lib = enzyme_install.join("build/Enzyme/libEnzyme-19").with_extension(lib_ext);
let libdir = builder.sysroot_target_libdir(build_compiler, build_compiler.host);
let target_libdir =
builder.sysroot_target_libdir(target_compiler, target_compiler.host);
builder.sysroot_target_libdir(output_compiler, output_compiler.host);
let dst_lib = libdir.join("libEnzyme-19").with_extension(lib_ext);
let target_dst_lib = target_libdir.join("libEnzyme-19").with_extension(lib_ext);
builder.copy_link(&src_lib, &dst_lib);
builder.copy_link(&src_lib, &target_dst_lib);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated enzyme change

skip_all,
fields(target = ?self.target, compiler = ?self.compiler),
),
)]
fn run(self, builder: &Builder<'_>) -> u32 {
let compiler = self.compiler;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Rustc there's a comment on self.compiler that says

    /// The **previous** compiler used to compile this compiler.
    pub compiler: Compiler,

I'm not 100% sure if that's actually true under all scenarios.

Comment on lines +366 to +376
#[cfg_attr(
feature = "tracing",
instrument(
level = "debug",
name = "RustAnalyzer::run",
skip_all,
fields(stage = self.stage, host = ?self.host),
),
)]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but you can look at the tracing logs locally via

$ BOOTSTRAP_TRACING=bootstrap=trace ./x test rust-analyzer

(or =debug)

@bors
Copy link
Contributor

bors commented Feb 9, 2025

☔ The latest upstream changes (presumably #136751) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 9, 2025
@jieyouxu jieyouxu requested a review from onur-ozkan February 10, 2025 14:21
@jieyouxu
Copy link
Member Author

(Uh sorry Onur, I have no idea how I managed to click that button, did not mean to do that)

Comment on lines 405 to 415
// FIXME: may need a fix from https://github.com/rust-lang/rust-analyzer/pull/19124.
"--skip=config::tests::cargo_target_dir_subdir",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other tests pass locally, except for the test fixed in rust-lang/rust-analyzer#19124 (which can be re-eval'd after the next subtree sync)

@jieyouxu

This comment was marked as resolved.

@bors

This comment was marked as resolved.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 10, 2025
[DO NOT MERGE] `./x test rust-analyzer`

I somehow made `./x test rust-analyzer` work on my machine[^machine], **but at what cost?**

Not intended for merge but only as a reference. If we do want to land this, I'll need to tidy this up.

Notes:

- I abused a bunch of cargo features  `in-rust-tree`. It probably doesn't need to be, and simply `--cfg` might work. I was trying to get the main rust-analyzer tests to build *at all*. Anything building is already a miracle.
- I had to slap a bunch of the following to all the r-a crates to get the tests to build at all. I don't 100% understand why, but otherwise I get a whole ton of ``expected `rustc_lexer` to be available in rlib format`` build failures.

```rs
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(all(feature = "in-rust-tree", test))]
extern crate rustc_driver as _;
```

- Skipped one config test that was fixed on r-a master but not synced here in r-l/r yet.

[^machine]: `x86_64-unknown-linux-gnu`, haven't bothered trying this on msvc yet.

try-job: aarch64-gnu
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: i686-mingw-1
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: x86_64-msvc-1
@rust-log-analyzer

This comment was marked as off-topic.

@jieyouxu
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Feb 10, 2025

⌛ Trying commit 5ae6a16 with merge 74d2e0b...

@jieyouxu
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2025
[DO NOT MERGE] `./x test rust-analyzer`

I somehow made `./x test rust-analyzer` work on my machine[^machine], **but at what cost?**

Not intended for merge but only as a reference. If we do want to land this, I'll need to tidy this up.

Notes:

- I abused a bunch of cargo features  `in-rust-tree`. It probably doesn't need to be, and simply `--cfg` might work. I was trying to get the main rust-analyzer tests to build *at all*. Anything building is already a miracle.
- I had to slap a bunch of the following to all the r-a crates to get the tests to build at all. I don't 100% understand why, but otherwise I get a whole ton of ``expected `rustc_lexer` to be available in rlib format`` build failures.

```rs
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(all(feature = "in-rust-tree", test))]
extern crate rustc_driver as _;
```

- Skipped one config test that was fixed on r-a master but not synced here in r-l/r yet.

[^machine]: `x86_64-unknown-linux-gnu`, haven't bothered trying this on msvc yet.

try-job: aarch64-gnu
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: x86_64-msvc-1
@bors
Copy link
Contributor

bors commented Feb 14, 2025

⌛ Trying commit b1738c9 with merge 7388bdea11d7e5065c7352cc6a1c9c6eb81a91e8...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 14, 2025

💔 Test failed - checks-actions

@jieyouxu
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Feb 14, 2025

⌛ Trying commit 5322e1c with merge 1105fba3228149721a170beb101c38f9fd83b35b...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2025
[DO NOT MERGE] `./x test rust-analyzer`

I somehow made `./x test rust-analyzer` work on my machine[^machine], **but at what cost?**

Not intended for merge but only as a reference. If we do want to land this, I'll need to tidy this up.

Notes:

- I abused a bunch of cargo features  `in-rust-tree`. It probably doesn't need to be, and simply `--cfg` might work. I was trying to get the main rust-analyzer tests to build *at all*. Anything building is already a miracle.
- I had to slap a bunch of the following to all the r-a crates to get the tests to build at all. I don't 100% understand why, but otherwise I get a whole ton of ``expected `rustc_lexer` to be available in rlib format`` build failures.

```rs
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(all(feature = "in-rust-tree", test))]
extern crate rustc_driver as _;
```

- Skipped one config test that was fixed on r-a master but not synced here in r-l/r yet.

[^machine]: `x86_64-unknown-linux-gnu`, haven't bothered trying this on msvc yet.

try-job: aarch64-gnu
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: x86_64-msvc-1
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 14, 2025

💔 Test failed - checks-actions

@jieyouxu
Copy link
Member Author

@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2025
[DO NOT MERGE] `./x test rust-analyzer`

I somehow made `./x test rust-analyzer` work on my machine[^machine], **but at what cost?**

Not intended for merge but only as a reference. If we do want to land this, I'll need to tidy this up.

Notes:

- I abused a bunch of cargo features  `in-rust-tree`. It probably doesn't need to be, and simply `--cfg` might work. I was trying to get the main rust-analyzer tests to build *at all*. Anything building is already a miracle.
- I had to slap a bunch of the following to all the r-a crates to get the tests to build at all. I don't 100% understand why, but otherwise I get a whole ton of ``expected `rustc_lexer` to be available in rlib format`` build failures.

```rs
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(all(feature = "in-rust-tree", test))]
extern crate rustc_driver as _;
```

- Skipped one config test that was fixed on r-a master but not synced here in r-l/r yet.

[^machine]: `x86_64-unknown-linux-gnu`, haven't bothered trying this on msvc yet.

try-job: aarch64-gnu
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: x86_64-msvc-1
@bors
Copy link
Contributor

bors commented Feb 14, 2025

⌛ Trying commit 34ff523 with merge 249d236...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Feb 14, 2025

💔 Test failed - checks-actions

@jieyouxu
Copy link
Member Author

@bors try

@bors
Copy link
Contributor

bors commented Feb 14, 2025

⌛ Trying commit 34ff523 with merge c91d3c9...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2025
[DO NOT MERGE] `./x test rust-analyzer`

I somehow made `./x test rust-analyzer` work on my machine[^machine], **but at what cost?**

Not intended for merge but only as a reference. If we do want to land this, I'll need to tidy this up.

Notes:

- I abused a bunch of cargo features  `in-rust-tree`. It probably doesn't need to be, and simply `--cfg` might work. I was trying to get the main rust-analyzer tests to build *at all*. Anything building is already a miracle.
- I had to slap a bunch of the following to all the r-a crates to get the tests to build at all. I don't 100% understand why, but otherwise I get a whole ton of ``expected `rustc_lexer` to be available in rlib format`` build failures.

```rs
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(all(feature = "in-rust-tree", test))]
extern crate rustc_driver as _;
```

- Skipped one config test that was fixed on r-a master but not synced here in r-l/r yet.

[^machine]: `x86_64-unknown-linux-gnu`, haven't bothered trying this on msvc yet.

try-job: aarch64-gnu
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: x86_64-msvc-1
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@bors
Copy link
Contributor

bors commented Feb 14, 2025

💔 Test failed - checks-actions

@jieyouxu
Copy link
Member Author

Please?
@bors try

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 14, 2025
[DO NOT MERGE] `./x test rust-analyzer`

I somehow made `./x test rust-analyzer` work on my machine[^machine], **but at what cost?**

Not intended for merge but only as a reference. If we do want to land this, I'll need to tidy this up.

Notes:

- I abused a bunch of cargo features  `in-rust-tree`. It probably doesn't need to be, and simply `--cfg` might work. I was trying to get the main rust-analyzer tests to build *at all*. Anything building is already a miracle.
- I had to slap a bunch of the following to all the r-a crates to get the tests to build at all. I don't 100% understand why, but otherwise I get a whole ton of ``expected `rustc_lexer` to be available in rlib format`` build failures.

```rs
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(all(feature = "in-rust-tree", test))]
extern crate rustc_driver as _;
```

- Skipped one config test that was fixed on r-a master but not synced here in r-l/r yet.

[^machine]: `x86_64-unknown-linux-gnu`, haven't bothered trying this on msvc yet.

try-job: aarch64-gnu
try-job: x86_64-apple-1
try-job: aarch64-apple
try-job: i686-mingw
try-job: x86_64-mingw-1
try-job: i686-msvc-1
try-job: x86_64-msvc-1
@bors
Copy link
Contributor

bors commented Feb 14, 2025

⌛ Trying commit 34ff523 with merge 91f9263...

@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
/dev/sdb1       147G  4.1G  136G   3% /mnt
tmpfs           1.6G  4.0K  1.6G   1% /run/user/1001
================================================================================

Failed to stop mysql.service: Unit mysql.service not loaded.
##[error]Process completed with exit code 5.

@bors
Copy link
Contributor

bors commented Feb 14, 2025

💔 Test failed - checks-actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants