1. 18 1月, 2019 1 次提交
    • S
      travis-ci: switch to Xcode 10.1 macOS image · 2000ac9f
      SZEDER Gábor 提交于
      When building something with GCC installed from Homebrew in the
      default macOS (with Xcode 9.4) image on Travis CI, it errors out with
      something like this:
      
        /usr/local/Cellar/gcc/8.1.0/lib/gcc/8/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-fixed/stdio.h:78:10: fatal error: _stdio.h: No such file or directory
         #include <_stdio.h>
                  ^~~~~~~~~~
      
      This seems to be a common problem affecting several projects, and the
      common solution is to use a Travis CI macOS image with more recent
      Xcode version, e.g. 10 or 10.1.
      
      While we don't use such a GCC yet, in the very next patch we will, so
      switch our OSX build jobs to use the Xcode 10.1 image.  Compared to
      the Xcode 10 image, this has the benefit that it comes with GCC (v8.2)
      preinstalled from Homebrew.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2000ac9f
  2. 09 11月, 2018 1 次提交
    • Æ
      i18n: make GETTEXT_POISON a runtime option · 6cdccfce
      Ævar Arnfjörð Bjarmason 提交于
      Change the GETTEXT_POISON compile-time + runtime GIT_GETTEXT_POISON
      test parameter to only be a GIT_TEST_GETTEXT_POISON=<non-empty?>
      runtime parameter, to be consistent with other parameters documented
      in "Running tests with special setups" in t/README.
      
      When I added GETTEXT_POISON in bb946bba ("i18n: add GETTEXT_POISON
      to simulate unfriendly translator", 2011-02-22) I was concerned with
      ensuring that the _() function would get constant folded if NO_GETTEXT
      was defined, and likewise that GETTEXT_POISON would be compiled out
      unless it was defined.
      
      But as the benchmark in my [1] shows doing a one-off runtime
      getenv("GIT_TEST_[...]") is trivial, and since GETTEXT_POISON was
      originally added the GIT_TEST_* env variables have become the common
      idiom for turning on special test setups.
      
      So change GETTEXT_POISON to work the same way. Now the
      GETTEXT_POISON=YesPlease compile-time option is gone, and running the
      tests with GIT_TEST_GETTEXT_POISON=[YesPlease|] can be toggled on/off
      without recompiling.
      
      This allows for conditionally amending tests to test with/without
      poison, similar to what 859fdc0c ("commit-graph: define
      GIT_TEST_COMMIT_GRAPH", 2018-08-29) did for GIT_TEST_COMMIT_GRAPH. Do
      some of that, now we e.g. always run the t0205-gettext-poison.sh test.
      
      I did enough there to remove the GETTEXT_POISON prerequisite, but its
      inverse C_LOCALE_OUTPUT is still around, and surely some tests using
      it can be converted to e.g. always set GIT_TEST_GETTEXT_POISON=.
      
      Notes on the implementation:
      
       * We still compile a dedicated GETTEXT_POISON build in Travis
         CI. Perhaps this should be revisited and integrated into the
         "linux-gcc" build, see ae59a4e4 ("travis: run tests with
         GIT_TEST_SPLIT_INDEX", 2018-01-07) for prior art in that area. Then
         again maybe not, see [2].
      
       * We now skip a test in t0000-basic.sh under
         GIT_TEST_GETTEXT_POISON=YesPlease that wasn't skipped before. This
         test relies on C locale output, but due to an edge case in how the
         previous implementation of GETTEXT_POISON worked (reading it from
         GIT-BUILD-OPTIONS) wasn't enabling poison correctly. Now it does,
         and needs to be skipped.
      
       * The getenv() function is not reentrant, so out of paranoia about
         code of the form:
      
             printf(_("%s"), getenv("some-env"));
      
         call use_gettext_poison() in our early setup in git_setup_gettext()
         so we populate the "poison_requested" variable in a codepath that's
         won't suffer from that race condition.
      
       * We error out in the Makefile if you're still saying
         GETTEXT_POISON=YesPlease to prompt users to change their
         invocation.
      
       * We should not print out poisoned messages during the test
         initialization itself to keep it more readable, so the test library
         hides the variable if set in $GIT_TEST_GETTEXT_POISON_ORIG during
         setup. See [3].
      
      See also [4] for more on the motivation behind this patch, and the
      history of the GETTEXT_POISON facility.
      
      1. https://public-inbox.org/git/871s8gd32p.fsf@evledraar.gmail.com/
      2. https://public-inbox.org/git/20181102163725.GY30222@szeder.dev/
      3. https://public-inbox.org/git/20181022202241.18629-2-szeder.dev@gmail.com/
      4. https://public-inbox.org/git/878t2pd6yu.fsf@evledraar.gmail.com/Signed-off-by: NÆvar Arnfjörð Bjarmason <avarab@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      6cdccfce
  3. 02 11月, 2018 1 次提交
    • S
      travis-ci: install packages in 'ci/install-dependencies.sh' · 0f0c5118
      SZEDER Gábor 提交于
      Ever since we started using Travis CI, we specified the list of
      packages to install in '.travis.yml' via the APT addon.  While running
      our builds on Travis CI's container-based infrastructure we didn't
      have another choice, because that environment didn't support 'sudo',
      and thus we didn't have permission to install packages ourselves.  With
      the switch to the VM-based infrastructure in the previous patch we do
      get a working 'sudo', so we can install packages by running 'sudo
      apt-get -y install ...' as well.
      
      Let's make use of this and install necessary packages in
      'ci/install-dependencies.sh', so all the dependencies (i.e. both
      packages and "non-packages" (P4 and Git-LFS)) are handled in the same
      file.  Install gcc-8 only in the 'linux-gcc' build job; so far it has
      been unnecessarily installed in the 'linux-clang' build job as well.
      Print the versions of P4 and Git-LFS conditionally, i.e. only when
      they have been installed; with this change even the static analysis
      and documentation build jobs start using 'ci/install-dependencies.sh'
      to install packages, and neither of these two build jobs depend on and
      thus install those.
      
      This change will presumably be beneficial for the upcoming Azure
      Pipelines integration [1]: preliminary versions of that patch series
      run a couple of 'apt-get' commands to install the necessary packages
      before running 'ci/install-dependencies.sh', but with this patch it
      will be sufficient to run only 'ci/install-dependencies.sh'.
      
      [1] https://public-inbox.org/git/1a22efe849d6da79f2c639c62a1483361a130238.1539598316.git.gitgitgadget@gmail.com/Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      0f0c5118
  4. 26 10月, 2018 1 次提交
  5. 21 5月, 2018 1 次提交
  6. 09 1月, 2018 1 次提交
    • S
      travis-ci: build Git during the 'script' phase · 3c93b829
      SZEDER Gábor 提交于
      Ever since we started building and testing Git on Travis CI (522354d7
      (Add Travis CI support, 2015-11-27)), we build Git in the
      'before_script' phase and run the test suite in the 'script' phase
      (except in the later introduced 32 bit Linux and Windows build jobs,
      where we build in the 'script' phase').
      
      Contrarily, the Travis CI practice is to build and test in the
      'script' phase; indeed Travis CI's default build command for the
      'script' phase of C/C++ projects is:
      
        ./configure && make && make test
      
      The reason why Travis CI does it this way and why it's a better
      approach than ours lies in how unsuccessful build jobs are
      categorized.  After something went wrong in a build job, its state can
      be:
      
        - 'failed', if a command in the 'script' phase returned an error.
          This is indicated by a red 'X' on the Travis CI web interface.
      
        - 'errored', if a command in the 'before_install', 'install', or
          'before_script' phase returned an error, or the build job exceeded
          the time limit.  This is shown as a red '!' on the web interface.
      
      This makes it easier, both for humans looking at the Travis CI web
      interface and for automated tools querying the Travis CI API, to
      decide when an unsuccessful build is our responsibility requiring
      human attention, i.e. when a build job 'failed' because of a compiler
      error or a test failure, and when it's caused by something beyond our
      control and might be fixed by restarting the build job, e.g. when a
      build job 'errored' because a dependency couldn't be installed due to
      a temporary network error or because the OSX build job exceeded its
      time limit.
      
      The drawback of building Git in the 'before_script' phase is that one
      has to check the trace log of all 'errored' build jobs, too, to see
      what caused the error, as it might have been caused by a compiler
      error.  This requires additional clicks and page loads on the web
      interface and additional complexity and API requests in automated
      tools.
      
      Therefore, move building Git from the 'before_script' phase to the
      'script' phase, updating the script's name accordingly as well.
      'ci/run-builds.sh' now becomes basically empty, remove it.  Several of
      our build job configurations override our default 'before_script' to
      do nothing; with this change our default 'before_script' won't do
      anything, either, so remove those overriding directives as well.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3c93b829
  7. 28 12月, 2017 1 次提交
  8. 13 12月, 2017 2 次提交
    • S
      travis-ci: move setting environment variables to 'ci/lib-travisci.sh' · e3371e92
      SZEDER Gábor 提交于
      Our '.travis.yml's 'env.global' section sets a bunch of environment
      variables for all build jobs, though none of them actually affects all
      build jobs.  It's convenient for us, and in most cases it works just
      fine, because irrelevant environment variables are simply ignored.
      
      However, $GIT_SKIP_TESTS is an exception: it tells the test harness to
      skip the two test scripts that are prone to occasional failures on
      OSX, but as it's set for all build jobs those tests are not run in any
      of the build jobs that are capable to run them reliably, either.
      
      Therefore $GIT_SKIP_TESTS should only be set in the OSX build jobs,
      but those build jobs are included in the build matrix implicitly (i.e.
      by combining the matrix keys 'os' and 'compiler'), and there is no way
      to set an environment variable only for a subset of those implicit
      build jobs.  (Unless we were to add new scriptlets to '.travis.yml',
      which is exactly the opposite direction that we took with commit
      657343a6 (travis-ci: move Travis CI code into dedicated scripts,
      2017-09-10)).
      
      So move setting $GIT_SKIP_TESTS to 'ci/lib-travisci.sh', where it can
      trivially be set only for the OSX build jobs.
      
      Furthermore, move setting all other environment variables from
      '.travis.yml' to 'ci/lib-travisci.sh', too, because a couple of
      environment variables are already set there, and this way all
      environment variables will be set in the same place.  All the logic
      controlling our builds is already in the 'ci/*' scripts anyway, so
      there is really no good reason to keep the environment variables
      separately.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e3371e92
    • S
      travis-ci: introduce a $jobname variable for 'ci/*' scripts · bf427a94
      SZEDER Gábor 提交于
      A couple of 'ci/*' scripts are shared between different build jobs:
      'ci/lib-travisci.sh', being a common library, is sourced from almost
      every script, while 'ci/install-dependencies.sh', 'ci/run-build.sh'
      and 'ci/run-tests.sh' are shared between the "regular" GCC and Clang
      Linux and OSX build jobs, and the latter two scripts are used in the
      GETTEXT_POISON Linux build job as well.
      
      Our builds could benefit from these shared scripts being able to
      easily tell which build job they are taking part in.  Now, it's
      already quite easy to tell apart Linux vs OSX and GCC vs Clang build
      jobs, but it gets trickier with all the additional Linux-based build
      jobs included explicitly in the build matrix.
      
      Unfortunately, Travis CI doesn't provide much help in this regard.
      The closest we've got is the $TRAVIS_JOB_NUMBER variable, the value of
      which is two dot-separated integers, where the second integer
      indicates a particular build job.  While it would be possible to use
      that second number to identify the build job in our shared scripts, it
      doesn't seem like a good idea to rely on that:
      
        - Though the build job numbering sequence seems to be stable so far,
          Travis CI's documentation doesn't explicitly states that it is
          indeed stable and will remain so in the future.  And even if it
          were stable,
      
        - if we were to remove or insert a build job in the middle, then the
          job numbers of all subsequent build jobs would change accordingly.
      
      So roll our own means of simple build job identification and introduce
      the $jobname environment variable in our builds, setting it in the
      environments of the explicitly included jobs in '.travis.yml', while
      constructing one in 'ci/lib-travisci.sh' as the combination of the OS
      and compiler name for the GCC and Clang Linux and OSX build jobs.  Use
      $jobname instead of $TRAVIS_OS_NAME in scripts taking different
      actions based on the OS and build job (when installing P4 and Git LFS
      dependencies and including them in $PATH).  The following two patches
      will also rely on $jobname.
      Signed-off-by: NSZEDER Gábor <szeder.dev@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      bf427a94
  9. 02 11月, 2017 1 次提交
  10. 11 9月, 2017 1 次提交
  11. 11 5月, 2017 2 次提交
  12. 27 4月, 2017 1 次提交
  13. 17 4月, 2017 3 次提交
  14. 29 3月, 2017 1 次提交
    • L
      travis-ci: build and test Git on Windows · 029aeeed
      Lars Schneider 提交于
      Most Git developers work on Linux and they have no way to know if their
      changes would break the Git for Windows build. Let's fix that by adding
      a job to TravisCI that builds and tests Git on Windows. Unfortunately,
      TravisCI does not support Windows.
      
      Therefore, we did the following:
      * Johannes Schindelin set up a Visual Studio Team Services build
        sponsored by Microsoft and made it accessible via an Azure Function
        that speaks a super-simple API. We made TravisCI use this API to
        trigger a build, wait until its completion, and print the build and
        test results.
      * A Windows build and test run takes up to 3h and TravisCI has a timeout
        after 50min for Open Source projects. Since the TravisCI job does not
        use heavy CPU/memory/etc. resources, the friendly TravisCI folks
        extended the job timeout for git/git to 3h.
      
      Things, that would need to be done:
      * Someone with write access to https://travis-ci.org/git/git would need
        to add the secret token as "GFW_CI_TOKEN" variable in the TravisCI
        repository setting [1]. Afterwards the build should just work.
      
      Things, that might need to be done:
      * The Windows box can only process a single build at a time. A second
        Windows build would need to wait until the first finishes. This
        waiting time and the build time after the wait could exceed the 3h
        threshold. If this is a problem, then it is likely to happen every day
        as usually multiple branches are pushed at the same time (pu/next/
        master/maint). I cannot test this as my TravisCI account has the 50min
        timeout. One solution could be to limit the number of concurrent
        TravisCI jobs [2].
      
      [1] https://docs.travis-ci.com/user/environment-variables#Defining-Variables-in-Repository-Settings
      [2] https://docs.travis-ci.com/user/customizing-the-build#Limiting-Concurrent-BuildsSigned-off-by: NLars Schneider <larsxschneider@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      029aeeed
  15. 07 3月, 2017 1 次提交
  16. 24 1月, 2017 1 次提交
  17. 06 12月, 2016 1 次提交
  18. 11 11月, 2016 1 次提交
  19. 22 10月, 2016 1 次提交
  20. 23 9月, 2016 1 次提交
  21. 13 7月, 2016 1 次提交
  22. 22 6月, 2016 1 次提交
    • J
      perf: accommodate for MacOSX · e3efa94b
      Johannes Schindelin 提交于
      As this developer has no access to MacOSX developer setups anymore,
      Travis becomes the best bet to run performance tests on that OS.
      
      However, on MacOSX /usr/bin/time is that good old BSD executable that
      no Linux user cares about, as demonstrated by the perf-lib.sh's use
      of GNU-ish extensions. And by the hard-coded path.
      
      Let's just work around this issue by using gtime on MacOSX, the
      Homebrew-provided GNU implementation onto which pretty much every
      MacOSX power user falls back anyway.
      
      To help other developers use Travis to run performance tests on
      MacOSX, the .travis.yml file now sports a commented-out line that
      installs GNU time via Homebrew.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Reviewed-by: NLars Schneider <larsxschneider@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e3efa94b
  23. 23 5月, 2016 1 次提交
  24. 11 5月, 2016 1 次提交
  25. 29 4月, 2016 1 次提交
  26. 20 4月, 2016 1 次提交
  27. 26 2月, 2016 1 次提交
  28. 27 1月, 2016 2 次提交
  29. 29 11月, 2015 1 次提交