From 86258d2a97ad3626da3c25a1379a26f12947252c Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 13 Sep 2020 16:15:35 +0200 Subject: [PATCH 1/6] readme: Update for 1.10.7 [skip ci] --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 46b34b7816..89ba13fa5a 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Installing Panda3D ================== The latest Panda3D SDK can be downloaded from -[this page](https://www.panda3d.org/download/sdk-1-10-6/). +[this page](https://www.panda3d.org/download/sdk-1-10-7/). If you are familiar with installing Python packages, you can use the following command: @@ -64,8 +64,8 @@ depending on whether you are on a 32-bit or 64-bit system, or you can [click here](https://github.com/rdb/panda3d-thirdparty) for instructions on building them from source. -- https://www.panda3d.org/download/panda3d-1.10.6/panda3d-1.10.6-tools-win64.zip -- https://www.panda3d.org/download/panda3d-1.10.6/panda3d-1.10.6-tools-win32.zip +- https://www.panda3d.org/download/panda3d-1.10.7/panda3d-1.10.7-tools-win64.zip +- https://www.panda3d.org/download/panda3d-1.10.7/panda3d-1.10.7-tools-win32.zip After acquiring these dependencies, you can build Panda3D from the command prompt using the following command. Change the `--msvc-version` option based @@ -136,7 +136,7 @@ macOS ----- On macOS, you will need to download a set of precompiled thirdparty packages in order to -compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.6/panda3d-1.10.6-tools-mac.tar.gz). +compile Panda3D, which can be acquired from [here](https://www.panda3d.org/download/panda3d-1.10.7/panda3d-1.10.7-tools-mac.tar.gz). After placing the thirdparty directory inside the panda3d source directory, you may build Panda3D using a command like the following: From c646924f03e67e74a44c6f9b2341a4e5a6c298c6 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 14 Sep 2020 11:00:39 +0200 Subject: [PATCH 2/6] tests: remove occasionally-failing PythonUtil.weightedChoice test It does not test a behavior of this function that we support, anyway. --- tests/showbase/test_PythonUtil.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tests/showbase/test_PythonUtil.py b/tests/showbase/test_PythonUtil.py index c4c1b8076a..6b9d50cde0 100644 --- a/tests/showbase/test_PythonUtil.py +++ b/tests/showbase/test_PythonUtil.py @@ -146,14 +146,6 @@ def test_weighted_choice(): # Assert that we got 'item1'. assert item == items[0] - # Test PythonUtil.weightedChoice() with an invalid sum. - # This time, we're using 2000 so that regardless of the random - # number, we will still reach the very last item. - item = PythonUtil.weightedChoice(choicelist, sum=100000) - - # Assert that we got 'item8', since we would get the last item. - assert item == items[-1] - # Create a bogus random function. rnd = lambda: 0.5 From 7711757d3da033ba95a954357c6f648655b2b3d8 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 14 Sep 2020 11:56:25 +0200 Subject: [PATCH 3/6] makewheel: add Python DLL before adding panda3d modules This should ensure that dependencies of Python (such as VCRUNTIME140.DLL) make it into the deploy_libs folder, rather than the panda3d folder. --- makepanda/makewheel.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/makepanda/makewheel.py b/makepanda/makewheel.py index 9643fa5e8a..4caebcc9e3 100644 --- a/makepanda/makewheel.py +++ b/makepanda/makewheel.py @@ -604,6 +604,26 @@ def makewheel(version, output_dir, platform=None): whl.ignore_deps.update(MANYLINUX_LIBS) + # Add libpython for deployment. + if sys.platform in ('win32', 'cygwin'): + pylib_name = 'python{0}{1}.dll'.format(*sys.version_info) + pylib_path = os.path.join(get_config_var('BINDIR'), pylib_name) + elif sys.platform == 'darwin': + pylib_name = 'libpython{0}.{1}.dylib'.format(*sys.version_info) + pylib_path = os.path.join(get_config_var('LIBDIR'), pylib_name) + else: + pylib_name = get_config_var('LDLIBRARY') + pylib_arch = get_config_var('MULTIARCH') + libdir = get_config_var('LIBDIR') + if pylib_arch and os.path.exists(os.path.join(libdir, pylib_arch, pylib_name)): + pylib_path = os.path.join(libdir, pylib_arch, pylib_name) + else: + pylib_path = os.path.join(libdir, pylib_name) + + # If Python was linked statically, we don't need to include this. + if not pylib_name.endswith('.a'): + whl.write_file('deploy_libs/' + pylib_name, pylib_path) + # Add the trees with Python modules. whl.write_directory('direct', direct_dir) @@ -723,26 +743,6 @@ __version__ = '{0}' whl.write_file(info_dir + '/README.md', readme_src) whl.write_file_data(info_dir + '/top_level.txt', 'direct\npanda3d\npandac\npanda3d_tools\n') - # Add libpython for deployment - if sys.platform in ('win32', 'cygwin'): - pylib_name = 'python{0}{1}.dll'.format(*sys.version_info) - pylib_path = os.path.join(get_config_var('BINDIR'), pylib_name) - elif sys.platform == 'darwin': - pylib_name = 'libpython{0}.{1}.dylib'.format(*sys.version_info) - pylib_path = os.path.join(get_config_var('LIBDIR'), pylib_name) - else: - pylib_name = get_config_var('LDLIBRARY') - pylib_arch = get_config_var('MULTIARCH') - libdir = get_config_var('LIBDIR') - if pylib_arch and os.path.exists(os.path.join(libdir, pylib_arch, pylib_name)): - pylib_path = os.path.join(libdir, pylib_arch, pylib_name) - else: - pylib_path = os.path.join(libdir, pylib_name) - - # If Python was linked statically, we don't need to include this. - if not pylib_name.endswith('.a'): - whl.write_file('deploy_libs/' + pylib_name, pylib_path) - whl.close() From 8e39072f6f7c348d10a921557af6dc36e9e1566e Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 14 Sep 2020 11:58:57 +0200 Subject: [PATCH 4/6] dist: don't search same directory for dependencies more than once --- direct/src/dist/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index 2e5c639717..219e0ebd88 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -1080,7 +1080,10 @@ class build_apps(setuptools.Command): source_dir = os.path.dirname(source_path) target_dir = os.path.dirname(target_path) base = os.path.basename(target_path) - self.copy_dependencies(target_path, target_dir, search_path + [source_dir], base) + + if source_dir not in search_path: + search_path = search_path + [source_dir] + self.copy_dependencies(target_path, target_dir, search_path, base) def copy_dependencies(self, target_path, target_dir, search_path, referenced_by): """ Copies the dependencies of target_path into target_dir. """ From 36eed0d9c90543eecb03f620b26f8399caa948ba Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 14 Sep 2020 12:20:07 +0200 Subject: [PATCH 5/6] dist: don't exclude api-ms-win-crt-*.dll libraries These are needed to run the program on systems without the right CRT installed. --- direct/src/dist/commands.py | 3 +-- doc/ReleaseNotes | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/direct/src/dist/commands.py b/direct/src/dist/commands.py index 219e0ebd88..c5f14ae489 100644 --- a/direct/src/dist/commands.py +++ b/direct/src/dist/commands.py @@ -1098,8 +1098,7 @@ class build_apps(setuptools.Command): pe = pefile.PEFile() pe.read(fp) for lib in pe.imports: - if not lib.lower().startswith('api-ms-win-'): - deps.append(lib) + deps.append(lib) elif magic == b'\x7FELF': # Elf magic. Used on (among others) Linux and FreeBSD. diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index c4657a4894..79cf156c83 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -52,6 +52,7 @@ Deployment * Fix libffi-7.dll not being included in official wheels * PYTHONINSPECT mechanism is no longer enabled when building with optimizations * A few unnecessary warning messages are squelched +* Windows builds now include previously missing CRT dlls API * Add pickle support to Datagram class From 7f11dc19cdfa1480fe6889d87609e83707837b41 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 14 Sep 2020 19:31:07 +0200 Subject: [PATCH 6/6] makepanda: fix ABI flags not being stripped from PYTHONVERSION --- makepanda/makepackage.py | 2 +- makepanda/makepandacore.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/makepanda/makepackage.py b/makepanda/makepackage.py index 8e1f9bb2fa..59125ac9bd 100755 --- a/makepanda/makepackage.py +++ b/makepanda/makepackage.py @@ -867,7 +867,7 @@ def MakeInstallerFreeBSD(version, runtime=False, python_versions=[], **kwargs): oscmd("rm -f %s/tmp/python_dep" % outputdir) if "PYTHONVERSION" in SDK: - pyver_nodot = SDK["PYTHONVERSION"][6:].replace('.', '') + pyver_nodot = SDK["PYTHONVERSION"][6:].rstrip('dmu').replace('.', '') else: pyver_nodot = "%d%d" % (sys.version_info[:2]) diff --git a/makepanda/makepandacore.py b/makepanda/makepandacore.py index 307115bcd0..ca4acfa700 100644 --- a/makepanda/makepandacore.py +++ b/makepanda/makepandacore.py @@ -3586,7 +3586,7 @@ def GetCurrentPythonVersionInfo(): from distutils.sysconfig import get_python_lib return { - "version": SDK["PYTHONVERSION"][6:], + "version": SDK["PYTHONVERSION"][6:].rstrip('dmu'), "soabi": GetPythonABI(), "ext_suffix": GetExtensionSuffix(), "executable": sys.executable,