indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.45k stars 236 forks source link

Why pyoxidizer build/run write new demo project? #690

Closed JulianZhang closed 1 year ago

JulianZhang commented 1 year ago

My pipeline is

1, install pyoxidizer by cargo; 2, create project by "pyoxidizer init-rust-project"; 3, change pyoxidizer.bzl to add pip_install action; 4, change src/main.rs to add my logic; 5, run pyoxidizer build/run to build/run project;

And I find that cargo build will run on temp dir, the log info is as blow

build command: "PYO3_CONFIG_FILE=/tmp/pyoxidizer4q6tDV/artifacts/pyo3-build-config-file.txt" "PYOXIDIZER_ARTIFACT_DIR=/tmp/pyoxidizer4q6tDV/artifacts" "PYOXIDIZER_REUSE_ARTIFACTS=1" "RUSTC=/home/user/.cache/pyoxidizer/rust/1.66.0-x86_64-unknown-linux-gnu/bin/rustc" /home/user/.cache/pyoxidizer/rust/1.66.0-x86_64-unknown-linux-gnu/bin/cargo build --target x86_64-unknown-linux-gnu --target-dir /tmp/pyoxidizer4q6tDV/build/target --bin pyodemo --locked --no-default-features --features "build-mode-prebuilt-artifacts global-allocator-jemalloc allocator-jemalloc"

And all files in the temp dir are writing as default demo, not copy from my workspace.

writing /tmp/pyoxidizer4q6tDV/pyodemo/.cargo/config
writing /tmp/pyoxidizer4q6tDV/pyodemo/Cargo.lock
writing /tmp/pyoxidizer4q6tDV/pyodemo/build.rs
writing /tmp/pyoxidizer4q6tDV/pyodemo/src/main.rs
writing /tmp/pyoxidizer4q6tDV/pyodemo/pyoxidizer.bzl
writing /tmp/pyoxidizer4q6tDV/pyodemo/pyodemo.exe.manifest
writing /tmp/pyoxidizer4q6tDV/pyodemo/pyodemo-manifest.rc

I make it work on my workspace, as Ctr-c when pyoxidizer running cargo build on temp project (make sure the temp dir while not be delete by pyoxidizer). Copy the build command and run it on my workspace. But the operate is stupid, How can I make the pyoxidizer work with my workspace?

My pyoxidizer version is as blow

$pyoxidizer --version PyOxidizer 0.24.0 commit: unknown source: https://github.com/indygreg/PyOxidizer.git pyembed crate location: version = "0.24.0"

JulianZhang commented 1 year ago

demo project, should build with feature