Skip to content
Draft
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
11 changes: 8 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,6 @@ jobs:
# Do not edit this file in .github/workflows
build-freebsd-main: # job-name skip-stable
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'schedule' }} # skip-stable
steps:
- uses: actions/checkout@v6
with:
Expand All @@ -1357,7 +1356,10 @@ jobs:
- name: Run a full build
uses: vmactions/freebsd-vm@v1
with:
release: 13.2
# HACK: Due to <https://github.com/alexcrichton/curl-rust/issues/632>
# we cannot use v13 or v14 for testing for now, but it should be okay
# since we only have best-effort testing on FreeBSD.
release: "15.0"
usesh: true
copyback: false
prepare: |
Expand Down Expand Up @@ -1389,7 +1391,10 @@ jobs:
- name: Run a full build
uses: vmactions/freebsd-vm@v1
with:
release: 13.2
# HACK: Due to <https://github.com/alexcrichton/curl-rust/issues/632>
# we cannot use v13 or v14 for testing for now, but it should be okay
# since we only have best-effort testing on FreeBSD.
release: "15.0"
usesh: true
copyback: false
prepare: |
Expand Down
6 changes: 4 additions & 2 deletions ci/actions-templates/freebsd-builds-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jobs: # skip-main skip-stable
build-freebsd-main: # job-name skip-stable
build-freebsd-stable: # job-name skip-main
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || github.event_name == 'schedule' }} # skip-stable
if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-main
steps:
- uses: actions/checkout@v6
Expand All @@ -18,7 +17,10 @@ jobs: # skip-main skip-stable
- name: Run a full build
uses: vmactions/freebsd-vm@v1
with:
release: 13.2
# HACK: Due to <https://github.com/alexcrichton/curl-rust/issues/632>
# we cannot use v13 or v14 for testing for now, but it should be okay
# since we only have best-effort testing on FreeBSD.
release: "15.0"
usesh: true
copyback: false
prepare: |
Expand Down
30 changes: 25 additions & 5 deletions src/test/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,21 +920,41 @@ fn create_tarball(relpath: &Path, src: &Path, dst: &Path) -> io::Result<()> {
zstwriter = zstd::stream::write::Encoder::new(outfile, 0)?.auto_finish();
&mut zstwriter
}
_ => panic!("Unsupported archive format"),
_ => panic!("unsupported archive format"),
};
let mut tar = tar::Builder::new(writer);
tar.mode(tar::HeaderMode::Deterministic);
for entry in walkdir::WalkDir::new(src) {
let entry = entry?;
let parts: Vec<_> = entry.path().iter().map(ToOwned::to_owned).collect();
let parts_len = parts.len();
let parts = parts.into_iter().skip(parts_len - entry.depth());
let mut relpath = relpath.to_owned();
relpath.extend(parts);
if entry.file_type().is_file() {
let mut srcfile = File::open(entry.path())?;
tar.append_file(relpath, &mut srcfile)?;
let mut header = tar::Header::new_ustar();
let srcfile = if entry.file_type().is_file() {
let srcfile = File::open(entry.path())?;
header.set_entry_type(tar::EntryType::Regular);
header.set_size(srcfile.metadata()?.len());
header.set_mode(0o644);
Some(srcfile)
} else if entry.file_type().is_dir() {
tar.append_dir(relpath, entry.path())?;
let mut header = tar::Header::new_ustar();
header.set_entry_type(tar::EntryType::Directory);
header.set_size(0);
header.set_mode(0o755);
None
} else {
continue;
};
header.set_uid(0);
header.set_gid(0);
header.set_mtime(0);
header.set_cksum();
if let Some(mut srcfile) = srcfile {
tar.append_data(&mut header, relpath, &mut srcfile)?;
} else {
tar.append_data(&mut header, relpath, io::empty())?;
}
}
tar.finish()
Expand Down
Loading