Commit Graph

12124 Commits

Author SHA1 Message Date
Jurko Gospodnetić
9950d2c670 Updated the internal Boost Build testing system to use the Python subprocess module (introduced in Python 2.4) for running external processes instead of popen2 (deprecated since Python 2.6). We are already using Python 2.4 features in this codebase so there is no need to support Python releases older than 2.4.
Related changes:
  * BoostBuild.Tester & TestCmd.TestCmd interfaces now accept external process parameters as a list of strings, thus avoiding problems with parsing arguments containing spaces.
  * Avoided a potential process hang in case an external process being run prints out enough output to fill up the OS's pipe buffer (OS would pause the process until someone read the data from the pipe but the testing framework would not do this until the process in question had terminated).

[SVN r79448]
2012-07-12 12:55:25 +00:00
Jurko Gospodnetić
c5e5b5324e Boost Build cleanup - minor stylistic internal Boost Build test script & testing system changes.
[SVN r79445]
2012-07-12 12:22:14 +00:00
Jurko Gospodnetić
f9c5030d40 Boost Build cleanup - minor stylistic internal Boost Build test script & testing system changes.
[SVN r79445]
2012-07-12 12:22:14 +00:00
Jurko Gospodnetić
91e29f3735 Boost Jam code cleanup - minor stylistic changes.
[SVN r79442]
2012-07-12 10:28:58 +00:00
Jurko Gospodnetić
c94e5a36c6 Boost Jam code cleanup - minor stylistic changes.
[SVN r79442]
2012-07-12 10:28:58 +00:00
Jurko Gospodnetić
9425ca14b9 Booat Jam code cleanup - synchronized filent.c & fileunix.c OS specific implementation modules. Extracted shared functionality to filesys.c. Updated related descriptive function & module comments. Added missing copyright comment for the filesys.c module.
[SVN r79429]
2012-07-11 21:42:51 +00:00
Jurko Gospodnetić
98a286ce6e Booat Jam code cleanup - synchronized filent.c & fileunix.c OS specific implementation modules. Extracted shared functionality to filesys.c. Updated related descriptive function & module comments. Added missing copyright comment for the filesys.c module.
[SVN r79429]
2012-07-11 21:42:51 +00:00
Jurko Gospodnetić
53873d7597 Boost Build code & comment cleanup - minor stylistic changes & comment typo corrections.
[SVN r79416]
2012-07-11 15:31:27 +00:00
Jurko Gospodnetić
0fc1c001ad Boost Build code & comment cleanup - minor stylistic changes & comment typo corrections.
[SVN r79416]
2012-07-11 15:31:27 +00:00
Jurko Gospodnetić
975cc49106 Boost Jam code cleanup - minor stylistic changes.
[SVN r79415]
2012-07-11 15:16:11 +00:00
Jurko Gospodnetić
aa10d013bd Boost Jam code cleanup - minor stylistic changes.
[SVN r79415]
2012-07-11 15:16:11 +00:00
Jurko Gospodnetić
e70c45c3e5 Boost Jam code cleanup - minor stylistic changes.
[SVN r79414]
2012-07-11 14:50:49 +00:00
Jurko Gospodnetić
756793aba0 Boost Jam code cleanup - minor stylistic changes.
[SVN r79414]
2012-07-11 14:50:49 +00:00
Jurko Gospodnetić
3b80184839 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ć
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ć
2049470934 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ć
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ć
f8f1a93154 Boost Jam code cleanup.
[SVN r79411]
2012-07-11 05:05:45 +00:00
Jurko Gospodnetić
345feef178 Boost Jam code cleanup.
[SVN r79411]
2012-07-11 05:05:45 +00:00
Jurko Gospodnetić
0c986af085 Recommitting the rest of the valid changes reverted in revision [79321].
[SVN r79410]
2012-07-11 04:58:43 +00:00
Jurko Gospodnetić
1ad187ca76 Recommitting the rest of the valid changes reverted in revision [79321].
[SVN r79410]
2012-07-11 04:58:43 +00:00
Jurko Gospodnetić
ed56af5717 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
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
dc8e3d28bc 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
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ć
0b503c35bd Reverting all Boost Build & Jam changes back to revision [79279] in order to get the Boost library trunk tests back up & running again. Something after that revision seems to have introduced a problem in the non-Windows Boost Jam implementation causing crashes, truncated output and similar undefined behaviour. That problem needs to be addressed before re-adding all the later changes.
[SVN r79321]
2012-07-07 09:02:33 +00:00
Jurko Gospodnetić
8e05bdc38a Reverting all Boost Build & Jam changes back to revision [79279] in order to get the Boost library trunk tests back up & running again. Something after that revision seems to have introduced a problem in the non-Windows Boost Jam implementation causing crashes, truncated output and similar undefined behaviour. That problem needs to be addressed before re-adding all the later changes.
[SVN r79321]
2012-07-07 09:02:33 +00:00
Jurko Gospodnetić
99e2b468a3 Boost Jam cleanup - minor stylistic changes.
[SVN r79320]
2012-07-07 07:38:49 +00:00
Jurko Gospodnetić
ccd7f12bdb Boost Jam cleanup - minor stylistic changes.
[SVN r79320]
2012-07-07 07:38:49 +00:00
Jurko Gospodnetić
d9b64c670e Boost Jam cleanup - synchronized changes between Windows and Unix file_dirscan() implementations, removed some unnecessary short-to-long path conversions on Windows (for root folders), minor stylistic code changes.
BUG: May cause access violations (crashes, core dumps or other undefined behaviour) by dereferencing a NULL pointer on non-Windows builds.

