summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* azure: docker: set up HOME variable to fix Coverity buildspks/coverity-fix-sudoPatrick Steinhardt2020-02-191-1/+1
| | | | | | | | | | | | In commit 01a834066 (azure: docker: fix ARM builds by replacing gosu(1), 2020-02-18), we've switched our entrypoint from gosu(1) to use sudo(1) instead to fix our ARM builds. The switch introduced an incompatibility that now causes our Coverity builds to fail, as the "--preserve-env" switch will also keep HOME at its current value. As a result, Coverity now tries to set up its configuration directory in root's home directory, which it naturally can't write to. Fix the issue by adding the "--set-home" flag to sudo(1).
* Merge pull request #5291 from libgit2/ethomson/0_99v0.99.0maint/v0.99Patrick Steinhardt2020-02-193-23/+347
|\ | | | | Release 0.99
| * version: update the version number to v0.99Edward Thomson2020-02-192-5/+5
| | | | | | | | | | | | This commit also switches our SOVERSION to be "$MAJOR.$MINOR" instead of "$MINOR", only. This is in preparation of v1.0, where the previous scheme would've stopped working in an obvious way.
| * docs: update changelog for v0.99Edward Thomson2020-02-191-18/+342
| | | | | | | | | | | | Give the release a name, "Torschlusspanik" (the fear that time is running out to act). Indeed, the time is running out for changes to be included in v1.0.
* | Merge pull request #5372 from pks-t/pks/release-scriptPatrick Steinhardt2020-02-192-0/+175
|\ \ | |/ |/| Release script
| * 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.
| * editorconfig: special-case Python scriptsPatrick Steinhardt2020-02-071-0/+4
| | | | | | | | | | | | | | | | | | | | Python's PEP 8 specifies that one shall use spaces instead of tabs as coding style, and we actually honor that currently. Our EditorConfig does not special-case Python scripts, though, which is why we end up with our C coding style and thus with tabs. Special-case "*.py" files to override that default with spaces to fix this.
* | Merge pull request #5406 from libgit2/pks/azure-fix-arm32Edward Thomson2020-02-186-42/+19
|\ \ | | | | | | azure: fix ARM32 builds by replacing gosu(1)
| * | tests: object: decrease number of concurrent cache accessesPatrick Steinhardt2020-02-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | In our test case object::cache::fast_thread_rush, we're creating 100 concurrent threads opening a repository and reading objects from it. This test actually fails on ARM32 with an out-of-memory error, which isn't entirely unexpected. Work around the issue by halving the number of threads.
| * | azure: docker: fix ARM builds by replacing gosu(1)pks/azure-fix-arm32Patrick Steinhardt2020-02-183-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our nightly builds are currently failing due to our ARM-based jobs. These jobs crash immediately when entering the Docker container with a exception thrown by Go's language runtime. As we're able to successfully builds the Docker images in previous steps, it's unlikely to be a bug in Docker itself. Instead, this exception is thrown by gosu(1), which is a Go-based utility to drop privileges and run by our entrypoint. Fix the issue by dropping gosu(1) in favor of sudo(1).
| * | azure: docker: synchronize Xenial/Bionic build instructionsPatrick Steinhardt2020-02-182-4/+8
| | | | | | | | | | | | | | | | | | Our two Docker build instructions for Xenial and Bionic have diverged a bit. Let's re-synchronize them with each other to make them as similar as possible.
| * | azure: docker: detect errors when building imagesPatrick Steinhardt2020-02-181-3/+3
| | | | | | | | | | | | | | | | | | The build step for our Docker images currently succeeds even if building the Docker image fails due to missing && chains in the build script. Fix this by adding them in.
| * | azure: remove unused Linux setup scriptPatrick Steinhardt2020-02-181-27/+0
| | | | | | | | | | | | | | | | | | Since migrating to Docker containings for our build and test infrastructure, we do not use the "setup-linux.sh" script anymore. Remove it to avoid any confusion.
* | | Merge pull request #5398 from libgit2/pks/valgrind-opensslPatrick Steinhardt2020-02-184-31/+61
|\ \ \ | | | | | | | | openssl: fix Valgrind issues in nightly builds
| * | | streams: openssl: switch approach to silence Valgrind errorspks/valgrind-opensslPatrick Steinhardt2020-02-111-21/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As OpenSSL loves using uninitialized bytes as another source of entropy, we need to mark them as defined so that Valgrind won't complain about use of these bytes. Traditionally, we've been using the macro `VALGRIND_MAKE_MEM_DEFINED` provided by Valgrind, but starting with OpenSSL 1.1 the code doesn't compile anymore due to `struct SSL` having become opaque. As such, we also can't set it as defined anymore, as we have no way of knowing its size. Let's change gears instead by just swapping out the allocator functions of OpenSSL with our own ones. The twist is that instead of calling `malloc`, we just call `calloc` to have the bytes initialized automatically. Next to soothing Valgrind, this approach has the benefit of being completely agnostic of the memory sanitizer and is neatly contained at a single place. Note that we shouldn't do this for non-Valgrind builds. As we cannot set up memory functions for a given SSL context, only, we need to swap them at a global context. Furthermore, as it's possible to call `OPENSSL_set_mem_functions` once only, we'd prevent users of libgit2 to set up their own allocators.
| * | | cmake: consolidate Valgrind optionPatrick Steinhardt2020-02-113-10/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL doesn't initialize bytes on purpose in order to generate additional entropy. Valgrind isn't too happy about that though, causing it to generate warninings about various issues regarding use of uninitialized bytes. We traditionally had some infrastructure to silence these errors in our OpenSSL stream implementation, where we invoke the Valgrind macro `VALGRIND_MAKE_MEMDEFINED` in various callbacks that we provide to OpenSSL. Naturally, we only include these instructions if a preprocessor define "VALGRIND" is set, and that in turn is only set if passing "-DVALGRIND" to CMake. We do that in our usual Azure pipelines, but we in fact forgot to do this in our nightly build. As a result, we get a slew of warnings for these nightly builds, but not for our normal builds. To fix this, we could just add "-DVALGRIND" to our nightly builds. But starting with commit d827b11b6 (tests: execute leak checker via CTest directly, 2019-06-28), we do have a secondary variable that directs whether we want to use memory sanitizers for our builds. As such, every user wishing to use Valgrind for our tests needs to pass both options "VALGRIND" and "USE_LEAK_CHECKER", which is cumbersome and error prone, as can be seen by our own builds. Instead, let's consolidate this into a single option, removing the old "-DVALGRIND" one. Instead, let's just add the preprocessor directive if USE_LEAK_CHECKER equals "valgrind" and remove "-DVALGRIND" from our own pipelines.
* | | Merge pull request #5400 from lhchavez/fix-packfile-fuzzerPatrick Steinhardt2020-02-181-6/+7
|\ \ \ | |/ / |/| | fuzzers: Fix the documentation
| * | fuzzers: Fix the documentationlhchavez2020-02-151-6/+7
|/ / | | | | | | Some of the commands are now out of date.
* | Merge pull request #5392 from pks-t/pks/ci-warningsEdward Thomson2020-02-084-16/+13
|\ \ | | | | | | azure: fix misleading messages printed to stderr being
| * | azure: test: silence termination message when killing git-daemon(1)Patrick Steinhardt2020-02-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to properly tear down the test environment, we will kill git-daemon(1) if we've exercised it. As git-daemon(1) is spawned as a background process, it is still owned by the shell and thus killing it later on will print a termination message to the shell's stderr, causing Azure to report it as an error. Fix this by disowning the background process.
| * | azure: docker: avoid re-creating libgit2 home directoryPatrick Steinhardt2020-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Docker entrypoint currently creates the libgit2 user with "useradd --create-home". As we start the Docker container with two volumes pointing into "/home/libgit2/", the home directory will already exist. While useradd(1) copes with this just fine, it will print error messages to stderr which end up as failures in our Azure pipelines. Fix this by simply removing the "--create-home" parameter.
| * | azure: test: silence curl to not cause Azure to tropPatrick Steinhardt2020-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | | Without the "--silent" parameter, curl will print a progress meter to stderr. Azure has the nice feature of interpreting any output to stderr as errors with a big red warning towards the end of the build. Let's thus silence curl to not generate any misleading messages.
| * | azure: docker: pipe downloaded archives into tar(1) directlyPatrick Steinhardt2020-02-072-12/+8
| |/ | | | | | | | | | | | | | | | | When building dependencies for our Docker images, we first download the sources to disk first, unpack them and finally remove the archive again. This can be sped up by piping the downloading archive into tar(1) directly to parallelize both tasks. Furthermore, let's silence curl(1) to not print to status information to stderr, which tends to be interpreted as errors by Azure Pipelines.
* | Merge pull request #5393 from pks-t/pks/tests-iterator-missing-refEdward Thomson2020-02-081-9/+9
|\ \ | |/ |/| tests: iterator: fix iterator expecting too few items
| * tests: iterator: fix iterator expecting too few itemsPatrick Steinhardt2020-02-071-9/+9
|/ | | | | | | | | | | The testcase iterator::workdir::filesystem_gunk sets up quite a lot of directories, which is why it only runs in case GITTEST_INVASIVE_SPEED is set in the environment. Because we do not run our default CI with this variable, we didn't notice commit 852c83ee4 (refs: refuse to delete HEAD, 2020-01-15) breaking the test as it introduced a new reference to the "testrepo" repository. Fix the oversight by increasing the number of expected iterator items.
* Merge pull request #5387 from pks-t/pks/transport-http-custom-headersPatrick Steinhardt2020-02-072-0/+16
|\ | | | | transports: http: fix custom headers not being applied
| * transports: http: fix custom headers not being appliedPatrick Steinhardt2020-02-072-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit b9c5b15a7 (http: use the new httpclient, 2019-12-22), the HTTP code got refactored to extract a generic HTTP client that operates independently of the Git protocol. Part of refactoring was the creation of a new `git_http_request` struct that encapsulates the generation of requests. Our Git-specific HTTP transport was converted to use that in `generate_request`, but during the process we forgot to set up custom headers for the `git_http_request` and as a result we do not send out these headers anymore. Fix the issue by correctly setting up the request's custom headers and add a test to verify we correctly send them.
* | Merge pull request #5382 from libgit2/pks/azure-coverityPatrick Steinhardt2020-02-074-93/+69
|\ \ | |/ |/| azure: fix Coverity pipeline
| * azure: coverity: fix Coverity builds due to various issuesPatrick Steinhardt2020-02-074-90/+64
| | | | | | | | | | There's several issues with our Coverity builds, like e.g. missing wget in our containers. Simplify our Coverity pipeline and fix these issues.
| * azure: coverity: convert to use self-built containersPatrick Steinhardt2020-02-071-1/+5
| | | | | | | | | | | | | | Back in commit 5a6740e7f (azure: build Docker images as part of the pipeline, 2019-08-02), we have converted our pipelines to use self-built Docker images to ease making changes to our Dockerfiles. The commit didn't adjust our Coverity pipeline, though, so let's do this now.
| * azure: coverity: fix invalid syntax for Docker imagePatrick Steinhardt2020-02-071-3/+1
|/ | | | | | | | In commit bbc0b20bd (azure: fix Coverity's build due to wrong container name, 2019-08-02), Coverity builds were fixed to use the correct container names. Unfortunately, the "fix" completely broke our Coverity builds due to using wrong syntax for the Docker task. Let's fix this by using "imageName" instead of the Docker dict.
* Merge pull request #5381 from pks-t/pks/tests-flaky-proxyPatrick Steinhardt2020-02-061-0/+3
|\ | | | | azure: tests: re-run flaky proxy tests
| * azure: tests: reset FAILED status if flaky re-run succeedsPatrick Steinhardt2020-02-041-0/+1
| | | | | | | | | | | | | | | | While we already do have logic to re-run flaky tests, the FAILED variable currently does not get reset to "0". As a result, successful reruns will still cause the test to be registered as failed. Fix this by resetting the variable accordingly.
| * azure: tests: re-run flaky proxy testsPatrick Steinhardt2020-02-041-0/+2
| | | | | | | | | | | | The proxy tests regularly fail in our CI environment. Unfortunately, this is expected due to the network layer. Thus, let's re-try the proxy tests up to five times in case they fail.
* | Merge pull request #5373 from pks-t/pks/fetchhead-strip-credsEdward Thomson2020-02-013-4/+71
|\ \ | |/ |/| fetchhead: strip credentials from remote URL
| * fetchhead: strip credentials from remote URLPatrick Steinhardt2020-01-313-4/+71
|/ | | | | | | | | | | | | | | | | | | | If fetching from an anonymous remote via its URL, then the URL gets written into the FETCH_HEAD reference. This is mainly done to give valuable context to some commands, like for example git-merge(1), which will put the URL into the generated MERGE_MSG. As a result, what gets written into FETCH_HEAD may become public in some cases. This is especially important considering that URLs may contain credentials, e.g. when cloning 'https://foo:bar@example.com/repo' we persist the complete URL into FETCH_HEAD and put it without any kind of sanitization into the MERGE_MSG. This is obviously bad, as your login data has now just leaked as soon as you do git-push(1). When writing the URL into FETCH_HEAD, upstream git does strip credentials first. Let's do the same by trying to parse the remote URL as a "real" URL, removing any credentials and then re-formatting the URL. In case this fails, e.g. when it's a file path or not a valid URL, we just fall back to using the URL as-is without any sanitization. Add tests to verify our behaviour.
* Merge pull request #5375 from pks-t/pks/test-ciEdward Thomson2020-01-311-5/+5
|\ | | | | azure-pipelines: properly expand negotiate passwords
| * azure-pipelines: properly expand negotiate passwordsPatrick Steinhardt2020-01-311-5/+5
|/ | | | | | | | | | | | | | | | | | | To allow testing against a Kerberos instance, we have added variables for the Kerberos password to allow authentication against LIBGIT2.ORG in commit e5fb5fe5a (ci: perform SPNEGO tests, 2019-10-20). To set up the password, we assign "GITTEST_NEGOTIATE_PASSWORD=$(GITTEST_NEGOTIATE_PASSWORD)" in the environmentVariables section which is then passed through to a template. As the template does build-time expansion of the environment variables, it will expand the above line verbosely, and due to the envVar section not doing any further expansion the password variable will end up with the value "$(GITTEST_NEGOTIATE_PASSWORD)" in the container's environment. Fix this fixed by doing expansion of GITTEST_NEGOTIATE_PASSWORD at build-time, as well.
* Merge pull request #5336 from libgit2/ethomson/credtypePatrick Steinhardt2020-01-3032-761/+966
|\ | | | | cred: change enum to git_credential_t and GIT_CREDENTIAL_*
| * credential: change git_cred to git_credentialethomson/credtypeEdward Thomson2020-01-2632-761/+966
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We avoid abbreviations where possible; rename git_cred to git_credential. In addition, we have standardized on a trailing `_t` for enum types, instead of using "type" in the name. So `git_credtype_t` has become `git_credential_t` and its members have become `GIT_CREDENTIAL` instead of `GIT_CREDTYPE`. Finally, the source and header files have been renamed to `credential` instead of `cred`. Keep previous name and values as deprecated, and include the new header files from the previous ones.
* | Merge pull request #5371 from ayush-1506/julia_linkPatrick Steinhardt2020-01-301-1/+1
|\ \ | | | | | | Update link to libgit2 Julia language binding
| * | Update link to Julia libgit2ayush-15062020-01-301-1/+1
|/ /
* | Merge pull request #5365 from libgit2/ethomson/no_voidEdward Thomson2020-01-2420-56/+132
|\ \ | |/ |/| Return int from non-free functions
| * git_libgit2_version: return an intethomson/no_voidEdward Thomson2020-01-242-2/+5
| | | | | | | | | | Stop returning a void for functions, future-proofing them to allow them to fail.
| * error functions: return an intEdward Thomson2020-01-242-6/+13
| | | | | | | | | | Stop returning a void for functions, future-proofing them to allow them to fail.
| * revwalk functions: return an intEdward Thomson2020-01-242-6/+15
| | | | | | | | | | Stop returning a void for functions, future-proofing them to allow them to fail.
| * mempack functions: return an intEdward Thomson2020-01-242-2/+5
| | | | | | | | | | Stop returning a void for functions, future-proofing them to allow them to fail.
| * repository functions: return an intEdward Thomson2020-01-242-10/+23
| | | | | | | | | | Stop returning a void for functions, future-proofing them to allow them to fail.
| * index functions: return an intEdward Thomson2020-01-242-8/+21
| | | | | | | | | | Stop returning a void for functions, future-proofing them to allow them to fail.
| * remote functions: return an intEdward Thomson2020-01-242-4/+10
| | | | | | | | | | Stop returning a void for functions, future-proofing them to allow them to fail.