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 minimal versions #174

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SkiFire13
Copy link

@SkiFire13 SkiFire13 commented Aug 26, 2023

I was trying to compile bevy using cargo minimal-versions and noticed that gpu-allocator depended on backtrace 0.3 and log 0.4, but actually used features from backtrace 0.3.3 (Backtrace::new_unresolved and Backtrace::resolve) and log 0.4.9 (didn't import the log! macro when calling log::warn!; could be fixed by importing it too if you prefer it, but looks unnecessary), which made the build fail.

@MarijnS95
Copy link
Member

Would you mind contributing a cargo +nightly generate-lockfile -Zminimal-versions etc workflow to our CI so that this problem can be prevented in the future?

@SkiFire13
Copy link
Author

I wound't mind, but as is it would not pass due to problems in transitive dependencies, in particular the minimal version for winapi ends up being 0.2.5 which doesn't compile (I'm not sure what should be changed to fix this. 0.2.7 is the minimum where it compiles on my machine but it feels wrong to just add it to this crate) and imgui-sys should depend on cc 1.0.3 rather than cc 1.0 (I opened imgui-rs/imgui-rs#744 for that).

The CI workflow should be something like this:

  minimal-versions:
    name: Check minimal versions
    strategy:
      matrix:
        include:
        - os: ubuntu-latest
          features: vulkan,visualizer
        - os: windows-latest
          features: vulkan,visualizer,d3d12,public-winapi
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v3
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: nightly
          override: true
      - uses: taiki-e/install-action@cargo-hack
      - uses: taiki-e/install-action@cargo-minimal-versions
      - run: cargo minimal-versions build --workspace --features ${{ matrix.features }} --no-default-features

@xStrom
Copy link

xStrom commented Sep 18, 2023

I'm researching the potential of using -Z minimal-versions as well and also ran into a failed build due to this backtrace version 0.3.0 mis-dependency.

backtrace version 0.3.5 is where the winapi dependency got bumped from 0.2.5 to 0.3.3.

Perhaps we can bump the requirement here to at least 0.3.5 as well and see how things go then? When I tried doing that in my local fork it finally compiled, although I haven't done any runtime tests.

@MarijnS95
Copy link
Member

and also ran into a failed build due to this backtrace version 0.3.0 mis-dependency.

The backtrace crate is now entirely gone: #186 🎉

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.

None yet

3 participants