-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Use a u64 for the rmeta root position #118344
Conversation
This comment has been minimized.
This comment has been minimized.
1239003
to
c415fdf
Compare
This comment has been minimized.
This comment has been minimized.
c415fdf
to
424788e
Compare
This comment has been minimized.
This comment has been minimized.
424788e
to
3a7c358
Compare
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
// to know the length | ||
let mut bytes_before_version = [0u8; 13]; | ||
let mut bytes_before_version = [0u8; 17]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks support for previous versions, right?
The server will generally match the compiler, but this might still happen with already-built projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I patched this up by passing more data out of the version match above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably doesn't matter too much, but I think you could leave that as a 17 bytes array, and only read into a prefix slice of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That feels like too much brainpower for this code to me.
3a7c358
to
b94cfef
Compare
Hm, does this ever matter? I.e. should we maybe simply fix the cast and leave it as 32-bit offset? |
The crate root is written at the end of an rmeta file. So regardless of what we do elsewhere, we only support rmeta files up to the size that this offset supports. Unlike the other examples such as #103607 this needs two crates, because you need to write out an rmeta file that is more than 4 GB, then have another crate that tries to use it. So without this change, use cases #112934 and #111855 are only fixed if the large crate is not a dependency. |
Thanks for the explanation (I assumed (based on nothing) that the root is at the start) |
// Last supported version is: | ||
// https://github.com/rust-lang/rust/commit/0696e79f2740ad89309269b460579e548a5cd632 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should point to your commit updating the format (yes it looks like we forgot to update it 2 times already).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's so outdated that when I saw this I wasn't sure if it's supposed to point at the oldest or the newest version that's supported. I can point this at the first commit in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's supposed to point at the newest, because
-
Last
- This points to 6, but the oldest supported version is 5, so I don't think it could have been added as an oldest one
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
5f26659
to
79bdd24
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5701093): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 672.509s -> 670.568s (-0.29%) |
…Lapkin [AIX] Fix XCOFF metadata rust-lang#118344 accidentally changed the way to get metadata from XCOFF file and broken our internal CI. This PR reverts part of rust-lang#118344 .
Rollup merge of rust-lang#118905 - bzEq:revert-u64-on-xcoff, r=WaffleLapkin [AIX] Fix XCOFF metadata rust-lang#118344 accidentally changed the way to get metadata from XCOFF file and broken our internal CI. This PR reverts part of rust-lang#118344 .
Waffle noticed this in #117301 (comment)
We've upgraded the other file offsets to u64, and this one only costs 4 bytes per file. Also the way the truncation was being done before was extremely easy to miss, I sure missed it! It's not clear to me if not having this change effectively made the other upgrades from u32 to u64 ineffective, but we can have it now.
r? @WaffleLapkin