Bug 2293636 - Review Request: golang-github-nvidia-nvml - Go Bindings for the NVIDIA Management Library (NVML)
Summary: Review Request: golang-github-nvidia-nvml - Go Bindings for the NVIDIA Manage...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Mikel Olasagasti Uranga
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2294109
TreeView+ depends on / blocked
 
Reported: 2024-06-21 13:22 UTC by Debarshi Ray
Modified: 2024-07-11 01:22 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-07-02 15:51:07 UTC
Type: ---
Embargoed:
mikel: fedora-review+


Attachments (Terms of Use)
The .spec file difference from Copr build 7646718 to 7662267 (490 bytes, patch)
2024-06-24 19:47 UTC, Fedora Review Service
no flags Details | Diff

Description Debarshi Ray 2024-06-21 13:22:32 UTC
Spec URL: https://rishi.fedorapeople.org/golang-github-nvidia-nvml.spec
SRPM URL: https://rishi.fedorapeople.org/golang-github-nvidia-nvml-0-1.20240620gitv0.12.4.0.fc38.src.rpm

Description:

Go Bindings for the NVIDIA Management Library (NVML).

This package contains the source code needed for building packages that
reference the following Go import paths:
 – github.com/NVIDIA/go-nvml

Fedora Account System Username: rishi

Comment 1 Debarshi Ray 2024-06-21 13:27:56 UTC
I chose to disable the tests by default because a few of them require the presence of the proprietary NVIDIA driver.

This is my first attempt at packaging a Go module.  Here are some doubts that I have about it.

The Git tags and versions used by upstream (eg., v0.12.4-0) are not valid RPM versions because they contain a dash.  That's why I chose to define '%tag' and left the %version as 0.

The generated Provides don't have 'golang(github.com/NVIDIA/go-nvml)'.  I hope that's alright because the top-level source directory doesn't have any Go sources.  So, users of this module need to import the sub-paths.

Comment 2 Fedora Review Service 2024-06-21 13:33:21 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/7646718
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2293636-golang-github-nvidia-nvml/fedora-rawhide-x86_64/07646718-golang-github-nvidia-nvml/fedora-review/review.txt

Found issues:

- No gcc, gcc-c++ or clang found in BuildRequires
  Read more: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/

Please know that there can be false-positives.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 3 Mikel Olasagasti Uranga 2024-06-24 13:30:37 UTC
> I chose to disable the tests by default because a few of them require the presence of the proprietary NVIDIA driver.

Can add this as a comment before the bcond_with?

> The Git tags and versions used by upstream (eg., v0.12.4-0) are not valid RPM versions because they contain a dash.  That's why I chose to define '%tag' and left the %version as 0.

What a strange way to version the package. One option would be to use:

Version:                0.12.4.0
%global tag             v0.12.4-0

WDYT? You'll need to generate the package with `go2rpm -q github.com/NVIDIA/go-nvml -t v0.12.4-0` and modify the Version entry.

> The generated Provides don't have 'golang(github.com/NVIDIA/go-nvml)'.  I hope that's alright because the top-level source directory doesn't have any Go sources.  So, users of this module need to import the sub-paths.

It's correct and not an issue. If you check the example in the README file you'll see they're not using top-level dir, but the whole path as expected: https://github.com/NVIDIA/go-nvml/blob/main/README.md?plain=1#L59

On top of these changes, would it be possible to update to latest go2rpm (1.12.0) package?

