File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {}" ,
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments