Commit Graph

541 Commits

Author SHA1 Message Date
rdb 7c74060035 dtoolutil: Read environment variables in emscripten under node.js 2024-11-04 18:40:26 +01:00
rdb 94c63fe9da dtoolutil: Remove silly unused variable 2024-11-04 13:25:22 +01:00
rdb e58449cde7 dtoolutil: Let Python do Filename conversion to UTF-8 2024-10-30 13:42:33 +01:00
rdb 7560a1edd1 Merge branch 'release/1.10.x' 2024-10-30 13:42:21 +01:00
rdb 0ba2aadcd6 Introduce Py_IS_TYPE, use for Py_TYPE comparisons 2024-10-30 13:17:11 +01:00
rdb f5401b19fa Merge branch 'release/1.10.x' 2024-09-16 13:54:22 +02:00
rdb 78ace53dbe dtoolutil: Fix typo in pfstream causing compiler warning 2024-08-14 19:08:49 +02:00
rdb abf0b38705 dtoolutil: Use string compare instead of strcmp in filename.I 2024-08-08 21:36:00 +02:00
rdb ad57762e9f Merge branch 'release/1.10.x' 2024-08-07 22:34:08 +02:00
rdb 8c8cbeea98 linmath: For repr, use as much precision as needed for roundtrip
Will use as few digits as is necessary to ensure that round-tripping the same number with pstrtod will result in the same vector.  This prevents eg. 3.3 formatting as 3.29999995 while still ensuring that two floats that are not equal (other than nan) are guaranteed to have a different string representation.

Uses a hacky pftoa function that can be abandoned as soon as we adopt C++17, which has to_chars that does what we need

Fixes #1671
2024-08-07 17:24:11 +02:00
rdb 1cc0676e41 dtoolutil: Fix misnamed include guard 2024-08-04 17:08:45 +02:00
rdb ae04533527 dtoolutil: Fix typo in error message 2024-08-03 16:36:37 +02:00
rdb af27a9523c Merge branch 'release/1.10.x' 2024-03-12 15:39:16 +01:00
darktohka b049c891d1 ext: Use different names for each gen_next method 2024-02-10 23:49:28 +01:00
rdb 73360393df Switch use of Py_INCREF to new Py_NewRef function
This is more idiomatic, simplifies the code, makes it easier to port to eg. HPy later on, and makes it easier to use the limited ABI (where it can be optimized to a tail call) later on

A polyfill is provided for compatibility with Python versions 3.8 and 3.9
2024-01-29 17:57:53 +01:00
rdb 4b748d1aba dtoolutil: Fix issue compiling interrogate without HAVE_PYTHON
Closes #1608

Co-authored-by: pmp-p <mail.peny@free.fr>
2024-01-28 15:15:27 +01:00
rdb 128000b03a dtoolutil: writelines() should accept any iterable 2024-01-28 15:15:27 +01:00
rdb 84ed141b2a Squash merge webgl-port branch into master
Adds support for emscripten as a build target / platform, and adds a WebGL renderer back-end
2024-01-25 15:37:38 +01:00
rdb b49dbaca2b Report errors if calls to `close()` fail 2024-01-25 12:33:20 +01:00
rdb cdc95acf81 Merge branch 'release/1.10.x' 2023-05-08 20:08:48 +02:00
rdb c958919037 Make API documentation for Filename and VirtualFileSystem clearer
Mention specifically that Filename methods act on the physical disk whereas VirtualFileSystem methods act on the VFS

Fixes #1493

[skip ci]
2023-05-08 11:19:03 +02:00
Disyer 108b317327 dtoolutil: Fix _MSC_VER macros that should be _WIN32 2023-02-26 11:50:41 +02:00
rdb eefb51f510 dtoolutil: Add small_vector implementation and use it
This vector implementation does is optimized for the case of having only a small number of elements, which are stored directly on the vector object rather than being allocated from the heap.  If the capacity exceeds this small number, then a heap allocation is done.

