Skip to content

Commit ac13aa1

Browse files
committed
fix(rpm): retain vendored Git source mappings
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent f026fc1 commit ac13aa1

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎.packit.yaml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ actions:
2727
# Uses git ls-files + tar instead of git archive so the tarball
2828
# reflects any patching that Packit may have done (e.g. version bumps).
2929
- 'bash -c "VERSION=${PACKIT_PROJECT_VERSION} && TMPDIR=$(mktemp -d) && DIR=openshell-${VERSION} && mkdir -p ${TMPDIR}/${DIR} && git ls-files -z | xargs -0 tar cf - | tar xf - -C ${TMPDIR}/${DIR}/ && tar -czf openshell-${VERSION}.tar.gz -C ${TMPDIR} ${DIR} && rm -rf ${TMPDIR}"'
30-
# Step 2: Create vendored Cargo dependencies tarball for offline RPM build.
31-
- 'bash -c "VERSION=${PACKIT_PROJECT_VERSION} && CARGO_HTTP_TIMEOUT=600 CARGO_NET_RETRY=5 cargo vendor --locked --quiet && tar -cJf openshell-${VERSION}-vendor.tar.xz vendor/ && rm -rf vendor/"'
30+
# Step 2: Preserve Cargo source replacements, including Git dependencies,
31+
# alongside vendored crates for the offline RPM build.
32+
- 'bash -c "VERSION=${PACKIT_PROJECT_VERSION} && CARGO_HTTP_TIMEOUT=600 CARGO_NET_RETRY=5 cargo vendor --locked > cargo-vendor-config.toml && tar -cJf openshell-${VERSION}-vendor.tar.xz vendor/ cargo-vendor-config.toml && rm -rf vendor/ cargo-vendor-config.toml"'
3233
# Step 3: Return the primary archive name. Packit expects create-archive
3334
# to print one path for Source0; Source1 is patched explicitly below.
3435
- 'bash -c "echo openshell-${PACKIT_PROJECT_VERSION}.tar.gz"'

‎openshell.spec‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ management, agent execution, and provider access via gRPC.
8686

8787
# Extract vendored Cargo dependencies and configure offline build
8888
tar xf %{SOURCE1}
89-
%cargo_prep -v vendor
89+
# Retain RPM build settings, then use Cargo's complete source mapping.
90+
# The -v macro redirects crates.io only and omits vendored Git sources.
91+
%cargo_prep -N
92+
cat cargo-vendor-config.toml >> .cargo/config.toml
9093

9194
# Patch workspace version from placeholder to actual build identity.
9295
sed -i 's/^version = "0.0.0"/version = "%{openshell_cargo_version}"/' Cargo.toml

0 commit comments

Comments
 (0)