Skip to content

Fix clippy warnings - #679

Merged
benfred merged 7 commits into
benfred:masterfrom
andrewjcg:unwind_cfg_lint
Oct 9, 2024
Merged

benfred merged 7 commits into
benfred:masterfrom
andrewjcg:unwind_cfg_lint

Conversation

@andrewjcg

Copy link
Copy Markdown
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

@benfred benfred left a comment

Copy link
Copy Markdown
Owner

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

zanieb commented Oct 9, 2024 •

Copy link
Copy Markdown
Contributor

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

benfred commented Oct 9, 2024

Copy link
Copy Markdown
Owner

@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

zanieb commented Oct 9, 2024

Copy link
Copy Markdown
Contributor

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

benfred commented Oct 9, 2024

Copy link
Copy Markdown
Owner

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
@zanieb

zanieb commented Oct 10, 2024

Copy link
Copy Markdown
Contributor

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

benfred commented Oct 10, 2024

Copy link
Copy Markdown
Owner

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

benfred commented Oct 10, 2024

Copy link
Copy Markdown
Owner

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