Fix use generic/ambiguous DEBUG name
The use of the generic 'DEBUG' name in varialbes or flags can be very problematic and lead to difficult to troubleshoot problems. Update CI VM images to those including updated automation library that uses the `$A_DEBUG` env. var. instaed. Also update other repository files which make use of the generic form. Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
parent
810658f2e8
commit
4cf93e3edc
|
@ -31,7 +31,7 @@ env:
|
|||
PRIOR_FEDORA_NAME: "fedora-35"
|
||||
UBUNTU_NAME: "ubuntu-2204"
|
||||
|
||||
IMAGE_SUFFIX: "c5878804328480768"
|
||||
IMAGE_SUFFIX: "c6193881921355776"
|
||||
FEDORA_CACHE_IMAGE_NAME: "fedora-${IMAGE_SUFFIX}"
|
||||
PRIOR_FEDORA_CACHE_IMAGE_NAME: "prior-fedora-${IMAGE_SUFFIX}"
|
||||
UBUNTU_CACHE_IMAGE_NAME: "ubuntu-${IMAGE_SUFFIX}"
|
||||
|
|
4
Makefile
4
Makefile
|
@ -41,11 +41,11 @@ SOURCES=*.go imagebuildah/*.go bind/*.go chroot/*.go copier/*.go define/*.go doc
|
|||
|
||||
LINTFLAGS ?=
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
ifeq ($(BUILDDEBUG), 1)
|
||||
override GOGCFLAGS += -N -l
|
||||
endif
|
||||
|
||||
# make all DEBUG=1
|
||||
# make all BUILDDEBUG=1
|
||||
# Note: Uses the -N -l go compiler options to disable compiler optimizations
|
||||
# and inlining. Using these build options allows you to subsequently
|
||||
# use source debugging tools like delve.
|
||||
|
|
|
@ -56,7 +56,7 @@ else
|
|||
-e NAME="$USER" \
|
||||
-e SRCDIR=/src \
|
||||
-e GCLOUD_ZONE="$GCLOUD_ZONE" \
|
||||
-e DEBUG="${DEBUG:-0}" \
|
||||
-e A_DEBUG="${A_DEBUG:-0}" \
|
||||
-v $REPO_DIRPATH:/src:O \
|
||||
-v $HOME/.config/gcloud:/root/.config/gcloud:z \
|
||||
-v $HOME/.config/gcloud/ssh:/root/.ssh:z \
|
||||
|
|
|
@ -396,9 +396,9 @@ cat /etc/containers/policy.json
|
|||
|
||||
## Debug with Delve and the like
|
||||
|
||||
To make a source debug build without optimizations use `DEBUG=1`, like:
|
||||
To make a source debug build without optimizations use `BUILDDEBUG=1`, like:
|
||||
```
|
||||
make all DEBUG=1
|
||||
make all BUILDDEBUG=1
|
||||
```
|
||||
|
||||
## Vendoring
|
||||
|
|
|
@ -2634,22 +2634,22 @@ _EOF
|
|||
expect_output --substring "success"
|
||||
expect_output --substring "debug=no" "with no cpp-flag or BUILDAH_CPPFLAGS"
|
||||
|
||||
run_buildah build $WITH_POLICY_JSON -t ${target} --cpp-flag "-DDEBUG" -f $BUDFILES/containerfile/Containerfile.in $BUDFILES/containerfile
|
||||
run_buildah build $WITH_POLICY_JSON -t ${target} --cpp-flag "-DTESTCPPDEBUG" -f $BUDFILES/containerfile/Containerfile.in $BUDFILES/containerfile
|
||||
expect_output --substring "Ignoring In file included .* invalid preprocessing directive #This"
|
||||
expect_output --substring "FROM alpine"
|
||||
expect_output --substring "success"
|
||||
expect_output --substring "debug=yes" "with --cpp-flag -DDEBUG"
|
||||
expect_output --substring "debug=yes" "with --cpp-flag -DTESTCPPDEBUG"
|
||||
}
|
||||
|
||||
@test "bud with Containerfile.in, via envariable" {
|
||||
_prefetch alpine
|
||||
target=alpine-image
|
||||
|
||||
BUILDAH_CPPFLAGS="-DDEBUG" run_buildah build $WITH_POLICY_JSON -t ${target} -f $BUDFILES/containerfile/Containerfile.in $BUDFILES/containerfile
|
||||
BUILDAH_CPPFLAGS="-DTESTCPPDEBUG" run_buildah build $WITH_POLICY_JSON -t ${target} -f $BUDFILES/containerfile/Containerfile.in $BUDFILES/containerfile
|
||||
expect_output --substring "Ignoring In file included .* invalid preprocessing directive #This"
|
||||
expect_output --substring "FROM alpine"
|
||||
expect_output --substring "success"
|
||||
expect_output --substring "debug=yes" "with BUILDAH_CPPFLAGS=-DDEBUG"
|
||||
expect_output --substring "debug=yes" "with BUILDAH_CPPFLAGS=-DTESTCPPDEBUG"
|
||||
}
|
||||
|
||||
@test "bud with Dockerfile" {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# include "Containerfile"
|
||||
RUN echo "success"
|
||||
#if DEBUG
|
||||
#if TESTCPPDEBUG
|
||||
RUN echo "debug=yes"
|
||||
# else
|
||||
RUN echo "debug=no"
|
||||
|
|
Loading…
Reference in New Issue