Bug 2102388 - Review Request: delve - Delve is a debugger for the Go programming language
Summary: Review Request: delve - Delve is a debugger for the Go programming language
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2102280 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-29 20:18 UTC by Alejandro Sáez Morollón
Modified: 2023-03-30 08:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-03-30 08:12:15 UTC
Type: ---
Embargoed:
asn: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 5583255 to 5695433 (3.51 KB, patch)
2023-03-22 17:19 UTC, Jakub Kadlčík
no flags Details | Diff

Description Alejandro Sáez Morollón 2022-06-29 20:18:26 UTC
Spec URL: https://src.fedoraproject.org/fork/alexsaezm/rpms/delve/raw/rawhide/f/delve.spec
SRPM URL: https://alexsaezm.fedorapeople.org/rpms/delve/delve-1.8.3-1.fc37.src.rpm
Description: Delve is a debugger for the Go programming language. The goal of the project is to provide a simple, full featured debugging tool for Go. Delve should be easy to invoke and easy to use. Chances are if you're using a debugger, things aren't going your way. With that in mind, Delve should stay out of your way as much as possible.
Fedora Account System Username: alexsaezm

Comment 1 Alejandro Sáez Morollón 2022-06-29 20:21:33 UTC
This is retired package that the Go SIG is interested in claim back.

Currently this package depends on this other other two reviews:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2102385
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2098379

FYI: There's a working version in this COPR repository
https://copr.fedorainfracloud.org/coprs/alexsaezm/delve/builds/

Comment 2 Robert-André Mauchin 🐧 2022-06-29 20:51:37 UTC
Patch1: ./disable-default-compression-dwz-test.patch
Patch2: ./integration-test-symlinks.patch
Patch3: ./clean-empty-doc.patch
Patch4: ./update-testStarlarkVariable.patch

Why the ./ ?

Also these patches are not applied, is this intended?

Comment 3 Robert-André Mauchin 🐧 2022-06-29 20:55:20 UTC
Don't:

# Currently Delve only supports x86_64
ExcludeArch:    ppc64le
ExcludeArch:    s390x
ExcludeArch:    aarch64
ExcludeArch:    i686
ExcludeArch:    armv7hl

instead redefine golang_arches to only include x86_64

%global golang_arches x86_64

This is not like an exclusion because the package temporarily does not work on an arch, it is because the software only support x86_64, so use ExclusiveArches (here we redefine golang_arches because it is included by the Golang macros automatically).

Comment 4 Alejandro Sáez Morollón 2022-06-29 21:14:30 UTC
Thanks for the notes. Those were legacy things I did when I started and totally forgot to remove them.
I updated the links.

Comment 5 Robert-André Mauchin 🐧 2022-06-29 21:20:45 UTC
Forgot one thing:

it should look like this with %goprep:

%build
%gobuild -o %{gobuilddir}/bin/dlv %{goipath}/cmd/dlv

%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

Goprep prepares the gobuildir directory to receive the build. _bin stuff was the previous method.

Comment 6 Robert-André Mauchin 🐧 2022-06-29 21:23:51 UTC
Wait there's more:

You need to use 

%description
%{common_description}

%gopkg   <------

%prep
%goprep


no self defined devel package.

Similarly the %files for devel shouldn't be defined manually but use instead:

