Commit Graph

98 Commits

Author SHA1 Message Date
Patrick Steinhardt
2ae45bc318 scripts: add script to create releases
The current release process is not documented in any way. As a result,
it's not obvious how releases should be done at all, like e.g. which
locations need adjusting.

To fix this, let's introduce a new script that shall from now on be used
to do all releases. As input it gets the tree that shall be released,
the repository in which to do the release, credentials to
authenticate against GitHub and the new version. E.g. executing the
following will create a new release v0.32:

    $ ./script/release.py 0.32.0 --user pks-t --password ****

While the password may currently be your usual GitLab password, it's
recommended to use a personal access token intead.

The script will then perform the following steps:

    1. Verify that "include/git2/version.h" matches the new version.

    2. Verify that "docs/changelog.md" has a section for that new
       version.

    3. Extract the changelog entries for the current release from
       "docs/changelog.md".

    4. Generate two archives in "tar.gz" and "zip" format via "git
       archive" from the tree passed by the user. If no tree was passed,
       we will use "HEAD".

    5. Create the GitHub release using the extracted changelog entries
       as well as tag and name information derived from the version
       passed by the used.

    6. Upload both code archives to that release.

This should cover all steps required for a new release and thus ensures
that nothing is missing that shouldn't be.
2020-02-07 15:06:24 +01:00
Edward Thomson
2ad3eb3e8e valgrind: add suppressions for undefined use
valgrind will warn that OpenSSL will use undefined data in connect/read
when talking to certain other TLS stacks.  Thankfully, this only seems
to occur when gcc is the compiler, so hopefully valgrind is just
misunderstanding an optimization.  Regardless, suppress this warning.
2019-11-24 17:29:38 +11:00
Edward Thomson
6df3ec4a52 valgrind: suppress libssh2_rsa_sha1_sign leaks 2019-11-24 16:49:35 +11:00
Edward Thomson
7adc32d525 valgrind: suppress kexinit leaks 2019-11-24 16:49:35 +11:00
Edward Thomson
5dc1be8d54 valgrind: suppress uninitialized reads in libcrypto
libcrypto will read uninitialized memory as entropy.  Suppress warnings
from this behavior.
2019-11-23 11:28:02 +11:00
Patrick Steinhardt
56d5b4432b valgrind: suppress memory leaks in libssh2_session_handshake
On Ubuntu, the combination of libgcrypt and libssh2 is quite old and
known to contain memory leaks. We thus have several functions listed in
our suppressions file that are known to leak. Due to a recent update of
libssh2 or libgcrypt, there now are new memory leaks caused by
libssh2_session_handshake and libssh2_init that cause the CI to fail.

Add a new suppression to fix the issue.
2019-09-21 18:21:47 +02:00
Patrick Steinhardt
d827b11b67 tests: execute leak checker via CTest directly
Right now, we have an awful hack in our test CI setup that extracts the
test command from CTest's output and then prepends the leak checker.
This is dependent on non-machine-parseable output from CMake and also
breaks on various ocassions, like for example when we have spaces in the
current path or when the path contains backslashes. Both conditions may
easily be triggered on Win32 systems, and in fact they do break our
Azure Pipelines builds.

Remove the awful hack in favour of a new CMake build option
"USE_LEAK_CHECKER". If specifying e.g. "-DUSE_LEAK_CHECKER=valgrind",
then we will set up all tests to be run under valgrind. Like this, we
can again simply execute ctest without needing to rely on evil sourcery.
2019-07-20 19:10:10 +02:00
Edward Thomson
00c66dfd3b errors: update static analysis tools for giterr
Update GITERR and giterr usages in the static code analysis tools to use
the new names.
2019-01-22 22:30:37 +00:00
Etienne Samson
a74f4fb9d2 coverity: attempt to model clar's assertions
Coverity considers that anything that looks like assert() behaves like
it (ie. side-effects would be skipped on a NDEBUG build). As we have a
bunch of those in the test suite (128), this would ensure Coverity isn't
confused.
2019-01-04 14:04:48 +01:00
Edward Thomson
24d175621b ci: remove unused old ci scripts 2018-07-28 23:54:46 +01:00
Edward Thomson
24b8dd8275 ci: move travis to the new scripts 2018-07-28 23:54:46 +01:00
Edward Thomson
465f8b5163 ci: move appveyor to new scripts 2018-07-27 16:54:35 +01:00
Edward Thomson
b00672b9e4 ci: enable leak checking on osx 2018-07-26 15:34:53 +01:00
Edward Thomson
ce798b256b tests: simplify cmake test configuration
Simplify the names for the tests, removing the unnecessary
"libgit2-clar" prefix.  Make "all" the new default test run, and include
the online tests by default (since HTTPS should always be enabled).

