Skip to content

x setup -h -v should work #96049

@jyn514

Description

@jyn514
Member

x setup takes a short list of paths determined at runtime. Currently, it's special-cased in bootstrap rather than going through Step::should_run. But there's no need to special-case it - it can do the run time check in should_run instead, there's no sandbox. Switching it to should_run also has the advantage of automatically fixing x setup -h -v.

The list of paths is "all toml files in src/bootstrap/defaults".

Mentoring instructions:

  • Add impl Step for Profile in src/bootstrap/setup.rs
  • Remove the special-casing for Subcommand::Setup in Builder::new and Builder::get_step_descriptions.

cc @aswild - are you interested in tackling this after #96003?
@rustbot label +A-rustbuild +E-easy +E-medium
cc #96003 (comment)

Activity

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
on Apr 14, 2022
jyn514

jyn514 commented on Apr 14, 2022

@jyn514
MemberAuthor

@rustbot label -E-medium +E-mentor

added
E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
and removed
E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.
on Apr 14, 2022
lameferret

lameferret commented on Apr 15, 2022

@lameferret
Contributor

@rustbot claim

lameferret

lameferret commented on Apr 15, 2022

@lameferret
Contributor

@jyn514 can I get some more details please, as Profile is a lot different from the likes of docs.rs, native.rs, etc, and I can't figure it out looking at them.
Also, how to run tests for /bootstrap ?

jyn514

jyn514 commented on Apr 15, 2022

@jyn514
MemberAuthor
removed their assignment
on Apr 23, 2022
lameferret

lameferret commented on Apr 23, 2022

@lameferret
Contributor
bentongxyz

bentongxyz commented on Apr 24, 2022

@bentongxyz
Contributor

HI, is it okay if I try to work on this?

@rustbot claim

bentongxyz

bentongxyz commented on Apr 28, 2022

@bentongxyz
Contributor

Hi @jyn514, I would like to ask you a few questions, hope you don't mind! I'll be very succinct.

Right now, I managed to impl Step for Profile, so that if i run ./x.py setup -h -v, it prints:

(...Redacted)

        --llvm-profile-generate 
                        generate PGO profile with llvm built for rustc
        --llvm-profile-use PROFILE
                        use PGO profile for llvm build

Available paths:
    ./x.py setup src/bootstrap/defaults/config.codegen.toml
    ./x.py setup src/bootstrap/defaults/config.compiler.toml
    ./x.py setup src/bootstrap/defaults/config.library.toml
    ./x.py setup src/bootstrap/defaults/config.tools.toml
    ./x.py setup src/bootstrap/defaults/config.user.toml

The paths under 'Available paths:' are dynamically generated by getting all toml files under 'defaults' folder.

However, I have trouble proceeding because the setup subcommand's current behaviour actually does not take a path. Instead, it takes a profile name, such as library. I quote the help section:

This subcommand accepts a 'profile' to use for builds. For example:
./x.py setup library

i.e. If I run ./x.py setup src/bootstrap/defaults/config.library.toml, it will return an error.

So, should I change the current behaviour so that it accepts a path, e.g. src/bootstrap/defaults/config.library.toml?

This would involve changes to, amongst other things,

I hope I did not misunderstood something!

P.S. I'd be happy to chat with you in rust zulipchat if you'd prefer.

6 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jyn514@rustbot@Noratrieb@lameferret@bentongxyz

      Issue actions

        `x setup -h -v` should work · Issue #96049 · rust-lang/rust