Skip to content

Commit

Permalink
Eliminate vendoring on Rawhide (#730)
Browse files Browse the repository at this point in the history
It has become possible to eliminate crate vendoring all together for
Rawhide.

This PR removes vendoring from the top level spec, Containerfile, and CI.

This also:
- Drops fc37 build
- Bumps nom to v7.1
- Switches from lmdb-rkv to lmdb v0.8
- Bumps other deps for Fedora package compat
- Uses urls for SourceX rather than relative paths

#715
  • Loading branch information
jw3 committed Jan 9, 2023
1 parent 037c647 commit e585d92
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 167 deletions.
3 changes: 2 additions & 1 deletion .copr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ dnf-rpmdev:
dnf install -y rpmdevtools

ifeq ($(OS_ID),rhel)
# we only need to vendor rust and python on rhel
vendor: prep_rpmbuild_dir vendor-app vendor-doc vendor-rs vendor-py
else
vendor: prep_rpmbuild_dir vendor-app vendor-doc vendor-rs
vendor: prep_rpmbuild_dir vendor-app vendor-doc
endif

vendor-app:
Expand Down
7 changes: 0 additions & 7 deletions .github/rpm-matrix.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"props": [
{
"platform": "fedora",
"dist": "fc37",
"spec": "fapolicy-analyzer.spec",
"image": "registry.fedoraproject.org/fedora:37",
"chroot": "fedora-37-x86_64"
},
{
"platform": "fedora",
"dist": "fc38",
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,18 @@ jobs:
- name: Export tarballs
run: |
mkdir -p /tmp/archives
mv vendor-rs.tar.gz /tmp/archives/vendor-rs.$PLATFORM.tar.gz
mv vendor-docs.tar.gz /tmp/archives
mv fapolicy-analyzer.tar.gz /tmp/archives
env:
PLATFORM: ${{ matrix.props.dist }}

- name: Export Rust vendor tarball
if: startsWith(matrix.props.dist, 'el')
run: |
mv vendor-rs.tar.gz /tmp/archives/vendor-rs.tar.gz
env:
PLATFORM: ${{ matrix.props.dist }}

- name: Upload tarballs
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -224,24 +230,14 @@ jobs:
with:
path: /tmp/archives/

- name: Release Spec File
run: |
out=/tmp/archives/fapolicy-analyzer.spec
base=https://github.com/$GITHUB_REPOSITORY/releases/download/${{ steps.tag_name.outputs.VERSION }}
cp fapolicy-analyzer.spec $out
sed -z -i -e "s#fapolicy-analyzer.tar.gz#$base/fapolicy-analyzer.tar.gz#" $out
sed -z -i -e "s#vendor-docs.tar.gz#$base/vendor-docs.tar.gz#" $out
sed -z -i -e "s#vendor-rs.tar.gz#$base/vendor-rs.tar.gz#" $out
sed -i -e "s#vendor-rs.tar.gz#vendor-rs%{?dist}.tar.gz#" $out
- name: Release artifacts
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag_name.outputs.VERSION }}
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') || contains(github.ref, 'rc') }}
draft: true
files: |
/tmp/archives/*.spec
${{ matrix.props.spec }}
/tmp/archives/rpm-artifacts/*.rpm
/tmp/archives/srpm-artifacts/*.src.rpm
/tmp/archives/tarball-artifacts/*.tar.gz
125 changes: 31 additions & 94 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ WORKDIR /tmp/rpmbuild
RUN spectool -gf -C SOURCES/ SPECS/fapolicy-analyzer.spec

COPY --chown=10001:0 fapolicy-analyzer.tar.gz SOURCES/
COPY --chown=10001:0 vendor-rs.tar.gz SOURCES/
COPY --chown=10001:0 vendor-docs.tar.gz SOURCES/
COPY --chown=10001:0 scripts/srpm/build.sh ./build.sh

Expand Down
2 changes: 1 addition & 1 deletion crates/analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2018"
path = "src/lib.rs"

[dependencies]
nom = "6.1.0"
nom = "7.1"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
chrono = "0.4.22"
Expand Down
5 changes: 2 additions & 3 deletions crates/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ version = "0.4.1"
edition = "2018"

[dependencies]
confy = "0.4.0"
directories = "2.0.2"
lmdb-rkv = "0.14.0"
confy = "0.4"
directories = "4.0"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"

Expand Down
2 changes: 1 addition & 1 deletion crates/daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version = "0.5.0"
edition = "2018"

[dependencies]
nom = "6.1.0"
nom = "7.1"
thiserror = "1.0"
fapolicy-trust = { version = "*", path = "../trust" }
fapolicy-rules = { version = "*", path = "../rules" }
Expand Down
2 changes: 1 addition & 1 deletion crates/rules/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ path = "src/lib.rs"
tempfile = "3.3"

[dependencies]
nom = "6.1.0"
nom = "7.1"
serde = { version = "1.0", features = ["derive"] }
thiserror = "1.0"
4 changes: 2 additions & 2 deletions crates/tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ path = "src/fapolicy_profiler.rs"

[dependencies]
clap = { version = "3.2.20", features = ["derive"] }
lmdb-rkv = "0.14.0"
nom = "6.1.0"
lmdb = "0.8"
nom = "7.1"
rayon = "1.5"
thiserror = "1.0"
ariadne = "0.1"
Expand Down

0 comments on commit e585d92

Please sign in to comment.