-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Missing docs on how to run unicode-table-generator #131640
Comments
maybe
This looks like a helper util that's not managed by bootstrap AFAICT EDIT: no it's not that simple, this will cause |
I got something working, I think?
|
This comment has been minimized.
This comment has been minimized.
That's very strange, I just get an error:
|
Oh sorry to be clear, I said "I got something working" i.e. I had to hook it up in bootstrap 😆 |
Ah :D |
When I ran it after hooking it up, it seemed like it just modified the FIXME messages, lol PS E:\Repos\rust> git diff .\library\
diff --git a/library/core/src/unicode/unicode_data.rs b/library/core/src/unicode/unicode_data.rs
index db2e3ddd754..143beb37706 100644
--- a/library/core/src/unicode/unicode_data.rs
+++ b/library/core/src/unicode/unicode_data.rs
@@ -18,14 +18,16 @@ const fn bitset_search<
let bucket_idx = (needle / 64) as usize;
let chunk_map_idx = bucket_idx / CHUNK_SIZE;
let chunk_piece = bucket_idx % CHUNK_SIZE;
- // FIXME(const-hack): Revert to `slice::get` when slice indexing becomes possible in const.
+ // FIXME: const-hack: Revert to `slice::get` after `const_slice_index`
+ // feature stabilizes.
let chunk_idx = if chunk_map_idx < chunk_idx_map.len() {
chunk_idx_map[chunk_map_idx]
} else {
return false;
};
let idx = bitset_chunk_idx[chunk_idx as usize][chunk_piece] as usize;
- // FIXME(const-hack): Revert to `slice::get` when slice indexing becomes possible in const.
+ // FIXME: const-hack: Revert to `slice::get` after `const_slice_index`
+ // feature stabilizes.
let word = if idx < bitset_canonical.len() {
bitset_canonical[idx]
} else { |
@RalfJung I hooked it up to bootstrap |
That's probably because I patched the |
Ok cool, I synced the comments in the tool to your changes, and |
|
I'll go add a triagebot message to remind that this is generated by the |
That PR changes both the tool and the generated file so it should not need any new manual sync... unless I screwed up and didn't properly do the same changes on both sides.
That's a good start, but ideally CI would fail if the file does not match. This could be a tidy check, maybe? Tidy already checks other, similar things. |
Ah right good point.
I mean, it can be checked by trying to run |
…r=Mark-Simulacrum Register `src/tools/unicode-table-generator` as a runnable tool It seems like `src/tools/unicode-table-generator` is not currently managed by bootstrap. This PR wires it up with bootstrap as a runnable tool. This tool seems to take two possible args: 1. (Mandatory) path to `library/core/src/unicode/unicode_data.rs`, and 2. (Optional) path to generate a test file. I only passed the mandatory path to `unicode_data.rs` in bootstrap and didn't do anything about (2). I'm not sure about how this tool is supposed to be run. `Cargo.lock` is modified because I renamed `unicode-table-generator`'s bin name to match the tool name, as bootstrap's tool running logic expects the bin name to be derived from the tool name. I also added a triagebot message to remind to not manually edit the library source file and edit the tool then regenerate instead, but this should probably be a tidy check (if that's desirable then that can be in a follow-up PR, though may be overkill). Helps with rust-lang#131640 but does not close it because still no docs. r? `@Mark-Simulacrum` (since I think you authored this tool?)
Rollup merge of rust-lang#131647 - jieyouxu:unicode-table-generator, r=Mark-Simulacrum Register `src/tools/unicode-table-generator` as a runnable tool It seems like `src/tools/unicode-table-generator` is not currently managed by bootstrap. This PR wires it up with bootstrap as a runnable tool. This tool seems to take two possible args: 1. (Mandatory) path to `library/core/src/unicode/unicode_data.rs`, and 2. (Optional) path to generate a test file. I only passed the mandatory path to `unicode_data.rs` in bootstrap and didn't do anything about (2). I'm not sure about how this tool is supposed to be run. `Cargo.lock` is modified because I renamed `unicode-table-generator`'s bin name to match the tool name, as bootstrap's tool running logic expects the bin name to be derived from the tool name. I also added a triagebot message to remind to not manually edit the library source file and edit the tool then regenerate instead, but this should probably be a tidy check (if that's desirable then that can be in a follow-up PR, though may be overkill). Helps with rust-lang#131640 but does not close it because still no docs. r? `@Mark-Simulacrum` (since I think you authored this tool?)
The file
library/core/src/unicode/unicode_data.rs
saysHowever, it doesn't say how to run that tool. The "obvious"
./x.py run src/tools/unicode-table-generator
does not work. I didn't find anything in the dev guide either.So I now edited the file by hand instead 🤷 but that can't be the goal of this.^^
Cc @Mark-Simulacrum
The text was updated successfully, but these errors were encountered: