summaryrefslogtreecommitdiff
path: root/script
Commit message (Collapse)AuthorAgeFilesLines
* valgrind: suppress leaks in dlopen and newer librariesEdward Thomson2021-08-241-0/+64
| | | | | | dlopen sets up some thread-local state that isn't cleaned up by `dlclose`. Additionally, now that we're linking against different versions of libssh2 and OpenSSL, we're seeing different leak signatures.
* Make the pack and mwindow implementations data-race-freelhchavez2020-11-281-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | This change fixes a packfile heap corruption that can happen when interacting with multiple packfiles concurrently across multiple threads. This is exacerbated by setting a lower mwindow open file limit. This change: * Renames most of the internal methods in pack.c to clearly indicate that they expect to be called with a certain lock held, making reasoning about the state of locks a bit easier. * Splits the `git_pack_file` lock in two: the one in `git_pack_file` only protects the `index_map`. The protection to `git_mwindow_file` is now in that struct. * Explicitly checks for freshness of the `git_pack_file` in `git_packfile_unpack_header`: this allows the mwindow implementation to close files whenever there is enough cache pressure, and `git_packfile_unpack_header` will reopen the packfile if needed. * After a call to `p_munmap()`, the `data` and `len` fields are poisoned with `NULL` to make use-after-frees more evident and crash rather than being open to the possibility of heap corruption. * Adds a test case to prevent this from regressing in the future. Fixes: #5591
* Make the odb race-freelhchavez2020-11-281-6/+1
| | | | | | | This change adds all the necessary locking to the odb to avoid races in the backends. Part of: #5592
* Add a ThreadSanitizer buildlhchavez2020-08-031-0/+18
| | | | | | | This change adds a ThreadSanitizer CI build rule. It's informative for now because there are still known places where there are races. Part of: #5592
* Merge pull request #5569 from lhchavez/ci-sanitizersEdward Thomson2020-08-031-0/+4
|\ | | | | Add CI support for Memory and UndefinedBehavior Sanitizers
| * Add CI support for Memory and UndefinedBehavior Sanitizerslhchavez2020-07-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds two new build targets: MSan and UBSan. This is because even though OSS-Fuzz is great and adds a lot of coverage, it only does that for the fuzz targets, so the rest of the codebase is not necessarily run with the Sanitizers ever :( So this change makes sure that MSan/UBSan warnings don't make it into the codebase. As part of this change, the Ubuntu focal container is introduced. It builds mbedTLS and libssh2 as debug libraries into /usr/local and as MSan-enabled libraries into /usr/local/msan. This latter part is needed because MSan requires the binary and all its dependent libraries to be built with MSan support so that memory allocations and deallocations are tracked correctly to avoid false positives.
* | cmake: specify project versionPatrick Steinhardt2020-07-121-0/+9
|/ | | | | | | | | | | | | | | We currently do not set up a project version within CMake, meaning that it can't be use by other projects including libgit2 as a sub-project and also not by other tools like IDEs. This commit changes this to always set up a project version, but instead of extracting it from the "version.h" header we now set it up directly. This is mostly to avoid mis-use of the previous `LIBGIT2_VERSION` variables, as we should now always use the `libgit2_VERSION` ones that are set up by CMake if one provides the "VERSION" keyword to the `project()` call. While this is one more moving target we need to adjust on releases, this commit also adjusts our release script to verify that the project version was incremented as expected.
* release script: fix typoethomson/release_script_typoEdward Thomson2020-06-041-1/+1
|
* feat: Check the version in package.jsonSuhaib Mujahid2020-05-121-0/+11
|
* scripts: add script to create releasesPatrick Steinhardt2020-02-071-0/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* valgrind: add suppressions for undefined useEdward Thomson2019-11-241-0/+20
| | | | | | | 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.
* valgrind: suppress libssh2_rsa_sha1_sign leaksEdward Thomson2019-11-241-0/+9
|
* valgrind: suppress kexinit leaksEdward Thomson2019-11-241-1/+10
|
* valgrind: suppress uninitialized reads in libcryptoEdward Thomson2019-11-231-0/+8
| | | | | libcrypto will read uninitialized memory as entropy. Suppress warnings from this behavior.
* valgrind: suppress memory leaks in libssh2_session_handshakePatrick Steinhardt2019-09-211-0/+20
| | | | | | | | | | 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.
* tests: execute leak checker via CTest directlyPatrick Steinhardt2019-07-203-0/+122
| | | | | | | | | | | | | | | 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.
* errors: update static analysis tools for giterrEdward Thomson2019-01-221-3/+3
| | | | | Update GITERR and giterr usages in the static code analysis tools to use the new names.
* coverity: attempt to model clar's assertionsEtienne Samson2019-01-041-0/+23
| | | | | | 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.
* ci: remove unused old ci scriptsEdward Thomson2018-07-285-150/+0
|
* ci: move travis to the new scriptsEdward Thomson2018-07-281-71/+0
|
* ci: move appveyor to new scriptsEdward Thomson2018-07-271-23/+0
|
* ci: enable leak checking on osxEdward Thomson2018-07-261-0/+2
|
* tests: simplify cmake test configurationEdward Thomson2018-07-261-3/+5
| | | | | | | | | 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.
* travis: enable -Werror in the script instead of using the matrixEtienne Samson2018-06-061-1/+1
|
* scripts: remove extraneous semicolonsEtienne Samson2018-06-063-8/+6
|
* scripts: use leaks on macOSEtienne Samson2018-06-061-0/+2
|
* valgrind: bump num-callers to 50 for fuller stack tracesEtienne Samson2018-06-061-1/+1
|
* travis: let cmake perform the build & install stepEtienne Samson2018-06-061-1/+1
| | | | The goal is to let cmake manage the parallelism
* valgrind: skip buf::oom testEtienne Samson2018-06-061-1/+1
|
* travis: split valgrind check in its own scriptEtienne Samson2018-06-061-0/+13
|
* travis: split testing from buildingEtienne Samson2018-06-062-74/+83
|
* Merge pull request #4173 from tiennou/mbedtlsEdward Thomson2018-04-221-0/+13
|\ | | | | mbedTLS support
| * travis: pass -fPIC when configuring mbedtlsEtienne Samson2018-04-111-1/+2
| |
| * travis: just grab what we need from mbedtlsEtienne Samson2018-04-111-2/+1
| |
| * mbedtls: enable Travis CI testsEtienne Samson2018-04-111-0/+13
| |
* | Merge pull request #4476 from pks-t/pks/backport-scriptEdward Thomson2018-04-171-0/+23
|\ \ | |/ |/| scripts: add backporting script
| * scripts: add backporting scriptPatrick Steinhardt2018-01-121-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | tests: create new test target for all SSH-based testsPatrick Steinhardt2018-01-031-7/+4
| | | | | | | | | | | | | | | | 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.
* | tests: online::clone: inline creds-test with nonexistent URLPatrick Steinhardt2018-01-031-7/+0
| | | | | | | | | | | | | | | | 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.
* | tests: online::clone: construct credential-URL from environmentPatrick Steinhardt2018-01-031-9/+5
|/ | | | | | | | | | | | | 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.
* Merge pull request #4394 from libgit2/cmn/macos-ramdiskEdward Thomson2017-11-061-0/+9
|\ | | | | travis: put clar's sandbox in a ramdisk on macOS
| * travis: let's try a 5GB ramdiskcmn/macos-ramdiskCarlos Martín Nieto2017-10-311-2/+2
| |
| * travis: put clar's sandbox in a ramdisk on macOSCarlos Martín Nieto2017-10-311-0/+9
| | | | | | | | | | 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.
* | appveyor: build examplesPatrick Steinhardt2017-11-061-1/+1
|/ | | | | | | | | | 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.
* travis: add custom apt sourcesethomson/libcurl_buildEdward Thomson2017-10-071-12/+0
| | | | Move back to Travis's VM infrastructure for efficiency.
* travis: only install custom libcurl on trustyEdward Thomson2017-07-241-4/+8
|
* travis: only kill our own sshdEdward Thomson2017-07-241-1/+2
|
* travis: build with patched libcurlEdward Thomson2017-07-241-0/+8
| | | | | | 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.
* travis: cibuild: set up our own sshd serverPatrick Steinhardt2017-06-211-8/+26
| | | | | | | | | | | | | | 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.
* travis: replace use of deprecated homebrew/dupes tapPatrick Steinhardt2017-06-131-1/+1
| | | | | | | | | 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".