New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to re-enable the old onedir layout #7968
Conversation
Clean up and document the multipackage dependency extration code in an attempt to make it easier to read. When determining the parent directory of the current exectuable (the former `homepath_parent`, now `this_executable_dir`), use `executablename` member of `ARCHIVE_STATUS` instead of `homepath`, as the latter is affected by the contents-directory option while the former is not. (And this seems to work for onefile builds because `homepath` there is also affected by contents-directory, even through it should be not). Remove the useless else-if branch, whose condition is now identical to that of the preceding if condition. It was very likely unused even in its original form, where it attempted to find the dependency by jumping to the parent directory of the directory containing the executable, and then applying relative path to the other executable. However, this relative path should already encode the relative relation between the executables (accounting for all four possible combinations regaring build types), and as such jumping one directory higher would never work. Fix the path check for the external .PKG archive (side-load mode). Such archive is located next to the executable, and is not a subject to contents-directory setting.
Allow pyi-contents-directory option to be unset, which re-enables the old layout for onedir builds, where files are placed next to the executable (instead of placing them into sub-directory).
aa74ca1
to
cc89091
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't see a use for this beyond accommodating broken code
Allow user to re-enable old onedir layout without contents directory. This can be done by setting `contents_directory` argument to `EXE` in the spec to either ".", "", or None (all three values are effectively mapped to None, which prevents the `pyi-contents-directory` bootloader option from being set). On command line, the equivalent can be achieved by passing "." to `--contents-directory` command-line option.
Append contents-directory path to homepath member of ARCHIVE_STATUS only in onedir mode (i.e., if we do not need to extract the archive). This implies that we need to check whether extraction is required when we open the archive (before homepath is set), so move the corresponding code into `pyi_arch_setup`.
Test for `..` as an invalid contents-directory option instead of `.`, which is now valid.
Add a basic test with --contents-directory=. that checks if `sys._MEIPASS` == `os.path.dirname(sys.executable)`, which should be the case in the legacy onedir layout.
cc89091
to
4264076
Compare
Indeed. But we can spend our time on better things than arguing this point with the users (or having to implement dubious work-arounds such as support for collection outside of the _MEIPASS). |
Hello, when can we see this feature to be released? |
Allow users to re-enable the old onedir layout (without contents directory) by settings the
--contents-directory
option (or the equivalentcontents_directory
argument toEXE
in the .spec file) to.
.