Nikita Kniazev
64d292d7a0
win: Increase communication buffers size ( #412 )
...
Currently the size of reading buffer is 16KiB while the the pipe buffer is of
system default size which seems to be 8KiB on Win7. Because of this the half of
the reading buffer is never used.
Also, recent Windows updates with Meltdown mitigation made syscalls more
expensive, and increasing the buffer size will lower the syscalls count.
2019-03-17 14:10:40 -05:00
Raffi Enficiaud
c39a8b81b3
Fix compilation issue on some old compilers ( #362 )
2018-10-28 09:59:44 -05:00
Nikita Kniazev
e7e55d0cc9
Do not read pipe content at available size peeking
...
Currently the same data is read twice.
The first time a buffer is filled by `PeekNamedPipe` and second time it is
overwritten with the same content by `ReadFile`.
2018-10-11 23:23:28 +03:00
Nikita Kniazev
d13002a92d
Fixed slow pipe reading on windows
...
It looks like the OS has the internal buffer around 4KB and with any buffer
over this size `read_pipe` will end the reading loop after first try despite
that reading a pipe may pump a new data and it can be read immediately.
2018-10-11 20:31:44 +03:00
Steven Watanabe
fb43f6bb60
Print output from actions immediately in single-threaded builds (-j1). Output is still buffered in parallel builds and for quiet actions. This should also fix the output order for VMS which doesn't support parallel builds. Fixes #210 .
2018-01-26 12:49:09 -07:00
Steven Watanabe
6d7c0c752d
Quote the name of the batch script so that it works when %TMP% contains a space. Fixes #274 .
2017-12-21 15:16:45 -07:00
Alexander Karzhenkov
48e9017139
Fix compiler warnings about deprecated language features ( #238 )
2017-10-28 22:50:55 -05:00
Steven Watanabe
8ae8407cfb
Fix incorrect return value from try_wait, which caused most parallel builds to fail.
2017-04-26 17:32:06 -06:00
Steven Watanabe
316e26ca71
Remove fixed limit to -j. Fixes #189 .
...
* execunix.c: Replace select with poll.
* execnt.c: Use RegisterWaitForSingleObject when the number of jobs exceeds MAXIMUM_WAIT_OBJECTS.
2017-04-26 14:22:06 -06:00
Rene Rivera
5f22da72aa
Reporpous "-o" option to mirror all BB output to the specified file.
...
Useful for script control and for users to obtain a log in an easier
cross-platform manner.
2015-04-10 09:07:56 -05:00
Jürgen Hunold
20a3fb2981
Merge pull request #5 from jivancic/more_than_64_jobs
...
[b2] support more than 64 parallel jobs (-j)
2014-07-02 16:55:03 +02:00
Steven Watanabe
d782ec52d0
Don't exit immediately on Windows if JAMSHELL is % and CreateProcess fails.
2014-04-03 14:13:33 -07:00
Juraj Ivančić
d2cf5aed72
Avoid creating a thread if remaining jobs can be placed in the same array as thread handles.
...
If we have to wait for, e.g. 65 jobs, first we create a thread which waits for first 63.
The remaining two can be waited on by the same WFMO call which waits for thread
completion. This will avoid creating 2 threads in this case.
2014-01-14 16:11:37 +01:00
Juraj Ivančić
db6c3d7a79
Support more than 64 parallel jobs (-j).
...
Windows WaitForMultipleObjects() can wait on max. 64 handles. This limitation is overcome by splitting the handle set into parts which are of adequate size, and spawning a thread which does the waiting.
2014-01-14 14:05:29 +01:00
Jurko Gospodnetić
9306fed6e0
Boost Jam cleanup - minor stylistic changes.
...
[SVN r80169]
2012-08-24 14:31:20 +00:00
Jurko Gospodnetić
681b6609af
Boost Jam code cleanup - minor stylistic changes (added missing spaces around some parameters inside brackets in C code).
...
[SVN r79587]
2012-07-18 15:06:44 +00:00
Jurko Gospodnetić
145ce56f80
Windows Boost Jam implementation now uses finer resolution than 1 second when creating timestamps based on the current system time. Since these are never (and should never be!) compared to file system timestamps - this causes no conflicts with file system timestamps still using 1 second resolution at best.
...
Related stylistic changes:
- filetime_to_timestamp() function renamed to timestamp_from_filetime() and moved to the timestamp.c module.
- filetime_to_seconds() function moved back to the execnt.c module as a static function as it only used from there after the timestamp_from_filetime() reimplementation in revision [79494].
- filent.h header now empty and removed.
[SVN r79511]
2012-07-14 18:55:06 +00:00
Jurko Gospodnetić
3736a64fd6
Boost Jam code cleanup - wrapped up timestamp values inside a timstamp structure instead of using a raw time_t value as another preparation step towards implementing support for timestamps with resolution finer than 1 second. All timestamp manipulation now done using the new timestamp_XXX() API.
...
File timestamps displayed with -d+3 debug output now presented in UTC (+0000) timezone.
Other related minor stylistic changes:
- timestamp_from_target() renamed to timestamp_from_path()
- timestamp_from_target() parameter order switched
- comment updates
- added some const function parameter modifiers
- some header #include directives reordered alphabetically
[SVN r79501]
2012-07-14 16:11:16 +00:00
Jurko Gospodnetić
8202d97670
Boost Jam code cleanup - extracted Windows specific FILETIME structure conversion functions from execnt.c to a lowel level filent.c Windows specific module so they may be reused in both. Renamed the functions to make their purpose clearer.
...
[SVN r79497]
2012-07-14 13:23:45 +00:00
Jurko Gospodnetić
eb8c859a26
Boost Jam execnt.c module code cleanup. No longer attempts to perform some operations like closing alert windows or reading their output (before the code depended on some operations not doing anything if given invalid handles or process ids). No longer needs to find out the process id from a process handle (since it actually already had these process ids all along), thus avoiding hacks needed to support this on Windows versions prior to Windows XP SP1 (where there was no GetProcessId() Windows API). Minor stylistic changes.
...
[SVN r79496]
2012-07-14 13:10:00 +00:00
Jurko Gospodnetić
fe47abe424
Boost Jam code cleanup - removed a redundant #include directive.
...
[SVN r79495]
2012-07-14 11:49:52 +00:00
Jurko Gospodnetić
8e716991c8
Corrected Boost Jam's Windows FILETIME to POSIX time_t conversion. New implementation lifted shamelessly from the CPython implementation. The old implementation did not work correctly in all cases depending on the user's regional (timezone & daylight saving time) settings as well as the TZ environment variable (affects some C runtime library routines). It also used the double type to represent some interim values during its calculation - sometimes causing off-by-one rounding errors.
...
[SVN r79494]
2012-07-14 11:42:58 +00:00
Jurko Gospodnetić
743cc7ed4b
Boost Jam code cleanup - minor stylistic code changes & comment updates.
...
[SVN r79493]
2012-07-14 11:35:29 +00:00
Jurko Gospodnetić
1791d078cc
Boost Build/Jam cleanup - stylistic code changes.
...
[SVN r79244]
2012-07-03 15:58:26 +00:00
Jurko Gospodnetić
88b24aba84
Updated Boost Jam's child process output handling on Windows based on the -p command-line option to match the one used on Unix.
...
If -p option value 0 is specified (the default), the child's stdout & stderr output streams are both collected into a single pipe and sent merged to the build process's stdout output.
If any other -p option value is specified, the child's stdout & stderr output streams are collected separately and redirected based on the -p parameter value:
1 - stdout to stdout, stderr forgotten
2 - stdout forgotten, stderr to stderr
3 - stdout to stdout, stderr to stderr.
[SVN r79123]
2012-06-26 19:44:47 +00:00
Jurko Gospodnetić
d040beb6c2
Boost Jam code cleanup - added symbolic constant names for read and write pipe end indices used in the running commands table data structure in the execnt.c module. Minor stylistic changes.
...
[SVN r79121]
2012-06-26 19:40:36 +00:00
Jurko Gospodnetić
0e1e424997
Boost Jam code cleanup - moved checking for quiet actions from make1c() into make_closure(). This removes the need to tunnel related rule_name & target_name strings through all the exec*.c module command execution functionality.
...
[SVN r79115]
2012-06-26 15:36:47 +00:00
Jurko Gospodnetić
e28a24a962
Boost Jam code cleanup - out_action() calls from different platform specific exec*.c modules now moved into the central make_closure() function in the main build state machine implementation. exec_cmd() callbacks fitted with additional parameters to make this work but this should be temporary. exec*.c modules no longer need to remember their original command string given to execute just so they could pass them back to their out_action() calls since the central make_closure() function already has this information.
...
[SVN r79113]
2012-06-26 15:08:50 +00:00
Jurko Gospodnetić
88ef23e4a0
Boost Jam code cleanup - execnt.c module no longer needs to hold exit_code & exit_reason data in the running commands table structure for each of its spawned processes as those values are now read & used directly in a single exec_wait() call.
...
[SVN r79111]
2012-06-26 13:56:02 +00:00
Jurko Gospodnetić
6609ba8f61
Boost Jam code cleanup - minor stylistic const correctness & comment changes.
...
[SVN r79110]
2012-06-26 13:49:06 +00:00
Jurko Gospodnetić
276332ef0f
Corrected how Boost Jam handles no-op actions, i.e. those that the used exec*.c platform specific implementation module flagged as a no-op. They still do not cause an external process to be triggered but internally Boost Jam now processes their results the same as if they had been triggered and had done nothing except return EXIT_OK (i.e. they get reported correctly with -d1 & -d2 options, their timing and action rules get triggered and such). This fixes the core_d12.py Boost Build test which was failing due to no-op actions no causing their names to be reported to stdout when run with -d1.
...
[SVN r79104]
2012-06-26 10:42:58 +00:00
Jurko Gospodnetić
e17fa79213
Updated Boost Jam to execute commands directly on Windows when that is requested by setting the JAMSHELL variable to '%', the same as for Unix OSs, and not change the user's request under covers to running the command via the default shell if it is 8191 characters long or shorter. Renamed the related Boost Build core_nt_line_length.py test to core_nt_cmd_line.py and updated it with more detailed test cases.
...
[SVN r79097]
2012-06-25 23:01:59 +00:00
Jurko Gospodnetić
7c60279557
Updated Boost Jam's Windows shell I/O redirection & quote character (<>|'") detection to correctly recognize an escaped escape as regular character and not a possible start for a new escape sequence. Added more related internal unit tests.
...
[SVN r79093]
2012-06-25 21:41:24 +00:00
Jurko Gospodnetić
b207d857ca
Fixed a Boost Jam bug on Windows where it would incorrectly interpret shell I/O redirection characters <>| and quote characters "' when deciding whether a command can be executed without an external shell if the first non-whitespace character in the command is a quote character (either single or double).
...
[SVN r79091]
2012-06-25 20:38:29 +00:00
Jurko Gospodnetić
3ce44878f8
Boost Jam code cleanup - minor stylistic execnt.c module comment change.
...
[SVN r79085]
2012-06-25 15:35:47 +00:00
Jurko Gospodnetić
6d042d6039
Boost Jam code cleanup - added support for exec*.c modules deciding that there is really no purpose in running the given 'do-nothing' command on their platform and simply telling the main build state machine to consider that command successfully executed. This is a preparation step for implementing a better 'raw command execution' criteria on Windows where attempting to execute an empty raw command would issue an error.
...
[SVN r79082]
2012-06-25 14:54:18 +00:00
Jurko Gospodnetić
cce2a98e9b
Made Boost Jam preserve trailing whitespace when executing its raw commands on Windows same as it does for other OSs (just the leading whitespace and trailing all-whitespace lines get trimmed). Command files used with external shells now also again get the complete action content without any whitespace trimming. This partially reverts a recent change from revision 78997 and also fixes the module_actions.py Boost Build test broken by that revision.
...
[SVN r79081]
2012-06-25 14:34:33 +00:00
Jurko Gospodnetić
411315fef4
Boost Jam code cleanup - minor stylistic execnt.c module change.
...
[SVN r79080]
2012-06-25 14:10:56 +00:00
Jurko Gospodnetić
52e55fd455
Boost Jam code cleanup - minor stylistic execnt.c module changes.
...
[SVN r79079]
2012-06-25 14:06:35 +00:00
Jurko Gospodnetić
d23202eeff
Boost Jam code cleanup - added a new exec_check() exec*.c module platform specific functions and moved all command validation into them. MAXLINE macro is no longer needed globally for all platforms, and those platforms that do not have a fixed constant for their maximum command line length (e.g. Windows) may now hold that knowledge inside their exec*.c modules and not export it in any way. Windows execnt.c implementation still does some extra command-trimming that needs to be cleaned up.
...
[SVN r79078]
2012-06-25 13:42:00 +00:00
Jurko Gospodnetić
a1d76d06a2
Boost Jam now first tries alternate command-file names before waiting for 250ms when it fails to open its intended command-file for writing (most likely due so some anti-virus software still holding it open). This speeds up command running in such 'overly eager anti-virus software' scenarios.
...
[SVN r79076]
2012-06-25 09:39:46 +00:00
Jurko Gospodnetić
b1579a0ffe
Boost Jam code cleanup - extracted running command counting out of platform specific exec*.c modules and moved it to the central make1.c module. Simplified upper running command count checking since with the new '-j' command-line parameter and the PARALLELISM built-in variable value checking we now know that globs.jobs is always in the [1, MAXJOBS] range.
...
[SVN r79075]
2012-06-25 09:25:59 +00:00
Jurko Gospodnetić
7bc3bed307
Boost Jam code cleanup - execnt.c module no longer outputs its 'argv' related -d+4 debug output since its argv structure is just an intermediate structure contructed while preparing the final command string for passing to the CreateProcessA() Windows API. Actual final constructed command string still does get displayed as -d+4 debug output.
...
[SVN r79073]
2012-06-25 01:45:14 +00:00
Jurko Gospodnetić
69245164b9
Boost Jam code cleanup - more standardized 'default shell' implementation in both execnt.c & execunix.c modules. This removes the knowledge duplication in code about what default shell we are using as well as allows us to process default & non-default shells equally.
...
[SVN r79072]
2012-06-25 01:32:02 +00:00
Jurko Gospodnetić
605bc82e86
Boost Jam code cleanup - updated path_tmpdir() to return a string object instead of a raw C char pointer.
...
[SVN r79068]
2012-06-25 00:41:37 +00:00
Jurko Gospodnetić
d34ffa9d42
Boost Jam code cleanup - refactored code in exec*.c module for executing child processes to reduce duplication and function size. The only externally visible change is in several debug (-d+4) messages.
...
[SVN r79065]
2012-06-24 16:10:58 +00:00
Jurko Gospodnetić
e56812f2f7
Boost Jam code cleanup - extracted code making the actual CreateProcessA() call in the execnt.c module into a separate invoke_cmd() function.
...
[SVN r79063]
2012-06-24 14:57:41 +00:00
Jurko Gospodnetić
7e6b310623
Boost Jam code cleanup - added a new execcmd.c module to hold shared implementation between different exec*.c modules. Extracted external command process interrupt handling code into the new module.
...
BROKEN: execcmd.c not actually added in this revision.
[SVN r79055]
2012-06-24 11:59:49 +00:00
Jurko Gospodnetić
d4b88e9cdb
Boost Jam code cleanup - removed global exec*.c module exec_done() cleanup routines as they were either not doing anything (execnt.c) or just releasing memory that would get released automatically by the OS on the imminent process exit (execunix.c).
...
[SVN r79052]
2012-06-24 10:58:58 +00:00
Jurko Gospodnetić
0bc246eb32
Boost Jam code cleanup - extracted functions for finding a free running tables command slot in execnt.c & execunix.c modules.
...
[SVN r79051]
2012-06-24 10:42:19 +00:00