[SVN r79311]
2012-07-06 03:04:32 +00:00
Jurko Gospodnetić
a12b007c85 Boost Jam cleanup - synchronized changes between Windows and Unix file_dirscan() implementations, removed some unnecessary short-to-long path conversions on Windows (for root folders), minor stylistic code changes.
BUG: May cause access violations (crashes, core dumps or other undefined behaviour) by dereferencing a NULL pointer on non-Windows builds.

[SVN r79311]
2012-07-06 03:04:32 +00:00
Jurko Gospodnetić
77a0170c84 Boost Jam cleanup - minor stylistic code change.
[SVN r79310]
2012-07-06 02:13:44 +00:00
Jurko Gospodnetić
4d58b05c13 Boost Jam cleanup - minor stylistic code change.
[SVN r79310]
2012-07-06 02:13:44 +00:00
Jurko Gospodnetić
5b364fa966 Brown paper bag fix for a Boost Jam bug introduced in revision [73907] causing Boost Jam not to build at all (actually - not to be able to find any files in folders other than the current one).
[SVN r79309]
2012-07-06 02:08:13 +00:00
Jurko Gospodnetić
ccab12b859 Brown paper bag fix for a Boost Jam bug introduced in revision [73907] causing Boost Jam not to build at all (actually - not to be able to find any files in folders other than the current one).
[SVN r79309]
2012-07-06 02:08:13 +00:00
Jurko Gospodnetić
d430819efa Fixed a Boost Jam crash bug when its Windows specific file_dirscan() function gets called for a non-existent folder.
[SVN r79308]
2012-07-06 01:28:13 +00:00
Jurko Gospodnetić
a2745d27dd Fixed a Boost Jam crash bug when its Windows specific file_dirscan() function gets called for a non-existent folder.
[SVN r79308]
2012-07-06 01:28:13 +00:00
Jurko Gospodnetić
d3b327e22c Boost Jam code cleanup - removed unused variables and unnecessary variable setting, added some more description comments, minor stylistic changes.
[SVN r79307]
2012-07-06 01:26:03 +00:00
Jurko Gospodnetić
d518f9d5c5 Boost Jam code cleanup - removed unused variables and unnecessary variable setting, added some more description comments, minor stylistic changes.
[SVN r79307]
2012-07-06 01:26:03 +00:00
Jurko Gospodnetić
64b368bd04 Boost Jam cleanup - renamed path_add_key() to path_key__register_long_path().
[SVN r79304]
2012-07-05 23:39:45 +00:00
Jurko Gospodnetić
48be57c18b Boost Jam cleanup - renamed path_add_key() to path_key__register_long_path().
[SVN r79304]
2012-07-05 23:39:45 +00:00
Jurko Gospodnetić
4efad5b55e Boost Jam optimization - avoid unnecessary FindFirstFile() Windows API calls (and related unnecessary file system access) used to determine a file's long name in case that file's given name does not meet the short file name (8+3) criteria.
[SVN r79303]
2012-07-05 23:20:38 +00:00
Jurko Gospodnetić
4c9995750a Boost Jam optimization - avoid unnecessary FindFirstFile() Windows API calls (and related unnecessary file system access) used to determine a file's long name in case that file's given name does not meet the short file name (8+3) criteria.
[SVN r79303]
2012-07-05 23:20:38 +00:00
Jurko Gospodnetić
af65544399 Boost Jam cleanup - merged pathunix.c module's Windows specific ShortPathToLongPath() & path_write_key() function implementations that were calling each other recursively. Now we have a single function that seems easier to understand and refactor further.
[SVN r79295]
2012-07-05 19:12:20 +00:00
Jurko Gospodnetić
bd14c7be66 Boost Jam cleanup - merged pathunix.c module's Windows specific ShortPathToLongPath() & path_write_key() function implementations that were calling each other recursively. Now we have a single function that seems easier to understand and refactor further.
[SVN r79295]
2012-07-05 19:12:20 +00:00
Jurko Gospodnetić
e034b6440b Corrected a potential access violation in Boost Jam introduced in revision [79281] by incorrectly comparing new strings with already existing ones in the OBJECT hash table.
[SVN r79291]
2012-07-05 18:40:38 +00:00
Jurko Gospodnetić
9a4420b3db Corrected a potential access violation in Boost Jam introduced in revision [79281] by incorrectly comparing new strings with already existing ones in the OBJECT hash table.
[SVN r79291]
2012-07-05 18:40:38 +00:00
Jurko Gospodnetić
ac58313c4b Boost Jam cleanup - made the buf variable in pathunix.c module's path_key() function more local instead of it being named a temporary but being used a long way away. This could not be done before because ShortPathToLongPath() used to cheat and temporarily change its 'const string' parameter internally which would cause the ShortPathToLongPath() call in this function to fail if we passed it object_str( normalized ) instead of buf->value even though they hold the same content.
[SVN r79287]
2012-07-05 15:56:50 +00:00
Jurko Gospodnetić
85bd6b20b8 Boost Jam cleanup - made the buf variable in pathunix.c module's path_key() function more local instead of it being named a temporary but being used a long way away. This could not be done before because ShortPathToLongPath() used to cheat and temporarily change its 'const string' parameter internally which would cause the ShortPathToLongPath() call in this function to fail if we passed it object_str( normalized ) instead of buf->value even though they hold the same content.
[SVN r79287]
2012-07-05 15:56:50 +00:00
Jurko Gospodnetić
4e20d35df4 Boost Jam cleanup - Windows ShortPathToLongPath() implementation no longer cheats & temporarily modifies the const string it is passed as a parameter but instead passes string lengths explicitly.
[SVN r79282]
2012-07-05 13:15:25 +00:00