Conversation
|
Amazing! On the file structure, since this repo is also meant to store files related to the project, can I suggest that we create a |
|
I was also wondering if you could break down the PR a bit more. I think there are changes here that are ready to be merged independently |
It seems feasible by writing a filter to the josh, though I haven't tried it yet. IMO it's OK to keep our
Yea makes sense. I'll split it up. |
|
CI wants some rustfmting |
| env: | ||
| TOOLS_BIN: "/tmp/smir/bin" | ||
| # Note that the downloaded version is dated 2025-08-09. | ||
| toolchain: nightly-2025-08-10 |
There was a problem hiding this comment.
I would prefer a toolchain toml file, as we'll update it frequently and that's easier to automate than editing a github workflow
Fine for now tho if you want to land this first and tune later
There was a problem hiding this comment.
Ah makes sense. I'd like to update it later together with the automation pr
There was a problem hiding this comment.
Will that be a follow up PR?
|
This changes the rustc_public crate. Can you check that it still works inside the rust repo if synced back? |
|
The rustc compilation fails directly since we have a really strict msrv in our build.rs. Can we use the |
|
wait, is it possible to keep the files for the crates.io version in a separate directory? We can specify which Cargo.toml to use when building, and Cargo.toml itself can define the lib and build files. |
Yea. I think the plan was to overwrite the sources of the crates.io copy every time we make a breaking change? |
|
Yes the rustc version would be the base of a new major release |
| env: | ||
| TOOLS_BIN: "/tmp/smir/bin" | ||
| # Note that the downloaded version is dated 2025-08-09. | ||
| toolchain: nightly-2025-08-10 |
There was a problem hiding this comment.
Will that be a follow up PR?
| TOOLS_BIN: "/tmp/smir/bin" | ||
| # Don't fail CI for now. See: https://github.com/rust-lang/project-stable-mir/issues/39 | ||
| continue-on-error: true | ||
| latest: |
There was a problem hiding this comment.
Btw, you should be able to create an action and reuse it for these two jobs. Not a big deal at this point, but if you have a follow up PR, that might be a nice change.
I also want to add a test for latest stable
There was a problem hiding this comment.
Btw, you should be able to create an action and reuse it for these two jobs. Not a big deal at this point, but if you have a follow up PR, that might be a nice change.
Yes, that would be done as follow up
I also want to add a test for latest stable
ummm iirc the stable version can’t enable rustc_private
There was a problem hiding this comment.
People would still need to set bootstrap env variable
| Ok(()) | ||
| } | ||
|
|
||
| macro_rules! regexes { |
There was a problem hiding this comment.
What are these regexes for? I thought ui_test handled this for us. @oli-obk?
There was a problem hiding this comment.
Not really, e.g., it won't normalize 0x0000000000000000 to $HEX, and the line and column info to :LL:CC.
There was a problem hiding this comment.
Gotcha! Can you add a comment saying what patterns we are matching and why? Regex are always so painful to maintain. Thanks
|
BTW, sorry for the delay. Next time, do you mind creating separate commits for moving files and content changes. It makes it much easier to visualize the content changes. Otherwise, everything looks like new code. |
|
Oh sorry about that, thanks for the reminder though. I'll make sure to do that next time. |
I feel like maintaining two versions of |
|
Can we use a cargo feature to indicate that we are being built as part of the compiler? |
|
Yea but I think we'd still have to maintain two Cargo.toml. |
|
I actually think a config is probably the right way to go. We can set the config as part of the compiler bootstrap. Wouldn't we be able to keep the same code in that case? |
|
Sorry for the delay. I think the problem is that they don't share the same dependencies in the Cargo.toml, so if we sync things like But TBH now I feel OK with just maintaining two versions of Cargo.toml files and using a cargo feature to indicate where we're being built. And we could add a filter for the josh sync to exclude the Cargo.toml :) What do you think? |
|
If you feel comfortable implementing that, I think it would be maintainable and understandable, so I'm good with it |
Ok... let's start there. We can adjust as we go. Thanks! |
|
Hey @makai410 is this ready? |
|
Sorry for the delay again... I think it's ready now. |
celinval
left a comment
There was a problem hiding this comment.
Let me know if the comments make sense. If so, feel free to merge once you address them. Thanks!!
rustc_public/Cargo.toml
Outdated
| license = "MIT OR Apache-2.0" | ||
| repository = "https://github.com/rust-lang/project-stable-mir" | ||
| edition = "2024" | ||
| build = "../build.rs" |
There was a problem hiding this comment.
Sorry, I just noticed this change now. Why are we moving the build script to a different folder?
There was a problem hiding this comment.
The build script checks the rustc version and would fail if synced back to rustc. So moving it to a different folder fixes this.
There was a problem hiding this comment.
We'd enable the build script only in our repo.
There was a problem hiding this comment.
Can you wrap the logic inside #[cfg(not(feature = "rustc-build"))] feature and keep the build script as is? I know you are planning to keep two separate copies of Cargo.toml, but I don't think we need to do the same for the build.rs.
* make rustc_public a `crates.io` crate * establish infrastructrure * move `tests/` to `rustc_public/` s * conditional compilation of rustc crates * remove redundant content in rustfmt.toml * remove rust-toolchain.toml of rustc_public * add `Cargo.lock`
* make rustc_public a `crates.io` crate * establish infrastructrure * move `tests/` to `rustc_public/` s * conditional compilation of rustc crates * remove redundant content in rustfmt.toml * remove rust-toolchain.toml of rustc_public * add `Cargo.lock`
* make rustc_public a `crates.io` crate * establish infrastructrure * move `tests/` to `rustc_public/` s * conditional compilation of rustc crates * remove redundant content in rustfmt.toml * remove rust-toolchain.toml of rustc_public * add `Cargo.lock`
* make rustc_public a `crates.io` crate * establish infrastructrure * move `tests/` to `rustc_public/` s * conditional compilation of rustc crates * remove redundant content in rustfmt.toml * remove rust-toolchain.toml of rustc_public * add `Cargo.lock`
buildis implemented here. This PR implements./x build,./x test [--bless],./x fmt [--check],./x githook install/uninstalland./x clean. Windows is not supported yet.compiletestcrate into a single file, making it possilbe to run test suites usingcargo test.