You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide an alternative to embedded_python_tools.symlink_import()
Until now, we've primarily been symlinking the Python dir into the build
folder. However, that has a couple of issues:
1. Occasionally the symlink goes wrong and needs to be deleted manually.
This is especially problematic on Windows.
2. The `conanfile.py` syntax is surprising. Even more so with Conan v2
where it requires a manual `sys.path.append()` to work.
`symlink_import()` was essentially creating a symlink from `bin/python`
to `<conan_package_path>/embedded_python`. The project executable would
point `PyConfig::home` to `bin/python`.
This commit provides an alternative that simply writes that directory
path to a file called `bin/.embedded_python.home`. The executable can
read that file on startup and point `PyConfig::home` there.
For now, both methods are valid. If the home file works out, we can
deprecate `symlink_import()` and remove it down the line.
Copy file name to clipboardExpand all lines: changelog.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
# Changelog
2
2
3
-
## v1.9.1 | In development
3
+
## v1.9.1 | 2024-06-17
4
4
5
5
- Fixed an issue where calling CMake with `-DPython_EXECUTABLE=<system_python>` created conflicts with the embedded Python (either a loud version error, or silently passing the wrong library paths). Some IDEs would pass this flag implicitly and it would hijack the `find_package(Python)` call used internally by this recipe. Now, we specifically protect against this since there should be no traces of system Python in a project that wishes to embed it.
6
+
- Provided an alternative to `embedded_python_tools.symlink_import()`. For dev builds, it's now possible to point `PyConfig::home` to the contents of `bin/.embedded_python(-core).home` to avoid needing to copy the entire Python environment into the build tree every time the project is reconfigured.
0 commit comments