2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00
Commit Graph

52 Commits

Author SHA1 Message Date
Jurko Gospodnetić
0ff040d3a0 Boost Jam code cleanup - extracted code for getting a timestamp for the current system time to timestamp_current().
[SVN r79507]
2012-07-14 17:28:50 +00:00
Jurko Gospodnetić
ace6747054 Boost Jam's internal timestamp data structure now holds a member for nanosecond information. This information is still always set to 0 but, if set, is used when needed. Updated Boost Jam's header cache file format to hold the new extended timestamp information (bumped format version up to 5).
[SVN r79506]
2012-07-14 17:17:09 +00:00
Jurko Gospodnetić
6383f7f161 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ć
4728e87bf0 Boost Jam cleanup - minor stylistic changes.
[SVN r79450]
2012-07-12 13:36:31 +00:00
Jurko Gospodnetić
aa10d013bd Boost Jam code cleanup - minor stylistic changes.
[SVN r79415]
2012-07-11 15:16:11 +00:00
Jurko Gospodnetić
ecde6dc3c1 Cleaned up the main Boost Jam build state machine. MAKE1ATAIL state integrated into MAKE1A, MAKE1D state removed since it was doing nothing but morphing itself to MAKE1C and the main state structure no longer needs to contain extra MAKE1D state specific information. Cleaned up and updated related state description comments. Added a related missing #include directive in the make.h header caught by the make1.c module cleanup. Minor stylistic changes.
[SVN r79413]
2012-07-11 14:45:44 +00:00
Jurko Gospodnetić
495ff1b41c Boost Jam now again removes partially built targets in case of an interrupted command. Broken in revision [79341].
One scenario in which this bug occurs:

Prerequisites:
  - using the execunix.c implementation
       - may detect multiple finished jobs at the same time (in
         exec_wait()) and call all of their make_closure() callbacks in
         sequence
  - globs.max_jobs set to 2

Notes:
  - <<< X. f() >>> marks a function call f() made at depth X
  - [...] are additional comments about the current program state
  - We use the following target dependency tree (X <-- Y meaning Y is a
    dependency (source) for X):
      A
      B
      C <-- B
      D <-- B
      E <-- A, B


 <<< 1. make1() >>>
    ...
    <<< 2. make1c(B) >>>
        ...
        [stack: <empty>]
        [running jobs: A & B]
        <<< 3. exec_wait() >>>
            - detects job A as failed (which leaves a partially built
              target A)
            - detects job B as completed successfully
            <<< 4. make_closure(A) >>>
                - pushes state MAKE1D(A)
            <<< 4. make_closure(B) >>>
                - pushes state MAKE1D(B)

    [control returns to make1()]
    [stack: MAKE1D(A), MAKE1D(B)]
    [running jobs: <none>]
    - goes on to process the next state on the stack - MAKE1D(B)
    <<< 2. make1d(B) >>>
        - morphs its state node into MAKE1C(B)

    [control returns to make1()]
    [stack: MAKE1D(A), MAKE1C(B)]
    [running jobs: <none>]
    - goes on to process the next state on the stack - MAKE1C(B)
    <<< 2. make1c(B) >>>
        - pops its state off the stack
        - there are no more commands to execute for building B so that
          target is considered built and we notify its parents C, D & E
          about this by pushing MAKE1B(E), MAKE1B(D) & MAKE1B(C) states

    [control returns to make1()]
    [stack: MAKE1D(A), MAKE1B(E), MAKE1B(D), MAKE1B(C)]
    [running jobs: <none>]
    - goes on to process the next state on the stack - MAKE1B(C)
    <<< 2. make1b(C) >>>
        - there are no more dependencies target C has to wait for so it
          goes on to build target C by morphing its state to MAKE1C(C)

    [control returns to make1()]
    [stack: MAKE1D(A), MAKE1B(E), MAKE1B(D), MAKE1C(C)]
    [running jobs: <none>]
    - goes on to process the next state on the stack - MAKE1C(C)
    <<< 2. make1c(C) >>>
        - pops its state off the stack
        <<< 3. exec_cmd(C) >>>
            - runs a new job for building target C

    [control returns to make1()]
    [stack: MAKE1D(A), MAKE1B(E), MAKE1B(D)]
    [running jobs: C]
    - goes on to process the next state on the stack - MAKE1B(D)
    <<< 2. make1b(D) >>>
        - there are no more dependencies target D has to wait for so it
          goes on to build target D by morphing its state to MAKE1C(D)

    [control returns to make1()]
    [stack: MAKE1D(A), MAKE1B(E), MAKE1C(D)]
    [running jobs: C]
    - goes on to process the next state on the stack - MAKE1C(D)
    <<< 2. make1c(D) >>>
        - pops its state off the stack
        <<< 3. exec_cmd(D) >>>
            - runs a new job for building target D.
        - since we are already at the globs.max_jobs limit - wait for
          one of the jobs to complete
        <<< 3. exec_wait() >>>
            - detects job C as interrupted
            <<< 4. make_closure(C) >>>
                - raises the intr interupt flag
                - pushes state MAKE1D(C)

    [control returns to make1()]
    [stack: MAKE1D(A), MAKE1B(E), MAKE1D(C)]
    [running jobs: D]
    - goes on to process the next state on the stack - MAKE1D(C)
    - intr is set - pops the MAKE1C(D) state from the stack
        - as an unrelated issue, note that from now we are accessing the
          MAKE1C(D) stack node information from 'released memory' which
          smells but works fine as long as we do not push another state
          on the stack due to the way released node memory is managed
          internally - via a separate 'free list' to be reused instead
          of actually releasing it
    <<< 2. make1d(C) >>>
        - morphs its (already popped!) state node into MAKE1C(C)

    [control returns to make1()]
    [stack: MAKE1D(A), MAKE1B(E)]
    [running jobs: D]
    - goes on to process the next state on the stack - MAKE1B(E)
    - intr is set - pops the MAKE1B(E) state from the stack
    <<< 2. make1b(E) >>>
        - there are more unbuilt dependencies (A) left for target E so
          it just wants to pop its state off the stack but since that
          state has already been popped it actually pops off the next
          state MAKE1D(A)

    [control returns to make1()]
    [stack: <empty>]
    [running jobs: D]
    ...

  As you can see in the last shown state, the MAKE1D(A) state got popped prematurely and never got processed - thus causing the partially built target A never to be removed.

  There are several issues present in this scenario and fixing any of them would solve the problem at hand. This commit just picks 'the easiest one'.

