diff options
author | tb <> | 2025-07-09 05:04:35 +0000 |
---|---|---|
committer | tb <> | 2025-07-09 05:04:35 +0000 |
commit | 38e9c2a327865da6134fd3ecc45f8cd025eca3c3 (patch) | |
tree | 48037aa2ed6b081ad16b143df2ebde40fac67ff4 /src | |
parent | 8af288822f71d1181fe2dcead11ee1b2223c499c (diff) | |
download | openbsd-38e9c2a327865da6134fd3ecc45f8cd025eca3c3.tar.gz openbsd-38e9c2a327865da6134fd3ecc45f8cd025eca3c3.tar.bz2 openbsd-38e9c2a327865da6134fd3ecc45f8cd025eca3c3.zip |
libcrypto regress: move GOCACHE to obj/
While it may be acceptable for Go to fill regular users' homedirs with a
compiler cache that is unable to deal with corruption and full disks,
this is terrible for people running regress as root since the cache can
quickly grow to hundreds of megs and can thus result in all sorts hilarity
below /root. Move the GOCACHE under ${.OBJDIR} and use a cleanup target to
get rid of it again. This makes these tests a bit slower for regular users
as well, but so be it. Let's see how this goes before I switch libtls to
the same model.
discussed with claudio and jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/c2sp/Makefile | 11 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/certs/Makefile | 19 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/wycheproof/Makefile | 10 |
3 files changed, 28 insertions, 12 deletions
diff --git a/src/regress/lib/libcrypto/c2sp/Makefile b/src/regress/lib/libcrypto/c2sp/Makefile index d16d06975b..062d83e99c 100644 --- a/src/regress/lib/libcrypto/c2sp/Makefile +++ b/src/regress/lib/libcrypto/c2sp/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.5 2025/04/27 08:51:24 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.6 2025/07/09 05:04:35 tb Exp $ |
2 | 2 | ||
3 | C2SP_TESTVECTORS = /usr/local/share/c2sp-testvectors/ | 3 | C2SP_TESTVECTORS = /usr/local/share/c2sp-testvectors/ |
4 | 4 | ||
@@ -13,7 +13,7 @@ PROGS += cctv | |||
13 | SRCS_cctv = | 13 | SRCS_cctv = |
14 | 14 | ||
15 | cctv: cctv.go | 15 | cctv: cctv.go |
16 | go build -o $@ ${.CURDIR}/cctv.go | 16 | env GOCACHE=${.OBJDIR}/go-build go build -o $@ ${.CURDIR}/cctv.go |
17 | 17 | ||
18 | OSSL_LIB = /usr/local/lib/eopenssl | 18 | OSSL_LIB = /usr/local/lib/eopenssl |
19 | OSSL_INC = /usr/local/include/eopenssl | 19 | OSSL_INC = /usr/local/include/eopenssl |
@@ -29,10 +29,17 @@ CGO_LDFLAGS_$V += -L${OSSL_LIB}$V | |||
29 | 29 | ||
30 | cctv-openssl$V: cctv.go | 30 | cctv-openssl$V: cctv.go |
31 | env CGO_CFLAGS="${CGO_CFLAGS_$V}" CGO_LDFLAGS="${CGO_LDFLAGS_$V}" \ | 31 | env CGO_CFLAGS="${CGO_CFLAGS_$V}" CGO_LDFLAGS="${CGO_LDFLAGS_$V}" \ |
32 | GOCACHE=${.OBJDIR}/go-build \ | ||
32 | go build -o $@ ${.CURDIR}/cctv.go | 33 | go build -o $@ ${.CURDIR}/cctv.go |
33 | . endif | 34 | . endif |
34 | . endfor | 35 | . endfor |
35 | 36 | ||
37 | REGRESS_CLEANUP = clean-go-cache | ||
38 | |||
39 | clean-go-cache: | ||
40 | env GOCACHE=${.OBJDIR}/go-build go clean -cache | ||
41 | rm -rf ${.OBJDIR}/go-build | ||
42 | |||
36 | .endif | 43 | .endif |
37 | 44 | ||
38 | .include <bsd.regress.mk> | 45 | .include <bsd.regress.mk> |
diff --git a/src/regress/lib/libcrypto/certs/Makefile b/src/regress/lib/libcrypto/certs/Makefile index 621c60907f..f7ba9fcad8 100644 --- a/src/regress/lib/libcrypto/certs/Makefile +++ b/src/regress/lib/libcrypto/certs/Makefile | |||
@@ -1,21 +1,24 @@ | |||
1 | # $OpenBSD: Makefile,v 1.1 2020/07/14 18:27:28 jsing Exp $ | 1 | # $OpenBSD: Makefile,v 1.2 2025/07/09 05:04:35 tb Exp $ |
2 | 2 | ||
3 | .if ! (make(clean) || make(cleandir) || make(obj)) | 3 | .if !exists(/usr/local/bin/go) |
4 | GO_VERSION != sh -c "(go version) 2>/dev/null || true" | ||
5 | .endif | ||
6 | |||
7 | .if empty(GO_VERSION) | ||
8 | regress: | 4 | regress: |
9 | @echo package go is required for this regress | 5 | @echo package go is required for this regress |
10 | @echo SKIPPED | 6 | @echo SKIPPED |
11 | .endif | 7 | .else |
12 | 8 | ||
13 | REGRESS_TARGETS=regress-go-verify | 9 | REGRESS_TARGETS=regress-go-verify |
10 | REGRESS_CLEANUP=clean-go-cache | ||
14 | 11 | ||
15 | certs: | 12 | certs: |
16 | cd ${.CURDIR} && sh ./make-certs.sh | 13 | cd ${.CURDIR} && sh ./make-certs.sh |
17 | 14 | ||
18 | regress-go-verify: | 15 | regress-go-verify: |
19 | cd ${.CURDIR} && go test -test.v . | 16 | cd ${.CURDIR} && env GOCACHE=${.OBJDIR}/go-build go test -test.v . |
17 | |||
18 | clean-go-cache: | ||
19 | env GOCACHE=${.OBJDIR}/go-build go clean -cache | ||
20 | rm -rf ${.OBJDIR}/go-build | ||
21 | |||
22 | .endif | ||
20 | 23 | ||
21 | .include <bsd.regress.mk> | 24 | .include <bsd.regress.mk> |
diff --git a/src/regress/lib/libcrypto/wycheproof/Makefile b/src/regress/lib/libcrypto/wycheproof/Makefile index f2f7910b5b..a68a270580 100644 --- a/src/regress/lib/libcrypto/wycheproof/Makefile +++ b/src/regress/lib/libcrypto/wycheproof/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.9 2023/07/08 19:41:07 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.10 2025/07/09 05:04:35 tb Exp $ |
2 | 2 | ||
3 | WYCHEPROOF_TESTVECTORS = /usr/local/share/wycheproof/testvectors/ | 3 | WYCHEPROOF_TESTVECTORS = /usr/local/share/wycheproof/testvectors/ |
4 | 4 | ||
@@ -18,11 +18,17 @@ REGRESS_TARGETS += regress-wycheproof | |||
18 | CLEANFILES += wycheproof | 18 | CLEANFILES += wycheproof |
19 | 19 | ||
20 | wycheproof: wycheproof.go | 20 | wycheproof: wycheproof.go |
21 | go build -o wycheproof ${.CURDIR}/wycheproof.go | 21 | env GOCACHE=${.OBJDIR}/go-build go build -o wycheproof ${.CURDIR}/wycheproof.go |
22 | 22 | ||
23 | regress-wycheproof: wycheproof | 23 | regress-wycheproof: wycheproof |
24 | ./wycheproof | 24 | ./wycheproof |
25 | 25 | ||
26 | REGRESS_CLEANUP = clean-go-cache | ||
27 | |||
28 | clean-go-cache: | ||
29 | env GOCACHE=${.OBJDIR}/go-build go clean -cache | ||
30 | rm -rf ${.OBJDIR}/go-build | ||
31 | |||
26 | . endif | 32 | . endif |
27 | 33 | ||
28 | PROGS += wycheproof-primes | 34 | PROGS += wycheproof-primes |