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

Upgrade to cargo-c v0.10.0 + fix for cargo-c#383 #2228

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

wantehchang
Copy link
Collaborator

No description provided.

# v0.9.32 is the highest version of cargo-c we can upgrade to without a build
# failure (on Windows). See https://github.com/AOMediaCodec/libavif/pull/2223.
set(AVIF_LOCAL_CARGOC_GIT_TAG v0.9.32)
set(AVIF_LOCAL_CARGOC_GIT_TAG v0.10.0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @amyspark,

We (libavif) get a build error on Windows when we upgrade to cargo-c v0.10.0:

https://github.com/AOMediaCodec/libavif/actions/runs/9668355268/job/26672314397#step:6:1924

It is apparently related to your change "Implement installing MSVC debug symbols" in cargo-c v0.10.0. Could you take a look at this and see if you know what might be wrong?

I will try to reproduce the build error locally on my Windows laptop when I go home.

Thank you for your help!

Choose a reason for hiding this comment

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

Hi! From the looks of it I never thought of the case when Rust could not generate the PDB file on linking. However, I couldn't find what profile libavif's building rav1e with. Do you know if libavif is setting strip to something other than none, or alternatively, where it's selecting the build profile for rav1e?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @amyspark,

Thanks for taking a look! I am not familiar with Rust or rav1e, but you can find the relevant code by searching for "rav1e" in https://github.com/AOMediaCodec/libavif/blob/main/cmake/Modules/LocalRav1e.cmake.

I haven't had a chance to reproduce this build error on my Windows laptop.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reproduced the error locally. There is no rav1e.pdb. I tested with both the release and debug profile. The contents of the output directory is:

[.]                    [..]                   .cargo-lock            [.fingerprint]         [build]
cargo-c-rav1e.cache    [deps]                 [examples]             [include]              [incremental]
rav1e-uninstalled.pc   rav1e.d                rav1e.h                rav1e.lib              rav1e.pc

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems that rav1e.pdb is not generated if --library-type=staticlib is passed to cargo cinstall.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In lu-zero/cargo-c#279, we have:

tl;dr: if you install foo.dll you must also install foo.pdb next to it. Same with foo.exe. You can ignore static libraries.

Perhaps lu-zero/cargo-c@19ec991 should ignore static libraries?

Choose a reason for hiding this comment

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

One could still set on the release profile to not generate debugging information for shared libraries, so I'd go with making this step skippable if the PDB file is not present.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are right. It is best to assume the PDB file may not be present. Could you write a pull request for cargo-c? Thanks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hi @amyspark, I filed a bug report for cargo-c v0.10.0: lu-zero/cargo-c#383

@wantehchang wantehchang changed the title Upgrade to cargo-c v0.10.0 Upgrade to cargo-c v0.10.0 + fix for cargo-c#383 Jun 26, 2024
@wantehchang wantehchang merged commit 0f14f7b into AOMediaCodec:main Jun 26, 2024
28 checks passed
@wantehchang wantehchang deleted the upgrade-to-cargo-c-v0-10-0 branch June 26, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants