Bug 2104346

Summary: hugo package does not mark go as a dependency, so it doesn't work properly
Product: [Fedora] Fedora Reporter: Nate Graham <nate>
Component: hugoAssignee: Athos Ribeiro <athoscribeiro>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: athoscribeiro, go-sig, mike, misc, quantum.analyst, redhat
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: hugo-0.98.0-11.fc38 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-12 21:24:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nate Graham 2022-07-06 02:59:14 UTC
When installing `hugo` package, it does not mark `go` as a required dependency or even a weak dependency. As a result, when you try to start the local server, this happens:

> $ hugo server
> Error: failed to download modules: binary with name "go" not found

Installing `go` and its dependencies clears this up. So it would be nice if that package is marked as a dependency of some sort.

Comment 1 W. Michael Petullo 2022-07-12 21:24:28 UTC
Thank you for the report. See https://bodhi.fedoraproject.org/updates/FEDORA-2022-d64b9a26a9.

Comment 2 Nate Graham 2022-07-12 22:35:04 UTC
You're welcome, and thank you for fixing it!

Comment 3 Michael S. 2022-07-29 14:52:21 UTC
But the side effect is that now, installing hugo pull 700 M of deps. I use it for a CI and our container image size exploded.

Comment 4 Michael S. 2022-07-29 14:59:05 UTC
Upon inspection, golang-bin pull gcc, gcc pull glibc-devel, make. golang-bin also pull go-srpm-macros that pull golang-src that pull redhat-rpm-config and so a ton of libs to build things. Hence the 3 fold increase of the size of image.

Could the deps be moved to a weak deps or something be done to avoid bloating the image ?

Comment 5 W. Michael Petullo 2022-07-29 17:09:42 UTC
(In reply to Michael S. from comment #3)
> But the side effect is that now, installing hugo pull 700 M of deps. I use
> it for a CI and our container image size exploded.

I imagine you do not use "go serve" in your CI pipeline, right?

So it seems you want partial functionality out of the package, and you are willing to accept that things like "go serve" will not work. What features of Hugo do you use in your CI pipeline?

I wonder if we should make a "-server" subpackage that depends on Go. I am also considering your idea about a weak dependency. It is not yet clear to me what the best way ahead is. I don't really like the idea of the default package being incomplete, so perhaps the weak dependency is better.

Would you be willing to work out a solution and propose it as a src.fedoraproject.org pull request?

Comment 6 Michael S. 2022-07-29 22:35:10 UTC
> I imagine you do not use "go serve" in your CI pipeline, right?

Yup, I just build the website, and deploy it (if needed).

As a alternative to the weak dep, another solution could be having a hugo-bin that contains just the binary (and the license), and have it required by the main package.

A user using "dnf install hugo" would have it work out of the box (this original bug report), and people wishing to optimize can use the stripped down package.

I will propose it as a PR (as soon as I figure how things changed since last time I built a package like %autorelease, etc)

Comment 7 Nate Graham 2022-07-29 23:05:08 UTC
That sounds like a sensible solution to me!

Comment 8 Michael S. 2022-07-29 23:19:29 UTC
So here is the proposal: https://src.fedoraproject.org/rpms/hugo/pull-request/13 

I have made a scratch build, but it failed on PPC64 during the tests (and I consider that it is unrelated to my change). However, I am a bit rusty, so I hope I forgot nothing with %autorelease and the new changelog system.

Comment 9 Fedora Update System 2022-08-29 18:58:08 UTC
FEDORA-2022-14acc88896 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2022-14acc88896

Comment 10 Fedora Update System 2022-08-29 19:02:54 UTC
FEDORA-2022-14acc88896 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.