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

Prevent mixing deprecated check-cfg syntax with new one #117612

Closed
wants to merge 3 commits into from

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Nov 5, 2023

This PR puts an hard error when trying to mix the deprecated check-cfg syntax with new one, doing that required updating the libc crate crate to version 0.2.150 (this also means making use of the new syntax when building stage 2 and above as libc isn't granular enough).

This was previously attempted in #117025 but had to be striped out due to the libc crate not being compliant.

While preventing the mixing isn't necessary per se, it will help make sure that we are going to be ready when removing the deprecated syntax.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 5, 2023
@rustbot
Copy link
Collaborator

rustbot commented Nov 5, 2023

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.

@rust-log-analyzer

This comment has been minimized.

This is required by the libc crate since it uses the new syntax as soon
as it detects rustc version 1.75 or above, which is the case when
building with stage 1 and above.
@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Nov 5, 2023
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-15 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ACTION=__run_7
GITHUB_ACTIONS=true
GITHUB_ACTION_REF=
GITHUB_ACTION_REPOSITORY=
GITHUB_ACTOR=Urgau
GITHUB_API_URL=https://api.github.com
GITHUB_BASE_REF=master
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_84f04e6a-4de2-4b92-9ed3-4ff9a5d91309
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=check-cfg-prevent-mixing
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_84f04e6a-4de2-4b92-9ed3-4ff9a5d91309
GITHUB_REF=refs/pull/117612/merge
GITHUB_REF_NAME=117612/merge
GITHUB_REF_PROTECTED=false
---
GITHUB_SERVER_URL=https://github.com
GITHUB_SHA=a53184d0cd31b38d615d4e6eb211235e49727e55
GITHUB_STATE=/home/runner/work/_temp/_runner_file_commands/save_state_84f04e6a-4de2-4b92-9ed3-4ff9a5d91309
GITHUB_STEP_SUMMARY=/home/runner/work/_temp/_runner_file_commands/step_summary_84f04e6a-4de2-4b92-9ed3-4ff9a5d91309
GITHUB_TRIGGERING_ACTOR=Urgau
GITHUB_WORKFLOW_REF=rust-lang/rust/.github/workflows/ci.yml@refs/pull/117612/merge
GITHUB_WORKFLOW_SHA=a53184d0cd31b38d615d4e6eb211235e49727e55
GITHUB_WORKSPACE=/home/runner/work/rust/rust
GOROOT_1_19_X64=/opt/hostedtoolcache/go/1.19.13/x64
---
##[group]Building stage1 library artifacts (x86_64-unknown-linux-gnu)
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc - --crate-name ___ --print=file-names --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: invalid `--check-cfg` argument: `cfg(bootstrap)` (expected `names(name1, name2, ... nameN)` or `values(name, "value1", "value2", ... "valueN")`)
Build completed unsuccessfully in 0:03:17
  local time: Sun Nov  5 15:41:20 UTC 2023
  network time: Sun, 05 Nov 2023 15:41:20 GMT
##[error]Process completed with exit code 1.

@Urgau
Copy link
Member Author

Urgau commented Nov 5, 2023

Hum. This may not be possible yet, I forgot that we still use beta Cargo, even for stage 2 and above.

@rustbot author
@rustbot blocked

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 5, 2023
@Urgau Urgau mentioned this pull request Nov 5, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 5, 2023
…lacrum

Bump libc dependency

This bumps the `libc` crate to version 0.2.150 which includes rust-lang/libc#3410 which will help remove the old and deprecated check-cfg syntax.

Extracted from rust-lang#117612
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 7, 2023
…lacrum

Bump libc dependency

This bumps the `libc` crate to version 0.2.150 which includes rust-lang/libc#3410 which will help remove the old and deprecated check-cfg syntax.

Extracted from rust-lang#117612
@Urgau
Copy link
Member Author

Urgau commented Nov 9, 2023

I don't think this is is gonna work out before the next Cargo bump, at which point we will remove the old syntax, rendering this PR useless.

Closing for now.

@Urgau Urgau closed this Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants