Skip to content

Commit fce3626

Browse files
weiznichfolkertdev
authored andcommitted
Exclude development scripts from published package
During a dependency review we noticed that the bzip2-sys crate includes various development scripts. These development scripts shouldn't be there as they might, at some point become problematic. As of now they prevent any downstream user from enabling the `[bans.build.interpreted]` option of cargo deny. I opted for using an explicit include list instead of an exclude list to prevent these files from being included in the published packages to make sure that everything that's included is an conscious choice.
1 parent eebf6e4 commit fce3626

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ jobs:
8484
- name: Run cargo test (bzip2-sys)
8585
run: cargo test --no-default-features --features bzip2-sys
8686
if: matrix.build != 'wasm32'
87+
- name: Verify that all necessary files are included for bzip2-sys
88+
run: cargo package -p bzip2-sys
89+
if: matrix.build != 'wasm32'
8790

8891
rustfmt:
8992
name: Rustfmt

bzip2-sys/Cargo.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ Bindings to libbzip2 for bzip2 compression and decompression exposed as
1313
Reader/Writer streams.
1414
"""
1515
categories = ["external-ffi-bindings"]
16+
include = [
17+
"README.md",
18+
"lib.rs",
19+
"LICENSE-MIT",
20+
"LICENSE-APACHE",
21+
"build.rs",
22+
"bzip2-1.0.8/blocksort.c",
23+
"bzip2-1.0.8/huffman.c",
24+
"bzip2-1.0.8/crctable.c",
25+
"bzip2-1.0.8/randtable.c",
26+
"bzip2-1.0.8/compress.c",
27+
"bzip2-1.0.8/decompress.c",
28+
"bzip2-1.0.8/bzlib.c",
29+
"bzip2-1.0.8/include/bzlib.h",
30+
"bzip2-1.0.8/bzlib.h",
31+
"bzip2-1.0.8/bzlib_private.h",
32+
"bzip2-1.0.8/LICENSE",
33+
]
1634

1735
[lib]
1836
name = "bzip2_sys"

0 commit comments

Comments
 (0)