For the CI tests, create an offline-only test, then the various online
tests.
2018-07-26 14:07:00 +01:00
Etienne Samson
61eaaadf7f travis: enable -Werror in the script instead of using the matrix 2018-06-06 13:15:50 +02:00
Etienne Samson
149790b96e scripts: remove extraneous semicolons 2018-06-06 13:15:50 +02:00
Etienne Samson
4c969618f6 scripts: use leaks on macOS 2018-06-06 13:15:50 +02:00
Etienne Samson
0fb8c1d09c valgrind: bump num-callers to 50 for fuller stack traces 2018-06-06 13:15:50 +02:00
Etienne Samson
1f4ada2a42 travis: let cmake perform the build & install step
The goal is to let cmake manage the parallelism
2018-06-06 13:15:50 +02:00
Etienne Samson
573c408921 valgrind: skip buf::oom test 2018-06-06 13:15:50 +02:00
Etienne Samson
74b0a43207 travis: split valgrind check in its own script 2018-06-06 13:15:50 +02:00
Etienne Samson
2f4e7cb0e8 travis: split testing from building 2018-06-06 13:15:50 +02:00
Edward Thomson
86353a7260 Merge pull request #4173 from tiennou/mbedtls
mbedTLS support
2018-04-22 14:57:02 +01:00
Edward Thomson
d906a8796c Merge pull request #4476 from pks-t/pks/backport-script
scripts: add backporting script
2018-04-17 23:39:54 +01:00
Etienne Samson
cb2da47e56 travis: pass -fPIC when configuring mbedtls 2018-04-11 21:02:44 +02:00
Etienne Samson
10aff3d523 travis: just grab what we need from mbedtls 2018-04-11 21:02:43 +02:00
Etienne Samson
262dfcf0bf mbedtls: enable Travis CI tests 2018-04-11 21:02:43 +02:00
Patrick Steinhardt
0b3d859257 scripts: add backporting script
This adds a simple script for backporting pull requests to older
branches. It accepts as parameters a list of pull request numbers which
whose commits are to be cherry-picked. The identification of PRs
currently happens by using the commit message of the merge of the PR,
which should conform to the message "Merge pull request #<PR>".

While the heuristic works in practice, we could instead also use the
direct references from GitHub via "pull/#<PR>/head". This requires the
user to have all these references fetched, though, so we can just use
the current heuristic until we experience any issues with that.
2018-01-12 11:10:00 +00:00
Patrick Steinhardt
5874e151d7 tests: create new test target for all SSH-based tests
Some tests shall be run against our own SSH server we spin up in Travis.
As those need to be run separate from our previous tests which run
against git-daemon, we have to do this in a separate step. Instead of
bundling all that knowledge in the CI script, move it into the test
build instructions by creating a new test target.
2018-01-03 11:50:39 +00:00
Patrick Steinhardt
54a1bf057a tests: online::clone: inline creds-test with nonexistent URL
Right now, we test our credential callback code twice, once via SSH on
localhost and once via a non-existent GitHub repository. While the first
URL makes sense to be configurable, it does not make sense to hard-code
the non-existing repository, which requires us to call tests multiple
times. Instead, we can just inline the URL into another set of tests.
2018-01-03 11:50:39 +00:00
Patrick Steinhardt
fea6092079 tests: online::clone: construct credential-URL from environment
We support two types of passing credentials to the proxy, either via the
URL or explicitly by specifying user and password. We test these types
by modifying the proxy URL and executing the tests twice, which is
in fact unnecessary and requires us to maintain the list of environment
variables and test executions across multiple CI infrastructures.

To fix the situation, we can just always pass the host, port, user and
password to the tests. The tests can then assemble the complete URL
either with or without included credentials, allowing us to test both
cases in-process.
2018-01-03 11:50:39 +00:00
Edward Thomson
28c89507d1 Merge pull request #4394 from libgit2/cmn/macos-ramdisk
travis: put clar's sandbox in a ramdisk on macOS
2017-11-06 11:49:46 -08:00
Patrick Steinhardt
0b98a66baa appveyor: build examples
By default, CMake will not build our examples directory. As we do not
instruct either the MinGW or MSVC builds on AppVeyor to enable building
these examples, we cannot verify that those examples at least build on
Windows systems.

