summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Platform
Commit message (Collapse)AuthorAgeFilesLines
* more post py27 cleanupWilliam Deegan2020-02-181-40/+0
|
* more unicode cleanupWilliam Deegan2020-02-181-3/+0
|
* Remove 'from __future__ import print_function' no longer needed as we're ↵William Deegan2020-02-171-2/+0
| | | | dropping < py 3.5
* Fix some pyflakes warningsMats Wichmann2020-01-231-1/+1
| | | | | | | | These are of the kind that would not be fixed by a code reformat (Black). These should all be trivial. They're nearly all in unit tests (all but two), since I haven't cleaned up as many there in the past. Signed-off-by: Mats Wichmann <mats@linux.com>
* Get rid of remaining mktemp callsMats Wichmann2019-12-302-56/+58
| | | | | | | | | | | | Except for Platform/win32.py, the engine code no longer called insecure/deprecated tempfile.mktemp. That location is now also changed to use better methods. A couple of vestiges of old ways (like in comments) cleaned out. A couple of unit tests also converted - these don't have any impact on the scons engine, of course. Signed-off-by: Mats Wichmann <mats@linux.com>
* syntax fixups suggested by PyCharmMats Wichmann2019-12-231-1/+1
| | | | | | | | | | | | | | Drop unneeded parens. Drop trailing semicolons. Triple double-quote docstrings. Regexes drop unneeded escapes. Spaces around parens, braces: remove/add. Some one-tuples get their missing closing comma. A couple of sets use set init syntax {foo} instead of set([iter]) now. And a fiddle in Node to reduce lookup time on md5 signature functions (came about because of a line-too-long issue, initially) Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge branch 'master' into py3-doctasksWilliam Deegan2019-12-101-23/+35
|\
| * Convert our file replacement to be a classAdam Gross2019-12-091-3/+6
| | | | | | | | This hopefully will fix one unit test that validates that it's a class.
| * Fix multithreaded Windows builds when a thread has a file open for writeAdam Gross2019-12-061-25/+34
| | | | | | | | | | | | | | Python 2 enables handle inheritance by default for child processes. It wasn't until Python 3.4 that it was disabled. This causes problems because if a Python action is writing to a file and a child process is spawned at that exact moment, builds fail because of sharing issues.
* | Improve building of docs using Py3 [ci skip]Mats Wichmann2019-12-054-4/+4
|/ | | | | | | | | | | | | | | | | | | | * context managers on file r/w + use shutil.copy where it makes sense. * lxml wants (demands?) that xml files be processed as bytes * for the phase where we gen the entity files, read as text anyway * Need to solve a problem where the generated xml is putting the \n in literally, not evaluating it. * Fix some examples broken for py3 * Fix more octal constant instances * Cleanups suggested by PyCharm: staticmethods, two blanks before class definition, others. This addresses issues called out in #3300, but is not a complete solution because the actual doc build step still fails with the epydoc failures (which aren't directly because of Py3; epydoc build doesn't work any better on my system with Py3, even with the forked version with patches). Signed-off-by: Mats Wichmann <mats@linux.com>
* [PR #3345] fix more PY3.8 failsMats Wichmann2019-04-261-1/+2
| | | | | | | | | | | File closes in msvs tool Context manager in rpm tool Dummy compiler, assembler scripts can be called in unexpected ways (namely by gcc tool init), which passes --version flag. don't take exception on the getopt call. Try again to undo my breakage of _subproc, which was failing on Win+PY27 Signed-off-by: Mats Wichmann <mats@linux.com>
* [PY 3.8] test fixes for file closings, rawstringsMats Wichmann2019-04-251-5/+7
| | | | | | | On a linux host (missing some things that may be on the Travis CI setup), Py3.8a3 now shows 19 fails, 1048 pass, with 84 Warning: messages. Signed-off-by: Mats Wichmann <mats@linux.com>
* [PY 3.8] file closes in tools and othersMats Wichmann2019-04-251-6/+5
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Fix default value logic for TEMPFILEARGJOINWilliam Deegan2019-04-221-1/+1
|
* Merge remote-tracking branch 'origin/fix_3350_mslink_tempfile_join_char' ↵William Deegan2019-04-223-5/+59
|\ | | | | | | into fix_3350_mslink_tempfile_join_char
| * Updated mslink, mslib, msvc, platform docs, and added unit testWilliam Deegan2019-04-223-1/+49
| |
| * PEP 8 fileWilliam Deegan2019-04-221-4/+10
| |
* | Merge branch 'master' of github.com:SCons/scons into ↵William Deegan2019-04-221-1/+1
|\ \ | |/ |/| | | fix_3350_mslink_tempfile_join_char
| * Fixup some code triggering pylint errors.Mats Wichmann2019-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assorted fixups: exception types, redefined functions, globals, etc. Some old code removed to resolve issues (hashlib is always present on modern Pythons; no longer need the code for 2.5-and-earlier optparse). cmp is not a builtin function in Py3, drop one (unused) use; replace one. Fix another instance of renaming to SConsEnvironmentError. TODO flagged some instances of doing a raise without argument but not inside a try block - this is not considered legal, since raise with no argument is for re-raising an exception, but I don't know exactly how to resolve this in these cases. Also flagged an instance of raising an int instead of an exception class. We can either leave these as markers or update the PR. Signed-off-by: Mats Wichmann <mats@linux.com>
* | Issue #3350 - Add TEMPFILEARGJOINBYTE as a variable to be used to join each ↵William Deegan2019-04-201-1/+2
|/ | | | item placed into a TEMPFILE. Previously hardcoded as a bytearray space, now it is overridden by msvc and mslink tools
* [WIP] [PY 3.8] fix more warningsMats Wichmann2019-03-301-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several locations with simple usage of deprecated "imp" module changed to use "importlib". These match with work in #3159, but this is not a complete implementation of #3159. More regex patterns are changed to be raw strings. Some strings which did not seem appropriate to change to raw strings (e.g. contain embedded tabs, which Python should honor) had backslashes escaped to avoid accidental Python interpretation. Example: '\t<Import Project="$(VCTargetsPath)\\Microsoft.Cpp.targets" />\n' Python 3.8 was Warning \M was an unknown escape. More open().write(), open().read() style usage changed to use context managers so the file is closed. WIP part: even with Python 3.7, the tests which call sconsign.py fail; oddly they do not fail without the patch to compat.py. sconsign.py does an import using imp module (which is what generates the errors) so needs to be updated anyway. It does not quite fit the "simple usage" pattern - can't do a simple relative import since sconsign is normally located elsewhere in the tree than the main scons code body. With this version of the patch, 700 tests now pass with 3.8, and Warning messages reduced to 2800 (current master has 200 pass, 9000 warns) Signed-off-by: Mats Wichmann <mats@linux.com>
* Merge pull request #3290 from dmoody256/make_lex_tool_cross_platformWilliam Deegan2019-03-031-0/+4
|\ | | | | Add windows default paths to lex tool
| * add win_flex as option for windows, add choco default path, and add flag for ↵Daniel2019-02-201-0/+4
| | | | | | | | nounistd on windows. also more testing
* | [ci skip] correct TempFileMunge docstringMats Wichmann2019-02-231-2/+2
|/ | | | | | | TEMPFILEEXTENSION in class TempFileMunge docstring should be TEMPFILESUFFIX to match the code Signed-off-by: Mats Wichmann <mats@linux.com>
* TEMPFILEPRFIX test changed backMats Wichmann2019-01-171-4/+5
| | | | | | | Testing "if not prefix" would return false if an empty string is passed, but that setting should be valid. Signed-off-by: Mats Wichmann <mats@linux.com>
* Set defaults for TEMPFILE* differentlyMats Wichmann2019-01-161-8/+6
| | | | | | | Per review comments, subst either return the right thing or None, use this are the way to test for setting default instead of has_key. Signed-off-by: Mats Wichmann <mats@linux.com>
* Change TEMPFILEEXTENSION to TEMPFILESUFFIXMats Wichmann2019-01-162-8/+24
| | | | | | | All the other file extension variables end in SUFFIX, so change this new one to match for consistency. Added doc entry. Signed-off-by: Mats Wichmann <mats@linux.com>
* [WIP] customizable tempfile extension (issue #2431)Mats Wichmann2019-01-161-12/+23
| | | | | | | | | | | | | Apply the patch (adjusted) from issue #2341: instead of hardcoding the filename extenstion for the tempfile to help with linking on Windows targets, allow some variability. Current marked WIP because there are some other comments in the issue tracker that can maybe be flushed out by submitting this PR, and there are no tests (should presumably go in test/TEMPFILEPREFIX.py, or a new test TEMPFILEEXTENSION.py) Signed-off-by: Mats Wichmann <mats@linux.com>
* accidently reset changes, so recommitingDaniel2019-01-131-2/+20
|
* Fix GH issue #3136 No need to explicitly set file handles to non-sharable. ↵William Deegan2018-11-281-10/+2
| | | | Py 3.4 and above do this by default
* s/get_bool_envvar/get_os_env_bool/Paweł Tomulik2018-11-131-2/+2
|
* corrections after bdbaddog's code reviewPaweł Tomulik2018-11-104-94/+22
|
* initial support for virtualenvPaweł Tomulik2018-11-106-5/+454
|
* A few syntax cleanupsMats Wichmann2018-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | Suggested by PyCharm. Includes three "real" changes: 1. src/engine/SCons/Node/__init__.py has a print statement in a function which references 'self', but there is no 'self' defined (it is not a method in a class). Guessing it should have been 'node'. 2. src/engine/SCons/Environment.py makes a call using 'kwbd' which is not defined, looks like a copy-paste error and should be 'bd'. 3. src/engine/SCons/Tool/JavaCommon.py splits 'file', which is not defined, was evidently supposed to be 'fn'. These should be double-checked. The rest are purely syntax: whitespace, dropping trailing semicolons, using "is" to test for None, simplifying comparisons, normalizing docstring commenting ("always triple double quotes"), unneeded backslashes. Signed-off-by: Mats Wichmann <mats@linux.com>
* Convert one more e[0] to e.errno for OSError usageMats Wichmann2018-08-311-1/+1
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* win32 handle exception object correctlyMats Wichmann2018-08-291-2/+2
| | | | | | | | Code inspection reveals this problem (4 instances): Class 'OSError' does not define '__getitem__' so the [] operator cannot be used on its instances. Use e.errno for e[0] and e.strerror for e[1]. Signed-off-by: Mats Wichmann <mats@linux.com>
* Replace usage of unittest.TestSuite with unittest.main()Hao Wu2018-07-121-12/+1
|
* moved default paths for cywing and mingw to their own platform modules.Daniel Moody2018-05-252-0/+48
|
* Change bug references from tigris -> githubMats Wichmann2018-04-241-1/+1
| | | | Signed-off-by: Mats Wichmann <mats@linux.com>
* Use prepend for insertsMats Wichmann2018-01-171-2/+2
| | | | | | | | A number of places "append to the beginning", a better word to use here is "prepend". This is a documentation issue only, no executable statements are affected. Signed-off-by: Mats Wichmann <mats@linux.com>
* mergeWilliam Deegan2017-05-311-5/+0
|\
| * Remove ancient Aegis revision control system filesJane Doe2017-05-301-5/+0
| |
* | PY2/3 Ensure system root is not unicode on py2William Deegan2017-05-311-0/+4
|/
* PY2/3 fix error message strings for py3 on win32William Deegan2017-05-161-5/+5
|
* OSX: if user has SCONS_USE_MAC_PATHS environment variable set, then PATHOSX ↵William Deegan2017-04-091-0/+4
| | | | created from paths in /etc/paths and /etc/paths.d/* will be appended to the Environment's PATH. This allows tests (and builds) to work on (at least) on mac systems using macports
* disable experimental win32 native CopyFile usageWilliam Deegan2017-03-191-17/+17
|
* try using win32 native CopyFileWilliam Deegan2017-01-151-0/+31
|
* Use print() function to fix py2/3Craig Rodrigues2017-03-101-1/+1
|
* Must use bytes when writing to os.open()'d file on py3, bytearray works on ↵William Deegan2017-02-261-1/+1
| | | | both py3 and py2
* Merged in mbyt/scons/python3win32 (pull request #369)William Deegan2016-12-201-9/+21
|\ | | | | | | python3 support for win32.py