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

./x.py check library panics #89490

Closed
lopopolo opened this issue Oct 3, 2021 · 6 comments
Closed

./x.py check library panics #89490

lopopolo opened this issue Oct 3, 2021 · 6 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@lopopolo
Copy link
Contributor

lopopolo commented Oct 3, 2021

I ran ./x.py check library.

I expected this command to check all crates defined in the library directory or at least print a useful error.

Instead, I got a panic.

$ ./x.py check library
Updating only changed submodules
Submodules updated in 0.03 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
thread 'main' panicked at 'error: no rules matched library', src/bootstrap/builder.rs:236:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:01

Meta

rust HEAD:

commit 4479cb82e52989480a238e0cf8c67e04b655b36d (upstream/master, master)
Merge: c24c9067eec 1139ee32aa8
Author: bors <[email protected]>
Date:   Sun Oct 3 10:34:57 2021 +0000

    Auto merge of #89459 - tspiteri:idiv-overflow-bitand, r=kennytm

    Use bitand when checking for signed integer division overflow

    For `self == Self::MIN && rhs == -1`, LLVM does not realize that this is the same check made by `self / rhs`, so the code generated may have some unnecessary duplication. For `(self == Self::MIN) & (rhs == -1)`, LLVM realizes it is the same check.
@lopopolo lopopolo added the C-bug Category: This is a bug. label Oct 3, 2021
@jyn514
Copy link
Member

jyn514 commented Oct 3, 2021

@lopopolo you want x.py check library/std. It wouldn't hurt to make library an alias for that I suppose.

@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-enhancement Category: An issue proposing an enhancement or a PR with one. and removed C-bug Category: This is a bug. labels Oct 3, 2021
@Mark-Simulacrum
Copy link
Member

I would prefer to avoid those aliases, but we should have the full list of paths on hand so we could do something like "did you mean" and print out paths that could start with library/

@SkiFire13
Copy link
Contributor

I think library an alias doesn't have a clear default: would it be just library/std, or both library/std, library/alloc and library/core, or all the library/*? I feel like a shortcut for library/std, library/alloc and library/core might be useful though, since often a change in core might have an impact in a test of the other two crates, so you might want to test all of them just to be sure.

Going back to this issue, I think a panic gives a bad UX here, it's not an unexpected error that should never happen!

@jyn514
Copy link
Member

jyn514 commented Oct 4, 2021

@SkiFire13 right now x.py treats all four of those paths you mention as the same, it doesn't know how to build individual crates.

@SkiFire13
Copy link
Contributor

@jyn514 that doesn't seem to include tests though. If I make a test fail in library/core and then run x.py test library/std I don't see any failure pop up, but I do when I run x.py test library/core.

@jyn514
Copy link
Member

jyn514 commented Jul 11, 2022

Implemented in #95504.

@jyn514 jyn514 closed this as completed Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

4 participants