1. 27 Sep, 2017 3 commits
  2. 20 Sep, 2017 1 commit
  3. 16 Sep, 2017 1 commit
  4. 15 Sep, 2017 6 commits
    • Merge pull request #4347 from pks-t/pks/appveyor-vs2015 · d378e384
      Fix AppVeyor build failures due to CRTDBG linking issue
      Edward Thomson committed
    • appveyor: add jobs to also build on Visual Studio 2015 · 03a95bc5
      In order to cover a wider range of build environments, add two more jobs
      which build and test libgit2 on Visual Studio 14 2015.
      Patrick Steinhardt committed
    • appveyor: explicitly specify build images · e1076dbf
      AppVeyor currently does provide three standard build worker images with
      VS2013, VS2015 and VS2017. Right now, we are using the implicitly, which
      is the VS2015 one. We want to be more explicit about this, so that we
      can easily switch build images based on the job. So starting from this
      commit, we explicitly set the `APPVEYOR_BUILD_WORKER_IMAGE` variable per
      job, which enables us to choose different images.
      
      To be able to test a wider range of build configurations, this commit
      also switches the jobs for VC2010 over to use the older, VS2013 based
      images. As the next commit will introduce two new jobs for building with
      VS2015, we have then covered both build environments.
      
      Also, let us be a bit more explicit regarding the CMake generator.
      Instead of only saying "Visual Studio 10", use the more descriptive
      value "Visual Studio 10 2010" to at least avoid some confusion
      surrounding the versioning scheme of Visual Studio.
      Patrick Steinhardt committed
    • cmake: fix linker error with dbghelper library · 54214d61
      When the MSVC_CRTDBG option is set by the developer, we will link in the
      dbghelper library to enable memory lead detection in MSVC projects. We
      are doing so by adding it to the variable `CMAKE_C_STANDARD_LIBRARIES`,
      so that it is linked for every library and executable built by CMake.
      But this causes our builds to fail with a linker error:
      
      ```
          LINK: fatal error LNK1104: cannot open file 'advapi32.lib;Dbghelp.lib'
      ```
      
      The issue here is that we are treating the variable as if it were an
      array of libraries by setting it via the following command:
      
      ```
          SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES}"
              "Dbghelp.lib")
      ```
      
      The generated build commands will then simply stringify the variable,
      concatenating all the contained libraries with a ";". This causes the
      observed linking failure.
      
      To fix the issue, we should just treat the variabable as a simple
      string. So instead of adding multiple members, we just add the
      "Dbghelp.lib" library to the existing string, separated by a space
      character.
      Patrick Steinhardt committed
    • diff: cleanup hash ctx in `git_diff_patchid` · 046b081a
      After initializing the hash context in `git_diff_patchid`, we never
      proceed to call `git_hash_ctx_cleanup` on it. While this doesn't really
      matter on most hash implementations, this causes a memory leak on Win32
      due to CNG system requiring a `malloc` call.
      
      Fix the memory leak by always calling `git_hash_ctx_cleanup` before
      exiting.
      Patrick Steinhardt committed
    • cmake: enable reproducible static linking · d630887b
      By default, both ar(1) and ranlib(1) will insert additional information
      like timestamps into generated static archives and indices. As a
      consequence, generated static archives are not deterministic when
      created with default parameters.
      
      Both programs do support a deterministic mode, which will simply zero
      out undeterministic information with `ar D` and `ranlib -D`.
      Unfortunately, CMake does not provide an easy knob to add these command
      line parameters. Instead, we have to redefine the complete command
      definitons stored in the variables CMAKE_C_ARCHIVE_CREATE,
      CMAKE_C_ARCHIVE_APPEND and CMAKE_C_ARCHIVE_FINISH.
      
      Introduce a new build option `ENABLE_REPRODUCIBLE_BUILDS`. This option
      is available on Unix-like systems with the exception of macOS, which
      does not have support for the required flags. If the option is being
      enabled, we add those flags to the invocation of both `ar` and `ranlib`
      to enable deterministically building the static archive.
      Patrick Steinhardt committed
  5. 12 Sep, 2017 3 commits
  6. 11 Sep, 2017 1 commit
  7. 10 Sep, 2017 1 commit
  8. 09 Sep, 2017 1 commit
  9. 30 Aug, 2017 1 commit
    • tests: deterministically generate test suite definitions · 583e4141
      The script "generate.py" is used to parse all test source files for unit
      tests. These are then written into a "clar.suite" file, which can be
      included by the main test executable to make available all test suites
      and unit tests.
      
      Our current algorithm simply collects all test suites inside of a dict,
      iterates through its items and dumps them in a special format into the
      file. As the order is not guaranteed to be deterministic for Python
      dictionaries, this may result in arbitrarily ordered C structs. This
      obviously defeats the purpose of reproducible builds, where the same
      input should always result in the exact same output.
      
      Fix this issue by sorting the test suites by name previous to dumping
      them as structs. This enables reproducible builds for the libgit2_clar
      file.
      Patrick Steinhardt committed
  10. 25 Aug, 2017 14 commits
  11. 24 Aug, 2017 1 commit
  12. 17 Aug, 2017 1 commit
    • cmake: fix output location of import libraries and DLLs · a3a35473
      As observed by Edward Thomson, the libgit2 DLL built by Windows will not
      end up in the top-level build directory but instead inside of the 'src/'
      subdirectory. While confusing at first because we are actually setting
      the LIBRARY_OUTPUT_DIRECTORY to the project's binary directory, the
      manual page of LIBRARY_OUTPUT_DIRECTORY clears this up:
      
          There are three kinds of target files that may be built: archive,
          library, and runtime. Executables are always treated as runtime
          targets. Static libraries are always treated as archive targets.
          Module libraries are always treated as library targets. For non-DLL
          platforms shared libraries are treated as library targets. For DLL
          platforms the DLL part of a shared library is treated as a runtime
          target and the corresponding import library is treated as an archive
          target. All Windows-based systems including Cygwin are DLL
          platforms.
      
      So in fact, DLLs and import libraries are not treated as libraries at
      all by CMake but instead as runtime and archive targets. To fix the
      issue, we can thus simply set the variables RUNTIME_OUTPUT_DIRECTORY and
      ARCHIVE_OUTPUT_DIRECTORY to the project's root binary directory.
      Patrick Steinhardt committed
  13. 16 Aug, 2017 6 commits