write extra_files when building pyembed artifacts?#466
Draft
dae wants to merge 1 commit intoindygreg:mainfrom
Draft
write extra_files when building pyembed artifacts?#466dae wants to merge 1 commit intoindygreg:mainfrom
dae wants to merge 1 commit intoindygreg:mainfrom
Conversation
Contributor
Author
|
Ok, I've rebased this over the main branch, and confirmed it worked on the Mac and Windows machines I tested when used with the commands mentioned on https://github.com/indygreg/PyOxidizer/pull/467/files I hit a few stumbling blocks when trying to get 0.18 working:
Presumably pyo3 was trying to autodetect the Python layout, and failing. I was able to work around it by generating the artifacts in advance - is that the intended workflow now?
|
This was referenced Oct 21, 2021
8f998b7 to
5c5ac33
Compare
This was referenced Jan 17, 2022
5e0524b to
789c62e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intended for discussion, not merging as-is. Based on the 0.17 branch; I'm having issues with the main branch which I'll look into more later.
I'd like to be able customize the icon of the produced .exe file on Windows, and run some custom Rust code before the Python interpreter is loaded. I ran into some problems along the way.
I started by using
pyoxidizer init-rust-project sample. It tells me:So I add a print statement to the top of main.rs, and run build/run. Observations:
After digging into the sources, I find that pyoxidizer will unconditionally create an ephemeral project when building, ignoring any sources in the current folder. Looks like this was previously reported in #439. Ok, I'll need to try the direct-with-cargo approach instead.
Ok, that's promising. Now let's add an extension module into the equation:
I rebuild and try again:
Hmm, it seems extra_files are nowhere to be found. Back to digging through the source code. It looks like to_embedded_resources() ignores extra_files - they only seem to handled when
building an executable.
With the patch in this PR, I am able to successfully change the icon by adding it to the resources file. But I presume there are other cases where the extra_files should not be included. Which leads me to a few questions:
gated by an env var?