Skip to content

Commit ffbfe66

Browse files
committed
write extra_files when building pyembed artifacts
1 parent 325fc81 commit ffbfe66

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
@@ -484,6 +484,10 @@ pub fn build_pyembed_artifacts(
484484
))? {
485485
let p = p?;
486486

487+
// leave the extra files in the build dir; we do not need them to build the binary
488+
if p.file_name() == "extra_files" {
489+
continue;
490+
}
487491
let dest_path = artifacts_path.join(p.file_name());
488492
std::fs::copy(&p.path(), &dest_path).context(format!(
489493
"copying {} to {}",

pyoxidizer/src/py_packaging/binary.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,13 @@ impl<'a> EmbeddedPythonContext<'a> {
746746
Ok(())
747747
}
748748

749+
/// Write extra files like dynamic extension modules to the build folder.
750+
pub fn write_extra_files(&self, dest_dir: impl AsRef<Path>) -> Result<()> {
751+
self.extra_files
752+
.materialize_files(dest_dir.as_ref().join("extra_files"))?;
753+
Ok(())
754+
}
755+
749756
/// Write out files needed to build a binary against our configuration.
750757
pub fn write_files(&self, dest_dir: &Path) -> Result<()> {
751758
self.write_packed_resources(&dest_dir)
@@ -756,6 +763,8 @@ impl<'a> EmbeddedPythonContext<'a> {
756763
.context("write_interpreter_config_rs()")?;
757764
self.write_pyo3_config(&dest_dir)
758765
.context("write_pyo3_config()")?;
766+
self.write_extra_files(&dest_dir)
767+
.context("write_extra_files()")?;
759768

760769
Ok(())
761770
}

0 commit comments

Comments
 (0)