Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ jobs:
openssl-devel
python-requests
python-semantic_version
- uses: dtolnay/rust-toolchain@master
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
- name: Check out ci repo
uses: actions/checkout@v6
with:
Expand Down
79 changes: 45 additions & 34 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,75 +21,86 @@ jobs:
matrix:
include:
- components: rustfmt
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
task: fmt-ci
- components: clippy
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
task: clippy
- components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
task: build
- components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
task: test
- components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
task: docs-ci
- components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
task: check-typos
- components: cargo
toolchain: 1.85.0 # LOWEST SUPPORTED RUST TOOLCHAIN
task: test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: ${{ matrix.components }}
toolchain: ${{ matrix.toolchain }}
- name: Install dependencies
run: |
sudo apt-get -q update
sudo apt-get -y install libblkid-dev
- name: Install typos-cli if required
run: ${{ matrix.task == 'check-typos' && 'cargo install typos-cli' || 'true' }}
- name: Test ${{ matrix.task }} on ${{ matrix.toolchain }} toolchain
- name: Test ${{ matrix.task }} on CURRENT DEVELOPMENT RUST TOOLCHAIN
run: make -f Makefile ${{ matrix.task }}

# Ubuntu checks
ubuntu-checks:
strategy:
matrix:
task: [build, test]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install dependencies
run: |
sudo apt-get -q update
sudo apt-get -y install libblkid-dev
- name: Run test on CURRENT DEVELOPMENT RUST TOOLCHAIN
run: make ${{ matrix.task }}
- name: Install toml-cli
Comment on lines +63 to +65

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

# Find and read the main.yml workflow file
git ls-files | grep -E "workflows|main\.yml"

Repository: stratis-storage/libblkid-rs

Length of output: 184


🏁 Script executed:

# Read the main.yml workflow file
wc -l .github/workflows/main.yml

Repository: stratis-storage/libblkid-rs

Length of output: 102


🏁 Script executed:

# Read the entire main.yml file with line numbers
cat -n .github/workflows/main.yml

Repository: stratis-storage/libblkid-rs

Length of output: 4482


Ubuntu build/test runs without required system dependency setup

The ubuntu-checks job runs make at line 62 without first installing libblkid-dev, unlike the checks job (lines 39-42) and macos-checks job (lines 90-91) which both install the dependency before building. This can cause build/link failures for build and test tasks.

Suggested fix
       - uses: actions-rust-lang/setup-rust-toolchain@v1
         with:
           components: ${{ matrix.components }}
+      - name: Install dependencies
+        run: |
+          sudo apt-get -q update
+          sudo apt-get -y install libblkid-dev
       - name: Run test on CURRENT DEVELOPMENT RUST TOOLCHAIN
         run: make ${{ matrix.task }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/main.yml around lines 61 - 63, The ubuntu-checks job runs
make (${ { matrix.task } }) without installing the system dependency
libblkid-dev; update the ubuntu-checks job to install libblkid-dev before the
build step (mirror the installation step used in the checks job) so that the
build/test tasks that require libblkid-dev succeed; locate the ubuntu-checks job
and add the apt-get install (or equivalent) of libblkid-dev prior to the "Run
test on CURRENT DEVELOPMENT RUST TOOLCHAIN" step.

run: pip install --user toml-cli
- name: Get package MSRV
id: msrv
run: |
PATH="$PATH:$(python3 -m site --user-base)/bin" MSRV=$(toml get --toml-path Cargo.toml "package.rust-version")
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
- name: Set toolchain override
run: /home/runner/.cargo/bin/rustup override set ${{ steps.msrv.outputs.MSRV }}
- name: Run test on LOWEST SUPPORTED RUST TOOLCHAIN
run: make ${{ matrix.task }}

# MacOS checks
macos-checks:
strategy:
matrix:
include:
- components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
task: build
- components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
task: test
- components: cargo
toolchain: 1.85.0 # LOWEST SUPPORTED RUST TOOLCHAIN
task: build
- components: cargo
toolchain: 1.85.0 # LOWEST SUPPORTED RUST TOOLCHAIN
task: test
task: [build, test]
env:
PKG_CONFIG_PATH: /opt/homebrew/opt/util-linux/lib/pkgconfig
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
with:
components: ${{ matrix.components }}
toolchain: ${{ matrix.toolchain }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install libblkid
run: brew install util-linux
- name: Build libblkid-rust
- name: Run test on CURRENT DEVELOPMENT RUST TOOLCHAIN
run: make ${{ matrix.task }}
- name: Install toml-cli
run: pip install --user toml-cli
- name: Get package MSRV
id: msrv
run: |
PATH="$PATH:$(python3 -m site --user-base)/bin" MSRV=$(toml get --toml-path Cargo.toml "package.rust-version")
echo "MSRV=$MSRV" >> "$GITHUB_OUTPUT"
- name: Set toolchain override
run: /Users/runner/.cargo/bin/rustup override set ${{ steps.msrv.outputs.MSRV }}
- name: Run test on LOWEST SUPPORTED RUST TOOLCHAIN
run: make ${{ matrix.task }}

# VERIFICATION OF TEST INFRASTRUCTURE
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
- name: Install dependencies
run: |
sudo apt-get -q update
Expand Down Expand Up @@ -49,10 +48,9 @@ jobs:
openssl-devel
python-requests
python-semantic_version
- uses: dtolnay/rust-toolchain@master
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
- name: Check out ci repo
uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -86,10 +84,8 @@ jobs:
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
verbose: true
rust-toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
manifest-path: libblkid-rs-sys
- name: Do semantic version checks
uses: obi1kenobi/cargo-semver-checks-action@v2
with:
verbose: true
rust-toolchain: 1.95.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.95.0" # CURRENT DEVELOPMENT RUST TOOLCHAIN