[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[csmith-project/creduce] 718b61: Burn git hash into `clang_delta` via source file.



  Branch: refs/heads/master
  Home:   https://github.com/csmith-project/creduce
  Commit: 718b613f183252c311e9127730853a53f28476d8
      https://github.com/csmith-project/creduce/commit/718b613f183252c311e9127730853a53f28476d8
  Author: Eric Eide <eeide@cs.utah.edu>
  Date:   2016-06-25 (Sat, 25 Jun 2016)

  Changed paths:
    M clang_delta/ClangDelta.cpp
    M clang_delta/Makefile.am
    M clang_delta/Makefile.in
    A clang_delta/git_version.cpp.in
    A clang_delta/git_version.h

  Log Message:
  -----------
  Burn git hash into `clang_delta` via source file.

Generate a source file containing the current (short) git hash.  When
the git hash changes, regenerate that source file --- thus triggering
recompilation of that file and relinking of `clang_delta`.

Previously, we made the git hash available at compile time through a
command-line option to the compiler.  We did not have any kind of
dependency on the git hash value, however, so we couldn't trigger a
recompilation when it changed.  Worse: if it *did* change and we
noticed, we would in principle have needed to recompile every source
file.

The CMake-based build system already tracks the git hash as a
configuration dependency, and so it already suffers from the
recompile-everything problem described above.

This commit changes our strategy.  Now, we have an explicit dependency
on the git hash value, and when it changes, we only need to regenerate
and recompile one source file.  This is "sexy," but more significantly,
it will help us to make the CMake-based build system more usable for
developers.  (This commit does not update the CMake-based build system,
however.  Forthcoming!)


  Commit: 2507dbb8a8a67717c98e373f688a04117ae482ca
      https://github.com/csmith-project/creduce/commit/2507dbb8a8a67717c98e373f688a04117ae482ca
  Author: Eric Eide <eeide@cs.utah.edu>
  Date:   2016-06-25 (Sat, 25 Jun 2016)

  Changed paths:
    M creduce/Makefile.am
    M creduce/Makefile.in
    M creduce/creduce.in
    M creduce/creduce_config.pm.in

  Log Message:
  -----------
  Rebuild `creduce_config.pm` when git hash changes.


  Commit: 543a800be7a95ede74cc5d40c152f1a7449df755
      https://github.com/csmith-project/creduce/commit/543a800be7a95ede74cc5d40c152f1a7449df755
  Author: Eric Eide <eeide@cs.utah.edu>
  Date:   2016-06-25 (Sat, 25 Jun 2016)

  Changed paths:
    M clex/Makefile.am
    M clex/Makefile.in
    M delta/Makefile.am
    M delta/Makefile.in
    M unifdef/Makefile.am
    M unifdef/Makefile.in

  Log Message:
  -----------
  Remove "old way" of handling git hash for compiles.

Remove the code that passes the current git commit hash to the compiler
as a command-line option.  We don't do it this way any more.  And, in
the files affected by this commit, we weren't using the hash at compile
time anyway.


  Commit: e049c05f2a33b66feb7afbec663a94e83a2f47cd
      https://github.com/csmith-project/creduce/commit/e049c05f2a33b66feb7afbec663a94e83a2f47cd
  Author: Eric Eide <eeide@cs.utah.edu>
  Date:   2016-06-25 (Sat, 25 Jun 2016)

  Changed paths:
    M CMakeLists.txt
    M clang_delta/CMakeLists.txt

  Log Message:
  -----------
  Generate and compile `clang_delta/git_version.cpp`.


  Commit: 9b0d49394e2bc3a0c29d39181f7161e3a684de42
      https://github.com/csmith-project/creduce/commit/9b0d49394e2bc3a0c29d39181f7161e3a684de42
  Author: Eric Eide <eeide@cs.utah.edu>
  Date:   2016-06-25 (Sat, 25 Jun 2016)

  Changed paths:
    M CMakeLists.txt
    M clang_delta/CMakeLists.txt
    M clang_delta/ClangDelta.cpp
    M clang_delta/Makefile.am
    M clang_delta/Makefile.in
    A clang_delta/git_version.cpp.in
    A clang_delta/git_version.h
    M clex/Makefile.am
    M clex/Makefile.in
    M creduce/Makefile.am
    M creduce/Makefile.in
    M creduce/creduce.in
    M creduce/creduce_config.pm.in
    M delta/Makefile.am
    M delta/Makefile.in
    M unifdef/Makefile.am
    M unifdef/Makefile.in

  Log Message:
  -----------
  Merge new way to handle git hash at compile time.

Previously, we passed the current (short) git hash to the C/C++ compiler
at compile time via a command-line option.  Now, we generate a source
file containing the git hash at compile time.  More significantly, if we
detect that the git hash has changed, we regenerate the source file.

This method is more friendly to users of the CMake-based build path.
Previously, CMake would detect that the current git hash had changed,
and thus the command-line options had changed, and thus trigger a
recompilation of every C/C++ file.  Ugh.  Now this doesn't happen: now,
only the one C/C++ file that contains the hash value needs to be
recompiled.  (The `creduce/creduce_config.pm` file also needs to be
regenerated.  The CMake-based path already did this, and this has not
changed.)

This method is also more precise for users of the Automake-based build
path.  Previously, we didn't detect when changes to the current git hash
required things to be rebuilt.  Now we do.


Compare: https://github.com/csmith-project/creduce/compare/9df1c31d5f10...9b0d49394e2b