%license LICENSE
%doc CONTRIBUTING.md CHANGELOG.md
%doc Documentation/*
%{_bindir}/*

%gopkgfiles

Comment 7 Alejandro Sáez Morollón 2022-06-30 06:50:24 UTC
Links updated, thanks a lot for the tips!

FYI: I think I just found an issue in a dependency in aarch64. I'll debug it. x86_64 works fine for now.

Comment 8 Mark E. Fuller 2022-06-30 10:22:05 UTC
*** Bug 2102280 has been marked as a duplicate of this bug. ***

Comment 9 Alejandro Sáez Morollón 2022-06-30 11:02:12 UTC
FYI: There's a problem with starlark, delve uses an old version of this and the newer version that we have in Fedora breaks tests.
I'm working on this.

Comment 10 Alejandro Sáez Morollón 2022-06-30 13:46:44 UTC
(In reply to Alejandro Sáez Morollón from comment #9)
> FYI: There's a problem with starlark, delve uses an old version of this and
> the newer version that we have in Fedora breaks tests.
> I'm working on this.

I opened an issue to be sure that patching it is ok.
https://github.com/go-delve/delve/issues/3048

Comment 11 Robert-André Mauchin 🐧 2022-06-30 16:57:59 UTC
# Currently Delve only supports x86_64
%global golang_arches x86_64 aarch64

needs to be higher up in the spec. Macros define ExclusiveArch: just below Version, so it needs to be above.

Comment 12 Mark E. Fuller 2022-07-06 20:22:14 UTC
Also v1.9.0 has just been released: https://github.com/go-delve/delve/releases/tag/v1.9.0

Comment 13 Alejandro Sáez Morollón 2022-07-07 11:47:51 UTC
Spec URL: https://src.fedoraproject.org/fork/alexsaezm/rpms/delve/raw/rawhide/f/delve.spec
SRPM URL: https://alexsaezm.fedorapeople.org/rpms/delve/delve-1.9.0-2.fc37.src.rpm
Description: Delve is a debugger for the Go programming language. The goal of the project is to provide a simple, full featured debugging tool for Go. Delve should be easy to invoke and easy to use. Chances are if you're using a debugger, things aren't going your way. With that in mind, Delve should stay out of your way as much as possible.
Fedora Account System Username: alexsaezm

Comment 14 Alejandro Sáez Morollón 2022-07-07 12:13:50 UTC
(In reply to Alejandro Sáez Morollón from comment #13)
> Spec URL:
> https://src.fedoraproject.org/fork/alexsaezm/rpms/delve/raw/rawhide/f/delve.
> spec
> SRPM URL:
> https://alexsaezm.fedorapeople.org/rpms/delve/delve-1.9.0-2.fc37.src.rpm
> Description: Delve is a debugger for the Go programming language. The goal
> of the project is to provide a simple, full featured debugging tool for Go.
> Delve should be easy to invoke and easy to use. Chances are if you're using
> a debugger, things aren't going your way. With that in mind, Delve should
> stay out of your way as much as possible.
> Fedora Account System Username: alexsaezm

Apart from bumping the version to the newest 1.9.0 I also converted it to rpmautospec and run reviews on COPR
https://copr.fedorainfracloud.org/coprs/alexsaezm/delve/build/4604955/

Comment 15 Alejandro Sáez Morollón 2022-12-20 12:51:39 UTC
Spec URL: https://src.fedoraproject.org/fork/alexsaezm/rpms/delve/raw/rawhide/f/delve.spec
SRPM URL: https://alexsaezm.fedorapeople.org/rpms/delve/delve-1.20.1-1.fc38.src.rpm
Description: Delve is a debugger for the Go programming language. The goal of the project is to provide a simple, full featured debugging tool for Go. Delve should be easy to invoke and easy to use. Chances are if you're using a debugger, things aren't going your way. With that in mind, Delve should stay out of your way as much as possible.
Fedora Account System Username: alexsaezm

Comment 16 Alejandro Sáez Morollón 2022-12-20 13:41:22 UTC
I updated it to 1.20.1 (the latest version, published few days ago). Can you review it?

Comment 17 Package Review 2023-01-20 00:45:24 UTC
This is an automatic action taken by review-stats script.

The ticket reviewer failed to clear the NEEDINFO flag in a month.
As per https://fedoraproject.org/wiki/Policy_for_stalled_package_reviews
we reset the status and the assignee of this ticket.

Comment 18 Alejandro Sáez Morollón 2023-02-02 11:17:06 UTC
COPR repository with the latest version of Delve built for aarch64 and x86_64 for Fedora 36, 37, and Rawhide in case someone wants to review the package:

https://copr.fedorainfracloud.org/coprs/alexsaezm/delve/build/5390903/

Comment 19 Andreas Schneider 2023-02-21 16:47:10 UTC
I was looking for this and couldn't find it. I will do the review.

Comment 20 Andreas Schneider 2023-02-21 16:51:35 UTC
In the %files section, can you please list the file instead of globbing?

%{_bindir}/*

This should be avoided to not pick somthing up which isn't wanted. Thanks.

Comment 21 Andreas Schneider 2023-02-21 17:04:44 UTC
Reading https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/

I think the Name: should be %{goname}

And the spec name should follow that?

Comment 22 Andreas Schneider 2023-02-22 08:23:28 UTC
In the %check section:

delvepath=%{buildroot}/%{gopath}/src/%{goipath}
cp -r _fixtures $delvepath
cp -r pkg/dwarf/line/_testdata $delvepath/pkg/dwarf/line
pushd $delvepath
for d in $(go list ./... | grep -v cmd | grep -v scripts); do
    %gotest ${d}
done
rm -rf $delvepath/_fixtures
rm -rf $delvepath/pkg/dwarf/line/_testdata


You do 'cp -r' I think we could just create a symlink to the directory?

Comment 23 Alejandro Sáez Morollón 2023-03-01 16:31:43 UTC
Thanks for taking the review. I changed the %{_bindir}/* to %{_bindir}/dlv.

Regarding the name, as we discussed through chat, delve is a well-known app so it doesn't need to follow the go naming conventions: https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/#_naming

Regarding the symlink, the test suite behaves in an unexpected way on ARM if I use symlinks making several tests fail, hence the cp.

Comment 25 Andreas Schneider 2023-03-05 16:01:26 UTC
Looking at the build.log from a fedora-review run, it doesn't look like tests are being executed:

Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.pzbvFD
+ umask 022
+ cd /builddir/build/BUILD
+ cd delve-1.20.1
+ export GO111MODULE=off
+ GO111MODULE=off
+ export GOPATH=/builddir/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64//usr/share/gocode:/usr/share/gocode
+ GOPATH=/builddir/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64//usr/share/gocode:/usr/share/gocode
+ delvepath=/builddir/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64//usr/share/gocode/src/github.com/go-delve/delve
+ cp -r _fixtures /builddir/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64//usr/share/gocode/src/github.com/go-delve/delve
+ cp -r pkg/dwarf/line/_testdata /builddir/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64//usr/share/gocode/src/github.com/go-delve/delve/pkg/dwarf/line
+ pushd /builddir/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64//usr/share/gocode/src/github.com/go-delve/delve
~/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64/usr/share/gocode/src/github.com/go-delve/delve ~/build/BUILD/delve-1.20.1
++ go list ./...
++ grep -v cmd
++ grep -v scripts
pkg/proc/internal/ebpf/trace_bpfel_x86.go:125:12: pattern trace_bpfel_x86.o: no matching files found
+ rm -rf /builddir/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64//usr/share/gocode/src/github.com/go-delve/delve/_fixtures
+ rm -rf /builddir/build/BUILDROOT/delve-1.20.1-2.fc39.x86_64//usr/share/gocode/src/github.com/go-delve/delve/pkg/dwarf/line/_testdata
+ popd


The only indicator is that there is an error from a test, however the error doesn't make %check fail!


$ go test -count=1 github.com/go-delve/delve/pkg/proc/internal/ebpf
pkg/proc/internal/ebpf/trace_bpfel_x86.go:125:12: pattern trace_bpfel_x86.o: no matching files found
$ echo $?
1

(The test fails because trace_bpfel_x86.o isn't copied over.)

The loops seems to be problematic here! It hides the exit code of the test. However we could just run it once with:

go list ./... | awk '!/(cmd|scripts)/ {print $1}' | xargs %{gotest}

Comment 27 Jakub Kadlčík 2023-03-22 17:19:14 UTC
Created attachment 1952874 [details]
The .spec file difference from Copr build 5583255 to 5695433

Comment 28 Andreas Schneider 2023-03-24 14:50:31 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- If your application is a C or C++ application you must list a
  BuildRequires against gcc, gcc-c++ or clang.
  Note: No gcc, gcc-c++ or clang found in BuildRequires
  See: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/
- Package does not use a name that already exists.
  Note: A package with this name already exists. Please check
  https://src.fedoraproject.org/rpms/delve
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/Naming/#_conflicting_package_names


===== MUST items =====

C/C++:
[-]: Provides: bundled(gnulib) in place as required.
     Note: Sources not installed
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: There is no build directory. Running licensecheck on vanilla
     upstream sources. No licenses found. Please check the source files for
     licenses manually.
[x]: License file installed when any subpackage combination is installed.
[x]: Package does not own files or directories owned by other packages.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[x]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[-]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 225280 bytes in 39 files.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[-]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[x]: Fully versioned dependency in subpackages if applicable.
     Note: No Requires: %{name}%{?_isa} = %{version}-%{release} in golang-
     github-delve-devel
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[!]: Spec file according to URL is the same as in SRPM.
 x   Note: Spec file as given by url is not the same as in SRPM (see
     attached diff).
     See: (this test has no URL)
[x]: Rpmlint is run on debuginfo package(s).
     Note: No rpmlint messages.
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.


Note You need to log in before you can comment on or make changes to this bug.