Fix that by passing `-DBUILD_EXAMPLES=ON` to AppVeyor's CMake
invocation.
2017-11-06 11:16:02 +00:00
Carlos Martín Nieto
71ba464435 travis: let's try a 5GB ramdisk 2017-10-31 14:43:28 +01:00
Carlos Martín Nieto
37bb15122e travis: put clar's sandbox in a ramdisk on macOS
The macOS tests are by far the slowest right now. This attempts to remedy the
situation somewhat by asking clar to put its test data on a ramdisk.
2017-10-31 11:08:09 +01:00
Edward Thomson
9dc21efdbf travis: add custom apt sources
Move back to Travis's VM infrastructure for efficiency.
2017-10-07 00:10:06 +01:00
Edward Thomson
c582fa4eb6 travis: only install custom libcurl on trusty 2017-07-24 17:53:32 +01:00
Edward Thomson
697583ea3a travis: only kill our own sshd 2017-07-24 17:38:39 +01:00
Edward Thomson
f031e20b51 travis: build with patched libcurl
Ubuntu trusty has a bug in curl when using NTLM credentials in a proxy,
dereferencing a null pointer and causing segmentation faults.  Use a
custom-patched version of libcurl that avoids this issue.
2017-07-24 16:56:33 +01:00
Patrick Steinhardt
06619904a2 travis: cibuild: set up our own sshd server
Some tests of ours require to be running against an SSH server.
Currently, we simply run against the SSH server provided and started by
Travis itself. As our Linux tests run in a sudo-less environment, we
have no control over its configuration and startup/shutdown procedure.
While this has been no problem until now, it will become a problem as
soon as we migrate over to newer Precise images, as the SSH server does
not have any host keys set up. Luckily, we can simply set up our own
unpriviledged SSH server. This has the benefit of us being able to
modify its configuration even in a sudo-less environment.

This commit sets up the unpriviledged SSH server on port 2222.
2017-06-21 08:05:13 +02:00
Patrick Steinhardt
96d0298921 travis: replace use of deprecated homebrew/dupes tap
The formulae provided by the homebrew/dupes tap are deprecated since at
least April 4, 2017, with formulae having been migrated to
homebrew/core.

Replace the deprecated reference to "homebrew/dupes/zlib" with only
"zlib".
2017-06-13 08:13:48 +02:00
Edward Thomson
844e85f21d travis: install openssl explicitly 2017-06-12 20:00:21 +01:00
Edward Thomson
408a7b7737 appveyor: don't rewrite system mingw
Download mingw-w64 into our build directory and execute it there, don't
try to overwrite the system's mingw.
2017-02-24 20:25:45 +00:00
Patrick Steinhardt
18c18e3df8 coverity: check for Coverity token only if necessary
When running a Coverity build, we have to provide an
authentication token in order to proof that we are actually
allowed to run analysis in the name of a certain project. As this
token should be secret, it is only set on the main repository, so
when we were requested to run the Coverity script on another
repository we do error out. But in fact we do also error out if
the Coverity analysis should _not_ be run if there is no
authentication token provided.

Fix the issue by only checking for the authentication token after
determining if analysis is indeed requested.
2016-10-31 16:01:10 +01:00
Patrick Steinhardt
561276eed6 coverity: only analyze the master branch of the main repository
We used to only execute Coverity analysis on the 'development'
branch before commit 998f001 (Refine build limitation,
2014-01-15), which refined Coverity build limitations. While we
do not really use the 'development' branch anymore, it does
still make sense to only analyze a single branch, as otherwise
Coverity might get confused.

Re-establish the restriction such that we only analyze libgit2's
'master' branch. Also fix the message announcing why we do not
actually analyze a certain build.
2016-10-28 14:56:10 +02:00
Patrick Steinhardt
6c4d2d3ea2 coverity: fix download URL 2016-10-28 14:45:55 +02:00
Patrick Steinhardt
ec3f5a9c20 script: cibuild: build examples 2016-10-10 09:04:42 +02:00
Carlos Martín Nieto
db357667bc travis: take the newer ssh-keygen format into account
The Mac machines have updated their SSH version and so the ssh-keygen
format has changed. Ask it for MD5, which is the one that is output as
hex.
2016-10-05 20:23:58 +02:00
Carlos Martín Nieto
94d565b957 cibuild: set -x
This lets us see the details of what we're doing instead of just seeing the
output of unknown commands in the build output.
2016-10-05 18:52:43 +02:00
Edward Thomson
a37624ecc7 Merge pull request #3815 from pks-t/pks/coverity-model
Coverity user model
2016-07-24 16:05:17 -04:00