File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11downloads /
2- python-lib.tar
Original file line number Diff line number Diff line change @@ -35,14 +35,14 @@ fn configure_linker() {
3535
3636fn bundle_python_lib ( ) {
3737 println ! ( "cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR" ) ;
38+ let tar_path = PathBuf :: from ( std:: env:: var ( "OUT_DIR" ) . unwrap ( ) ) . join ( "python-lib.tar" ) ;
3839 let Ok ( lib_dir) = std:: env:: var ( "PYO3_CROSS_LIB_DIR" ) else {
39- std:: fs:: write ( "python-lib.tar" , b"" ) . unwrap ( ) ;
40+ std:: fs:: write ( & tar_path , b"" ) . unwrap ( ) ;
4041 return ;
4142 } ;
4243 let lib_dir = PathBuf :: from ( lib_dir) ;
4344
44- // TODO: use build-dir once it is stable, see https://github.com/rust-lang/cargo/issues/14125
45- let file = File :: create ( "python-lib.tar" ) . unwrap ( ) ;
45+ let file = File :: create ( & tar_path) . unwrap ( ) ;
4646 let mut archive = tar:: Builder :: new ( file) ;
4747 for entry in walkdir:: WalkDir :: new ( & lib_dir) {
4848 let entry = entry. unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ impl ScalarUDFImpl for Test {
7373}
7474
7575fn root ( ) -> Option < Vec < u8 > > {
76- Some ( std:: include_bytes!( "../python-lib.tar" ) . to_vec ( ) )
76+ const ROOT_TAR : & [ u8 ] = include_bytes ! ( concat!( env!( "OUT_DIR" ) , "/python-lib.tar" ) ) ;
77+ Some ( ROOT_TAR . to_vec ( ) )
7778}
7879
7980fn udfs ( ) -> Vec < Arc < dyn ScalarUDFImpl > > {
You can’t perform that action at this time.
0 commit comments