From 2f63f3ab14ad35c797b3d9ccac65ac8074ea74f7 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Mon, 4 Nov 2024 23:29:02 +0100 Subject: [PATCH] Fix non-default feature build: Feature gate `unpack_ffmpeg` with `download_ffmpeg` (#56) * Feature gate `unpack_ffmpeg` with `download_ffmpeg` * add cargo check without default features to ci --- .github/workflows/mac.yml | 2 ++ .github/workflows/ubuntu.yml | 2 ++ src/download.rs | 1 + 3 files changed, 5 insertions(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 76e6b5c..0f16246 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -19,6 +19,8 @@ jobs: - uses: FedericoCarboni/setup-ffmpeg@v3 - name: Build run: cargo build --verbose + - name: Check without default features + run: cargo check --no-default-features - name: Run tests run: cargo test --all-targets --all-features --verbose - name: Try auto-download diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index a1ca44e..ff7d846 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -19,6 +19,8 @@ jobs: - uses: FedericoCarboni/setup-ffmpeg@v3 - name: Build run: cargo build --verbose + - name: Check without default features + run: cargo check --no-default-features - name: Run tests run: cargo test --all-targets --all-features --verbose - name: Try auto-download diff --git a/src/download.rs b/src/download.rs index 707daa9..17e4e33 100644 --- a/src/download.rs +++ b/src/download.rs @@ -171,6 +171,7 @@ pub fn download_ffmpeg_package(url: &str, download_dir: &Path) -> anyhow::Result /// After downloading, unpacks the archive to a folder, moves the binaries to /// their final location, and deletes the archive and temporary folder. +#[cfg(feature = "download_ffmpeg")] pub fn unpack_ffmpeg(from_archive: &PathBuf, binary_folder: &Path) -> anyhow::Result<()> { let temp_dirname = UNPACK_DIRNAME; let temp_folder = binary_folder.join(temp_dirname);