File tree 4 files changed +27
-7
lines changed
4 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 1
- hack /libgit2 /
1
+ build /libgit2 /
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ ARG GO_VERSION=1.17
3
3
ARG XX_VERSION=1.1.0
4
4
5
5
ARG LIBGIT2_IMG=ghcr.io/fluxcd/golang-with-libgit2
6
- ARG LIBGIT2_TAG=libgit2-1.1.1-6
6
+ ARG LIBGIT2_TAG=libgit2-1.1.1-7
7
7
8
8
FROM ${LIBGIT2_IMG}:${LIBGIT2_TAG} AS libgit2-libs
9
9
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ TAG ?= latest
4
4
5
5
# Base image used to build the Go binary
6
6
LIBGIT2_IMG ?= ghcr.io/fluxcd/golang-with-libgit2
7
- LIBGIT2_TAG ?= libgit2-1.1.1-6
7
+ LIBGIT2_TAG ?= libgit2-1.1.1-7
8
8
9
9
# Allows for defining additional Docker buildx arguments,
10
10
# e.g. '--push'.
@@ -234,13 +234,11 @@ fuzz-build: $(LIBGIT2)
234
234
rm -rf $(shell pwd) /build/fuzz/
235
235
mkdir -p $(shell pwd) /build/fuzz/out/
236
236
237
- # TODO: remove mapping of current libgit2 dir and pull binaries from release or build dependency chain on demand.
238
237
docker build . --tag local-fuzzing:latest -f tests/fuzz/Dockerfile.builder
239
238
docker run --rm \
240
239
-e FUZZING_LANGUAGE=go -e SANITIZER=address \
241
240
-e CIFUZZ_DEBUG='True' -e OSS_FUZZ_PROJECT_NAME=fluxcd \
242
241
-v "$(shell pwd)/build/fuzz/out":/out \
243
- -v "$(shell pwd)/build/libgit2":"/root/go/src/github.com/fluxcd/source-controller/build/libgit2" \
244
242
local-fuzzing:latest
245
243
246
244
fuzz-smoketest : fuzz-build
Original file line number Diff line number Diff line change 16
16
17
17
set -euxo pipefail
18
18
19
- LIBGIT2_TAG=" ${LIBGIT2_TAG:- libgit2-1.1.1-6 } "
19
+ LIBGIT2_TAG=" ${LIBGIT2_TAG:- libgit2-1.1.1-7 } "
20
20
GOPATH=" ${GOPATH:-/ root/ go} "
21
21
GO_SRC=" ${GOPATH} /src"
22
22
PROJECT_PATH=" github.com/fluxcd/source-controller"
@@ -25,9 +25,31 @@ cd "${GO_SRC}"
25
25
26
26
pushd " ${PROJECT_PATH} "
27
27
28
+ export TARGET_DIR=" $( /bin/pwd) /build/libgit2/${LIBGIT2_TAG} "
29
+
30
+ # For most cases, libgit2 will already be present.
31
+ # The exception being at the oss-fuzz integration.
32
+ if [ ! -d " ${TARGET_DIR} " ]; then
33
+ curl -o output.tar.gz -LO " https://github.com/fluxcd/golang-with-libgit2/releases/download/${LIBGIT2_TAG} /linux-$( uname -m) -libs.tar.gz"
34
+
35
+ DIR=libgit2-linux
36
+ NEW_DIR=" $( /bin/pwd) /build/libgit2/${LIBGIT2_TAG} "
37
+ INSTALLED_DIR=" /home/runner/work/golang-with-libgit2/golang-with-libgit2/build/${DIR} "
38
+
39
+ mkdir -p ./build/libgit2
40
+
41
+ tar -xf output.tar.gz
42
+ rm output.tar.gz
43
+ mv " ${DIR} " " ${LIBGIT2_TAG} "
44
+ mv " ${LIBGIT2_TAG} /" " ./build/libgit2"
45
+
46
+ # Update the prefix paths included in the .pc files.
47
+ # This will make it easier to update to the location in which they will be used.
48
+ find " ${NEW_DIR} " -type f -name " *.pc" | xargs -I {} sed -i " s;${INSTALLED_DIR} ;${NEW_DIR} ;g" {}
49
+ fi
50
+
28
51
apt-get update && apt-get install -y pkg-config
29
52
30
- export TARGET_DIR=" $( /bin/pwd) /build/libgit2/${LIBGIT2_TAG} "
31
53
export CGO_ENABLED=1
32
54
export LIBRARY_PATH=" ${TARGET_DIR} /lib:${TARGET_DIR} /lib64"
33
55
export PKG_CONFIG_PATH=" ${TARGET_DIR} /lib/pkgconfig:${TARGET_DIR} /lib64/pkgconfig"
You can’t perform that action at this time.
0 commit comments