-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
errors: generate typed identifiers in each crate #103042
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
c87a9c0
to
c5bb5ee
Compare
This comment was marked as resolved.
This comment was marked as resolved.
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 wonder if it would be possible to collect all the locale files into one directory in compiler/
, maybe compiler/locales
. Then the translation tool could be pointed at that, and you would only have one directory for each individual language, instead of one per crate. It would also help with ignoring the ftl files during a grep.
Edit: the "ftl contained in crate" use case is still valuable IMO e.g. for outside projects like custom codegen backends or clippy. But for the large majority of cases, the ftl files would reside in one directory.
Also I wonder if instead of extending the driver, one could add another crate that collects all the translations, and have rustc_driver depend on that. Not sure about this one tho. Thoughts?
This comment was marked as resolved.
This comment was marked as resolved.
c5bb5ee
to
0d307dc
Compare
I don't have a particularly strong preference here. I don't know if there is a significant advantage to this. I haven't looked into how the translation tooling works to know whether a single directory will be easier or not, but it is very likely that only the original English will be in this repository regardless.
We could do this, it's really only an aesthetic consideration, so I don't have a strong opinion. In both cases, will wait for others to weigh in. |
I've looked at rustc_codegen_gcc and it seems to use the
Oh that changes a few things. In that case, the current state is okay. I wonder about the extra directory level, but that's only a papercut, as the disadvantage of it is quite minor (extra click in many IDEs). Some people might in fact prefer the |
This comment has been minimized.
This comment has been minimized.
0d307dc
to
0198466
Compare
This comment has been minimized.
This comment has been minimized.
e9f4a47
to
9ae650e
Compare
This comment has been minimized.
This comment has been minimized.
9ae650e
to
fc34a0a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
fc34a0a
to
c8d990b
Compare
6552aa0
to
e19f06b
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Finished benchmarking commit (b869e84): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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.
|
Probably noise, @rustbot label: +perf-regression-triaged |
Update the toolchain to use nightly-2023-04-16. Changes were related to the following changes to the toolchain: - rust-lang/rust#108944 - rust-lang/rust#108148 - rust-lang/rust#108471 - rust-lang/rust#109358 - rust-lang/rust#109849 - rust-lang/rust#109819 - rust-lang/rust#109718 - rust-lang/rust#109092 - rust-lang/rust#108856 - rust-lang/rust#105613 - rust-lang/rust#103042 - rust-lang/rust#109716 - rust-lang/rust#108340 - rust-lang/rust#102906 - rust-lang/rust#98112 - rust-lang/rust#108080
Instead of loading the Fluent resources for every crate in
rustc_error_messages
, each crate generates typed identifiers for its own diagnostics and creates a static which are pulled together in therustc_driver
crate and provided to the diagnostic emitter.There are advantages and disadvantages to this change..
Advantages
rustc_error_messages
and all crates thereafter.rust-lang/thorin
in Migratecodegen_ssa
to diagnostics structs - [Part 1] #102612 (comment), cc @JhonnyBillM)rustc_error_messages
)Disadvantages
rustc_driver
(or some other crate we create for this purpose) has to directly depend on everything that has error messages.Pending work
rustc_codegen_gcc
's translated diagnostics work with this approach - becauserustc_driver
can't depend on that crate and so can't get its resources to provide to the diagnostic emission. I don't really know how the alternative codegen backends are actually wired up to the compiler at all.triagebot.toml
to track the moved FTL files.r? @compiler-errors
cc #100717