Comment 4 Debarshi Ray 2024-06-24 19:19:51 UTC
(In reply to Debarshi Ray from comment #1)
> The Git tags and versions used by upstream (eg., v0.12.4-0) are not valid
> RPM versions because they contain a dash.  That's why I chose to define
> '%tag' and left the %version as 0.

I filed an upstream request about not using a hyphen or dash in the Git tag:
https://github.com/NVIDIA/go-nvml/issues/126

Comment 5 Debarshi Ray 2024-06-24 19:41:55 UTC
Thanks for the review!

(In reply to Mikel Olasagasti Uranga from comment #3)
> > I chose to disable the tests by default because a few of them require the presence of the proprietary NVIDIA driver.
> 
> Can add this as a comment before the bcond_with?

Sure.  Added.
 
> > The Git tags and versions used by upstream (eg., v0.12.4-0) are not valid RPM versions because they contain a dash.  That's why I chose to define '%tag' and left the %version as 0.
> 
> What a strange way to version the package. One option would be to use:
> 
> Version:                0.12.4.0
> %global tag             v0.12.4-0
> 
> WDYT? You'll need to generate the package with `go2rpm -q
> github.com/NVIDIA/go-nvml -t v0.12.4-0` and modify the Version entry.

Okay!  That definitely makes the RPM's version a lot saner.  Thanks for the tip.  :)

> > The generated Provides don't have 'golang(github.com/NVIDIA/go-nvml)'.  I hope that's alright because the top-level source directory doesn't have any Go sources.  So, users of this module need to import the sub-paths.
> 
> It's correct and not an issue. If you check the example in the README file
> you'll see they're not using top-level dir, but the whole path as expected:
> https://github.com/NVIDIA/go-nvml/blob/main/README.md?plain=1#L59

Okay.
 
> On top of these changes, would it be possible to update to latest go2rpm
> (1.12.0) package?

For some reason, running go2rpm inside my Fedora 40 Toolbx container is erroring out with a Python traceback that seems to be due to 'git config user.name' finishing with exit code 1, even though I have:
$ env | grep GIT
GIT_COMMITTER_NAME=Debarshi Ray
GIT_AUTHOR_EMAIL=rishi
GIT_COMMITTER_EMAIL=rishi
GIT_AUTHOR_NAME=Debarshi Ray

I will dig into it.

Meanwhile, I have uploaded the other changes:

Spec URL: https://rishi.fedorapeople.org/golang-github-nvidia-nvml.spec
SRPM URL: https://rishi.fedorapeople.org/golang-github-nvidia-nvml-0.12.4.0-1.fc38.src.rpm

Comment 6 Fedora Review Service 2024-06-24 19:47:19 UTC
Created attachment 2038185 [details]
The .spec file difference from Copr build 7646718 to 7662267

Comment 7 Fedora Review Service 2024-06-24 19:47:21 UTC
Copr build:
https://copr.fedorainfracloud.org/coprs/build/7662267
(succeeded)

Review template:
https://download.copr.fedorainfracloud.org/results/@fedora-review/fedora-review-2293636-golang-github-nvidia-nvml/fedora-rawhide-x86_64/07662267-golang-github-nvidia-nvml/fedora-review/review.txt

Found issues:

- No gcc, gcc-c++ or clang found in BuildRequires
  Read more: https://docs.fedoraproject.org/en-US/packaging-guidelines/C_and_C++/

Please know that there can be false-positives.

---
This comment was created by the fedora-review-service
https://github.com/FrostyX/fedora-review-service

If you want to trigger a new Copr build, add a comment containing new
Spec and SRPM URLs or [fedora-review-service-build] string.

Comment 8 Debarshi Ray 2024-06-24 20:00:58 UTC
(In reply to Debarshi Ray from comment #1)
> I chose to disable the tests by default because a few of them require the
> presence of the proprietary NVIDIA driver.

I tried the tests with the proprietary NVIDIA driver version 550.78 installed.  They failed in the exact same way as they do without it.  So, I expanded the comment to clarify it with more details.

Comment 9 Debarshi Ray 2024-06-24 20:09:45 UTC
(In reply to Mikel Olasagasti Uranga from comment #3)
> On top of these changes, would it be possible to update to latest go2rpm
> (1.12.0) package?

Done.  I hope I didn't mess it up when hand-editing the *.spec file.

Is %{goname} deprecated?  I am asking because go2rpm doesn't use it.  I see that the packaging guidelines still use it: https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/

Comment 10 Mikel Olasagasti Uranga 2024-06-29 15:36:59 UTC
> Is %{goname} deprecated?  I am asking because go2rpm doesn't use it.  I see that the packaging guidelines still use it: https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/

Documentation needs some love.

The template was changed here:

https://gitlab.com/fedora/sigs/go/go2rpm/-/commit/8b6977dbeca1a7e54921bfe08136520a039b279f

Comment 11 Mikel Olasagasti Uranga 2024-06-29 15:37:18 UTC
This package was generated using go2rpm, which simplifies the review.

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


- [x] The latest version is packaged or packaging an earlier version is justified.
- [x] The License tag reflects the package contents and uses the correct identifiers.
- [x] The package builds successfully in mock.
- [x] Package is installable (checked by fedora-review).
- [x] There are no relevant rpmlint errors.
- [x] The package runs tests in %check.
- [x] `%goipath` is set correctly.
- [-] The package's binaries don't conflict with binaries already in the distribution. (Some Go projects include utility binaries with very generic names)
- [-] There are no `%{_bindir}/*` wildcards in %files. (go2rpm includes these by default)
- [x] The package does not use `%gometa -f` if it has dependents that still build for %ix86.
- [x] The package complies with the Golang and general Packaging Guidelines.

Package approved! On import, don't forget to do the following:

- [ ] Add the package to release-monitoring.org
- [ ] Give go-sig privileges (at least commit) on the package
- [ ] Close the review bug by referencing its ID in the rpm changelog and the Bodhi ticket.
- [ ] Consider configuring Packit service to help with maintenance

Thanks!

Comment 12 Debarshi Ray 2024-07-02 14:33:44 UTC
(In reply to Mikel Olasagasti Uranga from comment #10)
> > Is %{goname} deprecated?  I am asking because go2rpm
> doesn't use it.  I see that the packaging guidelines
> still use it:
> https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/
> 
> Documentation needs some love.
> 
> The template was changed here:
> 
> https://gitlab.com/fedora/sigs/go/go2rpm/-/commit/
> 8b6977dbeca1a7e54921bfe08136520a039b279f

I see, thanks for the reference.

The commit message says:
"We now hardcode the Name field to the value of goname,"

... and the changes replace %{goname} with the name unconditionally:
Name:           %{goname}
Name:           {{ name }}

So, are we not supposed to use %{goname} in *.spec files anymore?  go-rpm-macros doesn't seem to have deprecated it, but I saw this commit:
https://pagure.io/go-rpm-macros/c/39aa1bbc6ad33a3b603d2f2a16ab186c84c2342a

... which looks related, but it's not clear to me how.  :)

Comment 13 Fedora Admin user for bugzilla script actions 2024-07-02 14:41:05 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/golang-github-nvidia-nvml

Comment 14 Debarshi Ray 2024-07-02 14:44:52 UTC
(In reply to Mikel Olasagasti Uranga from comment #11)
>
> [...]
>
> Package approved! On import, don't forget to do the following:

Thanks, Mikel.
 
> - [ ] Add the package to release-monitoring.org
> - [ ] Give go-sig privileges (at least commit) on the package
> - [ ] Close the review bug by referencing its ID in the rpm changelog and
> the Bodhi ticket.
> - [ ] Consider configuring Packit service to help with maintenance

Okay, I will do those.

Requested Git repository:
https://pagure.io/releng/fedora-scm-requests/issue/63279

Requested Git branches for f40 and f39:
https://pagure.io/releng/fedora-scm-requests/issue/63280
https://pagure.io/releng/fedora-scm-requests/issue/63281

Comment 15 Mikel Olasagasti Uranga 2024-07-02 15:20:38 UTC
(In reply to Debarshi Ray from comment #12)
> (In reply to Mikel Olasagasti Uranga from comment #10)
> > > Is %{goname} deprecated?  I am asking because go2rpm
> > doesn't use it.  I see that the packaging guidelines
> > still use it:
> > https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/
> > 
> > Documentation needs some love.
> > 
> > The template was changed here:
> > 
> > https://gitlab.com/fedora/sigs/go/go2rpm/-/commit/
> > 8b6977dbeca1a7e54921bfe08136520a039b279f
> 
> I see, thanks for the reference.
> 
> The commit message says:
> "We now hardcode the Name field to the value of goname,"
> 
> ... and the changes replace %{goname} with the name unconditionally:
> Name:           %{goname}
> Name:           {{ name }}
> 
> So, are we not supposed to use %{goname} in *.spec files anymore? 

Correct, no need to use goname, name works just fine.

> go-rpm-macros doesn't seem to have deprecated it, but I saw this commit:
> https://pagure.io/go-rpm-macros/c/39aa1bbc6ad33a3b603d2f2a16ab186c84c2342a
> 
> ... which looks related, but it's not clear to me how.  :)

Not a macro expert myself, so not sure if something else should be changed. You can try to ask in https://lists.fedoraproject.org/archives/list/golang@lists.fedoraproject.org/ or Fedora Golang room in Matrix.

Comment 16 Fedora Update System 2024-07-02 15:23:54 UTC
FEDORA-2024-390b5c7d9a (golang-github-nvidia-nvml-0.12.4.0-1.fc40) has been submitted as an update to Fedora 40.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-390b5c7d9a

Comment 17 Fedora Update System 2024-07-02 15:35:03 UTC
FEDORA-2024-d33b6e25fc (golang-github-nvidia-nvml-0.12.4.0-1.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-d33b6e25fc

Comment 19 Fedora Update System 2024-07-03 01:24:56 UTC
FEDORA-2024-390b5c7d9a has been pushed to the Fedora 40 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-390b5c7d9a \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-390b5c7d9a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 20 Fedora Update System 2024-07-03 02:40:22 UTC
FEDORA-2024-d33b6e25fc has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-d33b6e25fc \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-d33b6e25fc

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 21 Fedora Update System 2024-07-11 01:15:20 UTC
FEDORA-2024-390b5c7d9a (golang-github-nvidia-nvml-0.12.4.0-1.fc40) has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 22 Fedora Update System 2024-07-11 01:22:06 UTC
FEDORA-2024-d33b6e25fc (golang-github-nvidia-nvml-0.12.4.0-1.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


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