This should improve performance in a couple of cases where vectors typically store 1 element and rarely more than that.
2023-02-22 16:48:11 +01:00
rdb 5e26aae1ff cleanup: Fix assorted issues uncovered by clang-tidy 2023-02-12 18:17:03 +01:00
Frang 275fe32079
create PY_EXTENSION and friends (#1415) 2023-01-04 20:54:53 +01:00
Cary Sandvig 3247903d7b add more HAVE_PYTHON
Also add some more #endif comments.
2022-12-23 13:38:46 -05:00
rdb 550aad7024 Fix some uses of `AtomicAdjust::Pointer` to use `patomic<T *>` 2022-12-04 00:36:41 +01:00
rdb 0421ee31b3 Merge branch 'release/1.10.x' 2022-12-01 12:59:27 +01:00
rdb 20459118e2 dtoolutil: Add XDG_STATE_HOME on Linux 2022-12-01 12:56:45 +01:00
rdb cee1de7338 general: Get rid of some coerce constructors where they make no sense 2022-10-20 21:00:05 +02:00
rdb dae147ec0c Merge branch 'release/1.10.x' 2022-03-02 10:51:23 +01:00
rdb 21377c8de5 Use secure versions of CRT getenv etc. when compiling with MSVC 2022-03-01 16:09:07 +01:00
rdb dc05889be2 dtoolutil: Don't use $HOME in Filename::get_home_directory() on Windows
This variable isn't used on Windows systems
2022-03-01 16:09:07 +01:00
rdb 70415af210 dtoolutil: Set system malloc tag to mimalloc when enabled 2022-03-01 15:12:38 +01:00
rdb df7892b683 dtoolutil: Fix _WIN32 macros that should be _MSC_VER 2021-11-16 16:35:13 +01:00
rdb e9e1bb1bc6 dtoolutil/express: Resolving empty filename should yield no result
See #1140 - I may revert this if someone can demonstrate a compelling use case (for current directory, you can use "." instead), but it seems to have the potential to cause unintuitive behavior.
2021-04-09 18:26:00 +02:00
rdb dd3510eea7 Merge branch 'release/1.10.x' 2021-04-08 12:30:35 +02:00
rdb addbc8a2e8 dtoolutil: Work around odd Linux bug with lseek on a directory fd
Fixes #1140
2021-04-08 12:07:00 +02:00
rdb fd5cab1a3f dtoolutil: Rename Filename::__nonzero__() to __bool__()
This is the Python 3 convention (even though interrogate supports both)
2021-03-09 19:35:09 +01:00
rdb 9d9337dc4d dtoolutil: Fix Filename division operator in Python 3 2021-02-22 18:14:12 +01:00
rdb 613441060b Merge branch 'release/1.10.x' 2021-01-18 23:47:36 +01:00
rdb 54638bfc10 dtoolutil: Allow overriding PandaSystem::get_build_date()
This is useful to create bit-for-bit reproducible builds.  In the buildbots, we set it to the timestamp of the latest commit.
2021-01-18 16:41:22 +01:00
rdb f392cc9fe6 dtoolutil: Mark PandaSystem::get_build_date() as deprecated
It results in the build not being reproduceable.
2021-01-18 00:52:04 +01:00
Daniel 74a4648965 mayaprogs: Completely refactor the maya2egg server
The maya2egg_server utility is no longer a separate utility. To run the maya2egg_server (now Maya conversion server), use `maya2egg -server` or `egg2maya -server`.

Two new utilities have been added: `maya2egg_client` and `egg2maya_client`. Both of them are Maya version independent, and do not rely on any Maya libraries. However, they're only built with SDKs that already come with the Maya binaries, as the server makes its own assumptions about the current working directory (the client and the server are expected to be on the same machine.)

A new feature has been added to ProgramBase: an `exit_on_complete` flag, which allows you to parse the command line without exiting the program upon a failure or a help command.

In addition to this, a getopt bug has been fixed in ProgramBase: It is now possible to clear the state of the Panda implementation of getopt, making it possible once again to parse command line arguments twice in a row.

Closes #1025
2020-12-29 16:16:36 +01:00
rdb a3010a43a5 Merge branch 'release/1.10.x' 2020-12-24 15:31:52 +01:00
rdb 1b8c4e0029 dtoolutil: Fix compile warning in ExecutionEnvironment 2020-12-22 23:14:59 +01:00
rdb 131ae98bfd Merge branch 'release/1.10.x' 2020-12-22 16:45:24 +01:00
rdb 30bca7a119 dtoolutil: fix ExecutionEnvironment::has_environment_variable() for shadowed var
Fixes MAIN_DIR being set more than once (which seems to avoid a compiler bug in an opt4 build).
2020-12-22 16:22:45 +01:00
rdb abe3c2bf0b CMake: Mark all system macOS frameworks as advanced variables
It should be extremely unusual to want to change these, and they are just cluttering up the CMake GUI.
2020-12-19 00:33:22 +01:00
rdb e060a29228 general: Clean up hacks to support Python 3.5 from codebase 2020-10-02 12:07:04 +02:00