[SVN r79412]
2012-07-11 06:30:11 +00:00
Jurko Gospodnetić
22359b004a Restoring Boost Build & Jam changes from revisions [79281 - 79310] (inclusive) previously temporarily reverted in revision [79321]. This is done to test whether the problem causing the original revert was introduced in revision [79311] (a bug has been found in that revision that could cause the observed Boost Jam crashes). Remaining reverted changes will be reverted if we do not detect any Boost library tester failures with this revision.
[SVN r79402]
2012-07-10 15:27:58 +00:00
K. Noel Belcourt
3c3e5d01d3 Fix buffer output so newline is actully written to
cmd buffer.  Also move some closure diagnostics to
avoid interleaved output (no functional change, just
better encapsulation).



[SVN r79341]
2012-07-08 02:36:24 +00:00
Jurko Gospodnetić
7c5dac15be Boost Build/Jam cleanup - stylistic code changes.
[SVN r79244]
2012-07-03 15:58:26 +00:00
Jurko Gospodnetić
3c5398ca2c 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ć
c98e0d5e4c Boost Jam code cleanup - reduced special handling needed for executing commands while the -n option is in effect. Now make_closure() gets called consistently after all executed commands (whether actually executed by the OS, faked due to the -n option or due to exec_check() previously reporting them as NO-OPs).
[SVN r79114]
2012-06-26 15:25:01 +00:00
Jurko Gospodnetić
c9fdc14f55 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ć
d1edcc2be9 Boost Jam code cleanup - minor stylistic const correctness & comment changes.
[SVN r79110]
2012-06-26 13:49:06 +00:00
Jurko Gospodnetić
f7ac3e9810 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ć
de95985946 Boost Jam code cleanup - Removed the unneeded CMD structure tail member.
[SVN r79102]
2012-06-26 10:36:21 +00:00
Jurko Gospodnetić
e87fae0285 Boost Jam code cleanup - minor stylistic changes.
[SVN r79101]
2012-06-26 10:30:14 +00:00
Jurko Gospodnetić
561913e8cc Boost Jam code cleanup - minor stylistic make1.c module changes (line wrapping).
[SVN r79089]
2012-06-25 16:38:43 +00:00
Jurko Gospodnetić
f3cede7f28 Boost Jam code cleanup - minor stylistic make1.c module changes.
[SVN r79088]
2012-06-25 16:34:57 +00:00
Jurko Gospodnetić
8fd3f0ecce Boost Jam code cleanup - rearranged popping state off the main build state machine stack after executing an external process command so that we do not use data from a freed state node. Freed state nodes actually get transferred to some 'freed state node list' so they still exist and this was not causing access violations but it was still a smell.
[SVN r79087]
2012-06-25 16:29:57 +00:00
Jurko Gospodnetić
e04c4eba68 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ć
fad63f7d5a 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ć
a07f8fb37f Boost Jam code cleanup - cmd_new() no longer does command string line length checking, removed duplicate cmd_new() invocation when a command was found to contain a too long line, corrected reusing targets & shell lists when constructing commands after rejecting a previously constructed one.
[SVN r79077]
2012-06-25 11:46:06 +00:00
Jurko Gospodnetić
e413acfebb 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ć
4070a6957f Boost Jam code cleanup - ExecCmdCallback timing_info * parameter marked as pointer to const.
[SVN r79074]
2012-06-25 08:09:07 +00:00
Jurko Gospodnetić
ca60f1b981 Boost Jam code cleanup - removed a no longer useful constant_percent constant. Its one usage has been inlined, and even that is planned to be removed.
[SVN r79071]
2012-06-25 01:10:27 +00:00
Jurko Gospodnetić
48148fe6a9 Boost Jam code cleanup - minor stylistic change - added a const variable specifier.
[SVN r79059]
2012-06-24 13:30:08 +00:00
Jurko Gospodnetić
feba6a7d87 Boost Jam code cleanup - minor stylistic changes in the make1.c module.
[SVN r79058]
2012-06-24 13:23:29 +00:00
Jurko Gospodnetić
270b0a3d43 Corrected some minor memory leaks and avoided extra list copying in Boost Jam when processing piecemeal actions.
[SVN r79008]
2012-06-19 12:43:40 +00:00
Jurko Gospodnetić
5206ea3f95 Updated the Boost.Jam exec_cmd() interface to take its command parameter as a string object instead of a raw char *.
[SVN r79007]
2012-06-19 12:33:49 +00:00
Jurko Gospodnetić
ec74666771 Minor stylistic changes.
[SVN r78987]
2012-06-18 23:02:48 +00:00
Steven Watanabe
249e005589 Replace ad hoc (incorrect) cycle detection code with a variation of Tarjan's algorithm.
[SVN r78287]
2012-05-01 06:45:35 +00:00
Steven Watanabe
9572adeada Avoid a self-cycle in scc_root.
[SVN r78283]
2012-04-30 18:21:47 +00:00
Steven Watanabe
2020417354 Fix an infinite loop caused by creating a cycle in the strongly connected component links.
[SVN r78282]
2012-04-30 18:11:35 +00:00
Steven Watanabe
48e636feed Don't assume that make1a processes targets in the same order as make0. It doesn't. Start a new stack when rescanning to avoid spurious cycles which cause a seg-fault.
[SVN r78281]
2012-04-30 16:49:42 +00:00
Steven Watanabe
49c19f649f Handle cycles when determining target fate in make0.
[SVN r78259]
2012-04-30 01:21:04 +00:00
Steven Watanabe
fbc3382f18 Pass the correct argument to make1breakcycle and make sure that we don't add a spurious self-dependency.
[SVN r78252]
2012-04-29 04:27:55 +00:00
Steven Watanabe
71d542c0f9 Stop targets that depend on an include cycle from updating before all the required generated headers are built.
[SVN r78250]
2012-04-29 01:06:55 +00:00
Steven Watanabe
0090f72efa Detect cycles created by rescanning.
[SVN r78249]
2012-04-28 22:05:28 +00:00
Steven Watanabe
b15a1d6f8d Don't rescan targets when their internal include node is updated.
[SVN r78246]
2012-04-28 18:19:12 +00:00
Steven Watanabe
530cc72343 make sure that we don't call make0 twice on the original include node.
[SVN r78244]
2012-04-28 17:39:06 +00:00
Steven Watanabe
5417bb462d Make list_new take one argument. Rename the two argument form to list_push_back.
[SVN r77522]
2012-03-24 23:03:10 +00:00
Steven Watanabe
0ffcfface3 Remove the first argument of list_copy, since it's always L0.
[SVN r77510]
2012-03-23 22:30:33 +00:00
Steven Watanabe
26703a88ab Use dynamic arrays instead of linked lists. Reduces memory use about 10% overall.
[SVN r77408]
2012-03-19 18:17:36 +00:00
Steven Watanabe
eacae3a056 More correct behavior of -n with FAIL_EXPECTED targets and across multiple calls to UPDATE_NOW.
[SVN r76045]
2011-12-18 16:51:43 +00:00
Steven Watanabe
ce422823c9 Clean up the evil 'variables of the running module are swapped with the global variable table' hack.
[SVN r75912]
2011-12-12 02:02:20 +00:00
Steven Watanabe
28d1ce358b Fix action printing on failure.
[SVN r75911]
2011-12-12 00:59:07 +00:00
Steven Watanabe
f55a9ccb6b Replace all calls to object_new with a literal with constants.
[SVN r75890]
2011-12-11 05:11:26 +00:00
Steven Watanabe
2a25f59586 Eliminate the last uses of var_expand and remove it.
[SVN r75889]
2011-12-11 01:55:33 +00:00
Steven Watanabe
70d5029905 Replace newstr with object. Use OBJECT * instead of char *. Fix a few bugs uncovered by the better typechecking.
[SVN r75609]
2011-11-22 23:04:09 +00:00