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

Fix clippy warnings #679

Merged
merged 7 commits into from
Oct 9, 2024
Merged

Fix clippy warnings #679

merged 7 commits into from
Oct 9, 2024

Conversation

andrewjcg
Copy link
Contributor

warning: unexpected `cfg` condition name: `unwind`
  --> src/python_spy.rs:38:11
   |
38 |     #[cfg(unwind)]
   |           ^^^^^^ help: found config with similar value: `panic =
"unwind"`
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint
config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg =
['cfg(unwind)'] }
   = help: or consider adding
`println!("cargo::rustc-check-cfg=cfg(unwind)");` to the top of the
`build.rs`
   = note: see
<https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html>
for more information about checking conditional configuration

```
warning: unexpected `cfg` condition name: `unwind`
  --> src/python_spy.rs:38:11
   |
38 |     #[cfg(unwind)]
   |           ^^^^^^ help: found config with similar value: `panic =
"unwind"`
   |
   = help: consider using a Cargo feature instead
   = help: or consider adding in `Cargo.toml` the `check-cfg` lint
config for the lint:
            [lints.rust]
            unexpected_cfgs = { level = "warn", check-cfg =
['cfg(unwind)'] }
   = help: or consider adding
`println!("cargo::rustc-check-cfg=cfg(unwind)");` to the top of the
`build.rs`
   = note: see
<https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html>
for more information about checking conditional configuration
```
@andrewjcg andrewjcg changed the title Fix unwind cfg lint warnings Fix clippy warnings Sep 3, 2024
@zanieb zanieb mentioned this pull request Oct 9, 2024
Copy link
Owner

@benfred benfred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR - this is really helpful!

@zanieb
Copy link
Contributor

zanieb commented Oct 9, 2024

As a note, I approached this quite differently in zanieb@045846a (and zanieb@224a783) — the downside to that is that it requires a newer Cargo version in your cross-build images.

@benfred
Copy link
Owner

benfred commented Oct 9, 2024

@zanieb nice! that does seem like a simpler change -

updating the docker cross-build images is something we should do at some point, but I'm inclined to get this PR merged to unblock some other necessary changes.

@zanieb
Copy link
Contributor

zanieb commented Oct 9, 2024

Definitely whatever works best for you.

The cross-build images merge with the upstream without conflict. I'm having some trouble building them though (mostly due to lack of understanding of how they're intended to be built).

@benfred
Copy link
Owner

benfred commented Oct 9, 2024

I'm having some trouble building them though (mostly due to lack of understanding of how they're intended to be built).

I usually build with:

# x86_64-unknown-linux-musl
docker build -t benfred/rust-musl-cross:x86_64-musl .
# aarch64-unknown-linux-musl
docker build --build-arg TARGET=aarch64-unknown-linux-musl --build-arg RUST_MUSL_MAKE_CONFIG=config.mak -t benfred/rust-musl-cross:aarch64-musl .
# armv7-unknown-linux-musleabihf
docker build --build-arg TARGET=armv7-unknown-linux-musleabihf --build-arg RUST_MUSL_MAKE_CONFIG=config.mak.32 -t benfred/rust-musl-cross:armv7-musleabihf .
# i686-unknown-linux-musl
docker build --build-arg TARGET=i686-unknown-linux-musl --build-arg RUST_MUSL_MAKE_CONFIG=config.mak.32 -t benfred/rust-musl-cross:i686-musl .
# powerpc64le-unknown-linux-musl
docker build --build-arg TARGET=powerpc64le-unknown-linux-musl --build-arg RUST_MUSL_MAKE_CONFIG=config.mak --build-arg TOOLCHAIN=nightly -t benfred/rust-musl-cross:powerpc64le-musl .

(which is a subset of the upstream project, but all I need for py-spy).

@benfred benfred merged commit 5820bf6 into benfred:master Oct 9, 2024
185 checks passed
@zanieb
Copy link
Contributor

zanieb commented Oct 10, 2024

I saw the build script but I'm on an aarch64 mac so I can't run it locally. I'm building them in GitHub instead. I think I've got it mostly figured out now. I can open a pull request if you open your repository to contributions.

(Sorry for the unrelated discussion on this PR!)

@benfred
Copy link
Owner

benfred commented Oct 10, 2024

I saw the build script but I'm on an aarch64 mac so I can't run it locally. I'm building them in GitHub instead. I think I've got it mostly figured out now. I can open a pull request if you open your repository to contributions.

I would appreciate a PR here - thanks for updating this!

@benfred
Copy link
Owner

benfred commented Oct 10, 2024

Also unrelated - but the windows build CI succeeded on this PR https://github.com/benfred/py-spy/actions/runs/11264051989/job/31323278597 but then immediately failed on the main branch =( https://github.com/benfred/py-spy/actions/runs/11264590823/job/31324954658 .

@benfred benfred added the chore label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants