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

Register src/tools/unicode-table-generator as a runnable tool #131647

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

Conversation

jieyouxu
Copy link
Member

@jieyouxu jieyouxu commented Oct 13, 2024

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 and we can drop the triagebot message if desired).

Helps with #131640.

r? @Mark-Simulacrum (since I think you authored this tool?)

Bootstrap assumes that the binary name is the same as tool name, just
makes everyone's lives easier.
@rustbot rustbot added 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 Oct 13, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 13, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@jieyouxu
Copy link
Member Author

jieyouxu commented Oct 13, 2024

This seems to at least do something, i.e. modify library/core/src/unicode/unicode_data.rs.

PS E:\Repos\rust> ./x run src/tools/unicode-table-generator
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.06s
Building stage0 tool unicode-table-generator (x86_64-pc-windows-msvc)
   Compiling unicode-table-generator v0.1.0 (E:\Repos\rust\src\tools\unicode-table-generator)
    Finished `release` profile [optimized + debuginfo] target(s) in 1.20s
args: Args { inner: ["E:\\Repos\\rust\\build\\x86_64-pc-windows-msvc\\stage0-tools-bin\\unicode-table-generator.exe", "E:\\Repos\\rust\\library/core/src/unicode/unicode_data.rs"] }
Not refetching unicode data, already exists, please delete "unicode-downloads" to regenerate
Alphabetic     : 1727 bytes, 142759 codepoints in 757 ranges (65 - 205744) using skiplist
Case_Ignorable : 1053 bytes, 2749 codepoints in 452 ranges (39 - 918000) using skiplist
Cased          : 407 bytes, 4578 codepoints in 159 ranges (65 - 127370) using skiplist
Cc             : 9 bytes, 65 codepoints in 2 ranges (0 - 160) using skiplist
Grapheme_Extend: 887 bytes, 2193 codepoints in 375 ranges (768 - 918000) using skiplist
Lowercase      : 935 bytes, 2569 codepoints in 675 ranges (97 - 125252) using bitset
N              : 457 bytes, 1911 codepoints in 144 ranges (48 - 130042) using skiplist
Uppercase      : 799 bytes, 1978 codepoints in 656 ranges (65 - 127370) using bitset
there are 25 points
White_Space    : 256 bytes, 25 codepoints in 10 ranges (9 - 12289) using cascading
Total table sizes: 6530 bytes
Build completed successfully in 0:00:07

EDIT: because some const-hack comments in the tool were outdated, synced back from master made the diff go away.

These comments were updated on master but not through this tool, so the
comments in the tool became outdated. Sync the comments to stay
consistent.
…` that it needs to be generated by tool

And should not be directly edited.
@rustbot rustbot added the A-meta Area: Issues & PRs about the rust-lang/rust repository itself label Oct 13, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 13, 2024

triagebot.toml has been modified, there may have been changes to the review queue.

cc @davidtwco, @wesleywiser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants