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

give dev-friendly error message for incorrect config profiles #118323

Merged

Conversation

onur-ozkan
Copy link
Member

before this change, an incorrect profile would result in the following error:

...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    with open(include_path) as included_toml:
         ^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/defaults/config.aaaa.toml'

with this change, the error message is now:

...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    raise Exception("Unrecognized profile '{}'. Check src/bootstrap/defaults"
Exception: Unrecognized profile 'aaaa'. Check src/bootstrap/defaults for available options.

@rustbot
Copy link
Collaborator

rustbot commented Nov 26, 2023

r? @clubby789

(rustbot has picked a reviewer for you, use r? to override)

@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 Nov 26, 2023
before this change, an incorrect profile would result in the following error:

```sh
...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    with open(include_path) as included_toml:
         ^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/defaults/config.aaaa.toml'
```

with this change, the error message is now:

```sh
...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    raise Exception("Unrecognized profile '{}'. Check src/bootstrap/defaults"
Exception: Unrecognized profile 'aaaa'. Check src/bootstrap/defaults for available options.
```

Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the better-error-for-incorrect-profiles branch from 2f91c62 to 1017042 Compare November 26, 2023 16:05
@clubby789
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 28, 2023

📌 Commit 1017042 has been approved by clubby789

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#118193 (Add missing period in `std::process::Command` docs)
 - rust-lang#118222 (unify read_to_end and io::copy impls for reading into a Vec)
 - rust-lang#118323 (give dev-friendly error message for incorrect config profiles)
 - rust-lang#118378 (Perform LTO optimisations with wasm-ld + -Clinker-plugin-lto)
 - rust-lang#118399 (Clean dead codes in miri)
 - rust-lang#118410 (update test for new LLVM 18 codegen)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 28, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#118193 (Add missing period in `std::process::Command` docs)
 - rust-lang#118222 (unify read_to_end and io::copy impls for reading into a Vec)
 - rust-lang#118323 (give dev-friendly error message for incorrect config profiles)
 - rust-lang#118378 (Perform LTO optimisations with wasm-ld + -Clinker-plugin-lto)
 - rust-lang#118399 (Clean dead codes in miri)
 - rust-lang#118410 (update test for new LLVM 18 codegen)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8f4ccc1 into rust-lang:master Nov 29, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 29, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 29, 2023
Rollup merge of rust-lang#118323 - onur-ozkan:better-error-for-incorrect-profiles, r=clubby789

give dev-friendly error message for incorrect config profiles

before this change, an incorrect profile would result in the following error:

```sh
...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    with open(include_path) as included_toml:
         ^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/defaults/config.aaaa.toml'
```

with this change, the error message is now:

```sh
...
...
  File "/home/nimda/devspace/onur-ozkan/rust/src/bootstrap/bootstrap.py", line 1088, in bootstrap
    raise Exception("Unrecognized profile '{}'. Check src/bootstrap/defaults"
Exception: Unrecognized profile 'aaaa'. Check src/bootstrap/defaults for available options.
```
@onur-ozkan onur-ozkan deleted the better-error-for-incorrect-profiles branch February 17, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants