Skip to content

Commit 3fb0474

Browse files
committed
write extra_files when building pyembed artifacts
1 parent 36e5035 commit 3fb0474

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

pyoxidizer/src/project_building.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,10 @@ pub fn build_pyembed_artifacts(
512512
))? {
513513
let p = p?;
514514

515+
// leave the extra files in the build dir; we do not need them to build the binary
516+
if p.file_name() == "extra_files" {
517+
continue;
518+
}
515519
let dest_path = artifacts_path.join(p.file_name());
516520
std::fs::copy(&p.path(), &dest_path).context(format!(
517521
"copying {} to {}",

pyoxidizer/src/py_packaging/binary.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,13 @@ impl<'a> EmbeddedPythonContext<'a> {
552552
Ok(())
553553
}
554554

555+
/// Write extra files like dynamic extension modules to the build folder.
556+
pub fn write_extra_files(&self, dest_dir: impl AsRef<Path>) -> Result<()> {
557+
self.extra_files
558+
.materialize_files(dest_dir.as_ref().join("extra_files"))?;
559+
Ok(())
560+
}
561+
555562
/// Write out files needed to build a binary against our configuration.
556563
pub fn write_files(&self, dest_dir: &Path) -> Result<()> {
557564
self.write_packed_resources(&dest_dir)
@@ -562,6 +569,8 @@ impl<'a> EmbeddedPythonContext<'a> {
562569
.context("write_interpreter_config_rs()")?;
563570
self.write_cargo_metadata(&dest_dir)
564571
.context("write_cargo_metadata()")?;
572+
self.write_extra_files(&dest_dir)
573+
.context("write_extra_files()")?;
565574

566575
Ok(())
567576
}

0 commit comments

Comments
 (0)