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
4 changes: 4 additions & 0 deletions pyoxidizer/src/project_building.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ pub fn build_pyembed_artifacts(
))? {
let p = p?;

// leave the extra files in the build dir; we do not need them to build the binary
if p.file_name() == "extra_files" {
continue;
}
let dest_path = artifacts_path.join(p.file_name());
std::fs::copy(&p.path(), &dest_path).context(format!(
"copying {} to {}",
Expand Down
9 changes: 9 additions & 0 deletions pyoxidizer/src/py_packaging/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,13 @@ impl<'a> EmbeddedPythonContext<'a> {
Ok(())
}

/// Write extra files like dynamic extension modules to the build folder.
pub fn write_extra_files(&self, dest_dir: impl AsRef<Path>) -> Result<()> {
self.extra_files
.materialize_files(dest_dir.as_ref().join("extra_files"))?;
Ok(())
}

/// Write out files needed to build a binary against our configuration.
pub fn write_files(&self, dest_dir: &Path) -> Result<()> {
self.write_packed_resources(&dest_dir)
Expand All @@ -756,6 +763,8 @@ impl<'a> EmbeddedPythonContext<'a> {
.context("write_interpreter_config_rs()")?;
self.write_pyo3_config(&dest_dir)
.context("write_pyo3_config()")?;
self.write_extra_files(&dest_dir)
.context("write_extra_files()")?;

Ok(())
}
Expand Down