Commit Graph

132 Commits

Author SHA1 Message Date
Bootsma, James c747a09a7d waf_unit_test: Fix command handling under windows
The unit test tool moved from a simple split to using shlex.split for
handling the unit test command. This results in the path separators on
windows being treated as escapes.

To handle this the unit test exec command is properly escaped before
joining so that the subsequent split restores the original arguments.
The quote function is also exposed in the Utilities module so that
wscripts making use of the unit test tool can properly quote their
contributions to the command as well.
2021-01-20 16:22:59 -07:00
Thomas Nagy 2931163e56
Improve os.environ propagation #2264 2019-11-03 10:24:43 +01:00
Thomas Nagy 14b6f47a24
Do not attempt to close fds on Windows platforms 2019-05-27 18:31:34 +02:00
Thomas Nagy 92e9764f58
Optimize sub process startup with workers 2019-05-27 18:05:02 +02:00
Thomas Nagy 5e90de89d8
Python 2 encoding enhancements - Issue 2230 2019-04-15 21:18:45 +02:00
James Harris 84fd982f4b Utils: only use msys2 paths from msys2 python
This patch attempts to detects if, when we are running from within an
MSYS2 environement (MSYSTEM is set) we are also executing inside an
MSYS2 provided version of python. It does this by assuming that if we
are not in a cygwin environment and we are building on windows, If the
value of sys.executable is /usr/bin or /bin or /usr/local/bin (somethign
unixy) then we are running in an MSYS2 python interpreter and shoudl
compensate for msys2 root paths. Otherwise we shouldn't be doing extra
path manipulation.
2019-02-26 17:26:32 +00:00
Mickaël Schoentgen 412a9b819e Fix all DeprecationWarning: invalid escape sequence
Signed-off-by: Mickaël Schoentgen <contact@tiger-222.fr>
2019-01-05 12:02:42 +01:00
Thomas Nagy 3d1744151f
Possible solution for Msys path issues #2217 2018-12-21 11:47:51 +01:00
Thomas Nagy 1c7be35dc0
Fix broken cPython: md5.digest() is not supposed to raise exceptions #2213 2018-12-06 07:44:36 +01:00
Thomas Nagy bd15a9dce7
Try to load sha1 if md5 is unavailable
Also, the minimum version of Python required is 2.5, so hashlib is always present.
2018-12-05 20:35:19 +01:00
Thomas Nagy 6873a1b4c6
Work around Python 3.6 console issues #2163 2018-05-19 11:23:46 +02:00
Thomas Nagy de992ea840
Enable Utils.lazy_generator in Python 2 2018-03-11 22:42:21 +01:00
Thomas Nagy d21446ff71
Update docs for 2018 2018-01-01 20:53:49 +01:00
Thomas Nagy c0e2e7f281 Defer node.ant_glob(..., generator=True) evaluation 2017-12-23 14:56:54 +01:00
Thomas Nagy 955e10291d Define the environment variable WAF_NO_PREFORK to skip pre-forking 2017-12-22 15:40:06 +01:00
Thomas Nagy aa361ee568 Fix Can't pickle local object '_createenviron.<locals>.encode' exceptions (Python 3.6) 2017-12-22 14:59:31 +01:00
Thomas Nagy ad5dd18408
Use the 'with' syntax whenever possible 2017-09-12 19:36:43 +02:00
Thomas Nagy 53af0cfaef
Remove unused traceback import 2017-09-02 23:34:58 +02:00
Thomas Nagy 57087471c1
Remove Utils.ex_stack - use traceback.format_exc() 2017-08-19 11:54:58 +02:00
Thomas Nagy cc9374b646
Assert against invalid inputs in Utils.run_prefork_process 2017-07-01 13:15:17 +02:00
Thomas Nagy cddc5552e4 Rename WindowsError to OSError in Python3 2017-06-23 16:51:54 +02:00
Thomas Nagy fbdc9fd5a3
Code simplifications 2017-04-22 22:12:11 +02:00
Thomas Nagy 5d4074eb7f
Display commands as string with "WAF_CMD_FORMAT=string waf build -v" 2017-03-04 08:20:27 +01:00
Thomas Nagy e352fb05c0
UNC path fixes 2017-03-02 20:45:45 +01:00
Thomas Nagy 121e2c29d1
Work around an annoying Python 3.6 regression #1889 2017-03-02 20:10:43 +01:00
Thomas Nagy b7d93c3c4d
Update the year in headers to 2017 2017-02-11 16:13:37 +01:00
Thomas Nagy f1487eab44
iso8859-1 -> latin-1 2017-01-21 13:28:06 +01:00
Thomas Nagy 0d47689d97
Conceal Python 2.6 subprocess errors 2017-01-06 04:30:02 +01:00
Thomas Nagy f322cfe569
Improve Utils.Timer on python >= 3.3 2017-01-03 15:48:35 +01:00
Thomas Nagy c5bf55ee86
Allocate Utils.lru_cache lazily 2016-11-26 18:59:38 +01:00
Thomas Nagy 5fd84a75e6
More cleanup for #1865 2016-11-26 14:22:30 +01:00
Thomas Nagy 1318c5f2d6
Cleanup for #1865 2016-11-26 11:54:27 +01:00
Gustavo J. A. M. Carneiro ac55bf5bf7 Accept functools.partial() as a task rule #1862 (#1865)
Accept functools.partial() as task generator rules #1862
2016-11-26 11:54:18 +01:00
Thomas Nagy f02047b8ea
Add install_user and install_group to bld.install/bld.install_as/bld.symlink_as 2016-10-08 22:35:05 +02:00
Thomas Nagy fc2946ce64
Re-raise TimeoutExpired from process executors 2016-09-03 22:36:41 +02:00
Thomas Nagy af172413f4
Python 3.3 fix 2016-09-03 22:24:29 +02:00
Thomas Nagy 71aed22539
Call killpg only if setsid is enabled 2016-09-03 20:22:43 +02:00
Thomas Nagy 9f14c9dda0
Kill process trees on timeouts (os.killpg) 2016-09-03 18:29:41 +02:00
Thomas Nagy 8dba949014
Use the same logic as Python3.5 for handling timeouts #1807 2016-08-28 13:12:55 +02:00
Thomas Nagy fdc3b47067
Python3 - Kill processes in subprocess timeouts #1807 2016-08-25 07:48:14 +02:00
Thomas Nagy a4e7cb1930
Copy os.environ because Python3 cannot serialize it 2016-07-31 18:48:36 +02:00
Thomas Nagy 3e08a19a56
Use the parent os.environ value as default in pre-forked processes #1791 2016-07-31 15:55:47 +02:00
Gustavo Jose de Sousa 9a0932951f Fallback to run_regular_process if we can't pickle arguments 2016-06-27 20:49:37 -03:00
Thomas Nagy eaa83004c8
Api docs 2016-06-25 16:23:06 +02:00
Thomas Nagy ef6525c0bf
Api docs 2016-06-25 14:49:27 +02:00
Thomas Nagy 2c76187d41
Api docs 2016-06-25 12:50:04 +02:00
Thomas Nagy e8ef5a89eb
More cleanup 2016-06-05 00:23:57 +02:00
Thomas Nagy 062a5263a0
Update conf.check_waf_version to 1.9 2016-06-04 09:33:13 +02:00
Thomas Nagy ab9609c0d8
docs 2016-05-21 12:01:48 +02:00
Thomas Nagy 158bc72e8e
Remove the old shutil.copy override on Windows 2016-05-14 11:29:06 +02:00