Remove macro and tidy up

After enabling support for ppc64le, the package began failing due to the
gopkginstall macro not properly handling the new architecture tag.

Added additional lines to ensure the tests execute, as the macro also
creates several temporary folders.

Resolves: RHEL-39099
This commit is contained in:
Alejandro Sáez 2024-08-22 19:06:19 +02:00
parent 4a0f16f6d7
commit 034e94e7f0

View File

@ -42,8 +42,7 @@ Provides: bundled(golang(github.com/cosiner/argv)) = 0.1.0
Provides: bundled(golang(github.com/cpuguy83/go.md2man/v2)) = 2.0.2 Provides: bundled(golang(github.com/cpuguy83/go.md2man/v2)) = 2.0.2
Provides: bundled(golang(github.com/creack/pty)) = 1.1.20 Provides: bundled(golang(github.com/creack/pty)) = 1.1.20
Provides: bundled(golang(github.com/derekparker/trie)) = 0.0.0.20230829180723.39f4de51ef7d Provides: bundled(golang(github.com/derekparker/trie)) = 0.0.0.20230829180723.39f4de51ef7d
Provides: bundled(golang(github.com/go.delve/gore)) = 0.11.6 Provides: bundled(golang(github.com/go.delve/liner)) = 1.2.3.0.20231231155935.4726ab1d7f62
Provides: bundled(golang(github.com/go.delve/liner)) = 1.2.3.0.20220127212407.d32d89dd2a5d
Provides: bundled(golang(github.com/google/go.dap)) = 0.11.0 Provides: bundled(golang(github.com/google/go.dap)) = 0.11.0
Provides: bundled(golang(github.com/hashicorp/golang.lru)) = 1.0.2 Provides: bundled(golang(github.com/hashicorp/golang.lru)) = 1.0.2
Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = 1.1.0 Provides: bundled(golang(github.com/inconshreveable/mousetrap)) = 1.1.0
@ -55,6 +54,7 @@ Provides: bundled(golang(github.com/russross/blackfriday/v2)) = 2.1.0
Provides: bundled(golang(github.com/sirupsen/logrus)) = 1.9.3 Provides: bundled(golang(github.com/sirupsen/logrus)) = 1.9.3
Provides: bundled(golang(github.com/spf13/cobra)) = 1.7.0 Provides: bundled(golang(github.com/spf13/cobra)) = 1.7.0
Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.5 Provides: bundled(golang(github.com/spf13/pflag)) = 1.0.5
Provides: bundled(golang(github.com/stretchr/testify)) = 1.8.4
Provides: bundled(golang(golang.org/x/arch)) = 0.6.0 Provides: bundled(golang(golang.org/x/arch)) = 0.6.0
Provides: bundled(golang(golang.org/x/exp)) = 0.0.0.20230224173230.c95f2b4c22f2 Provides: bundled(golang(golang.org/x/exp)) = 0.0.0.20230224173230.c95f2b4c22f2
Provides: bundled(golang(golang.org/x/mod)) = 0.14.0 Provides: bundled(golang(golang.org/x/mod)) = 0.14.0
@ -78,12 +78,9 @@ tar c -C vendor/ . | tar x -C %{gobuilddir}/src
%autopatch -v -p1 %autopatch -v -p1
%build %build
echo "=== Start build ===" %gobuild %{?exp} -o %{gobuilddir}/bin/dlv %{goipath}/cmd/dlv
%gobuild -o %{gobuilddir}/bin/dlv %{goipath}/cmd/dlv
echo "=== End build ==="
%install %install
%gopkginstall
install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
@ -92,14 +89,18 @@ install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
export GO111MODULE=off export GO111MODULE=off
export GOPATH=%{buildroot}/%{gopath}:%{gobuilddir}:%{gopath} export GOPATH=%{buildroot}/%{gopath}:%{gobuilddir}:%{gopath}
delvepath=%{buildroot}/%{gopath}/src/%{goipath} delvepath=%{buildroot}/%{gopath}/src/%{goipath}
mkdir -p $delvepath
mkdir -p $delvepath/pkg/dwarf/line
mkdir -p $delvepath/pkg/proc/internal
cp -r _fixtures $delvepath cp -r _fixtures $delvepath
cp -r pkg/dwarf $delvepath/pkg/
cp -r pkg/dwarf/line/_testdata $delvepath/pkg/dwarf/line cp -r pkg/dwarf/line/_testdata $delvepath/pkg/dwarf/line
cp -r pkg/proc/internal/ebpf $delvepath/pkg/proc/internal/ cp -r pkg/proc/internal/ebpf $delvepath/pkg/proc/internal/
pushd $delvepath pushd $delvepath
echo "=== Start tests ===" for d in $(go list %{?exp} ./... | grep -v cmd | grep -v scripts); do
%gotest %{?exp} $(go list ./... | awk '!/(cmd|scripts)/ {print $1}') go test %{?exp} ${d}
echo "=== End tests ===" done
rm -rf $delvepath rm -rf $delvepath
popd popd
%endif %endif