gpu-allocator icon indicating copy to clipboard operation
gpu-allocator copied to clipboard

Fix minimal versions

Open SkiFire13 opened this issue 2 years ago • 4 comments

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.

SkiFire13 avatar Aug 26 '23 20:08 SkiFire13

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?

MarijnS95 avatar Aug 26 '23 21:08 MarijnS95

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

SkiFire13 avatar Aug 26 '23 21:08 SkiFire13

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.

xStrom avatar Sep 18 '23 20:09 xStrom

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 :tada:

MarijnS95 avatar Nov 07 '23 09:11 MarijnS95