Spec URL: https://phildev.net/fedora/golang-github-hub.spec SRPM URL: https://kojipkgs.fedoraproject.org//work/tasks/6360/62816360/golang-github-hub-2.14.2-1.fc35.src.rpm Description: A command-line tool that makes git easier to use with GitHub Fedora Account System Username: jaymzh Apparently the naming should include an extra 'github' in here since github is the owner, but go2rpm didn't do that, so... I can rename it if necessary.
Yeah, I think it should be golang-github-github-hub. This might be a bug in go2rpm, might be worth filing one in case someone runs into this packaging the next inhouse GitHub Golang project? The -devel package is not installable at the moment: Error: Problem: conflicting requests - nothing provides golang(github.com/russross/blackfriday) needed by golang-github-hub-devel-2.14.2-1.fc35.noarch (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages) oh, it's the golang(github.com/russross/blackfriday) vs golang(github.com/russross/blackfriday/v2) and you already patched the BR in the spec to handle this, but alas the -devel package's dependencies are automatically generated. We ran across a similar issue packaging go2chef, and the solution is generate an extra "Provides" in blackfriday, which one of the golang RPM macros does. I'll do a PR for it and make this review depend on that.
Huh, what is going on: fedora/reviews/1933471-golang-github-hub took 11m6s ✦ ❯ sudo dnf repoquery --whatprovides 'golang(github.com/russross/blackfriday/v2)' [sudo] password for michel: Fedora Modular 33 - x86_64 - Updates 19 kB/s | 13 kB 00:00 Fedora 33 - x86_64 - Updates 13 kB/s | 10 kB 00:00 Fedora 33 - x86_64 - Updates 567 kB/s | 2.6 MB 00:04 compat-golang-github-russross-blackfriday-2-devel-0:2.0.1-8.fc33.noarch compat-golang-github-russross-blackfriday-2-devel-0:2.1.0-1.fc33.noarch fedora/reviews/1933471-golang-github-hub took 17s ✦ ❯ sudo dnf info compat-golang-github-russross-blackfriday-2-devel Last metadata expiration check: 0:00:26 ago on Sun 28 Feb 2021 09:35:25 PM PST. Available Packages Name : compat-golang-github-russross-blackfriday-2-devel Version : 2.1.0 Release : 1.fc33 Architecture : noarch Size : 9.0 k Source : golang-gopkg-russross-blackfriday-2-2.1.0-1.fc33.src.rpm Repository : updates Summary : Markdown processor for Go URL : https://github.com/russross/blackfriday License : BSD Description : Blackfriday is a Markdown processor implemented in Go. It is paranoid about its : input (so you can safely feed it user-supplied data), it is fast, it supports : common extensions (tables, smart punctuation substitutions, etc.), and it is : safe for all utf-8 (unicode) input. : : HTML output is currently supported, along with Smartypants extensions. : : This package provides symbolic links that alias the following Go import paths to : gopkg.in/russross/blackfriday.v2: : – github.com/russross/blackfriday/v2 : : Aliasing Go import paths via symbolic links or http redirects is fragile. If : your Go code depends on this package, you should patch it to import directly : gopkg.in/russross/blackfriday.v2. But https://src.fedoraproject.org/rpms/golang-gopkg-github-russross-blackfriday-2 404s.
ah, ok, you want to use this instead: https://src.fedoraproject.org/rpms/golang-gopkg-russross-blackfriday-2 and per https://docs.fedoraproject.org/en-US/packaging-guidelines/Golang/#_source_packages_src_rpm duplicate names in the paths are removed (the specific example given is when the project owner and project name are the same e.g. github.com/gopherjs/gopherjs, but it makes sense for when the forge name and the project owner are the same too. So renaming the BR should get you going, hopefully.
(In reply to Michel Alexandre Salim from comment #3) > ah, ok, you want to use this instead: > https://src.fedoraproject.org/rpms/golang-gopkg-russross-blackfriday-2 > the compatibility ipath github/russross/blackfriday is completely dropped there, so perhaps do what the repo suggests: "Aliasing Go import paths via symbolic links or http redirects is fragile. If your Go code depends on this package, you should patch it to import directly gopkg.in/russross/blackfriday.v2"
Yeah I'm a bit confused here, because the src.fp.o site says that but the upstream source still claims the forge is GH: https://github.com/russross/blackfriday I'm not terribly familiar with go or go packaging, so this may be a dumb question, but is this a bug in the fedora packaging or are the upstream docs just out-of-date?
In fact, if I change the imports to use the gopkg.in path, go warns me: ``` $ go mod vendor go: finding module for package gopkg.in/russross/blackfriday.v2 go: found gopkg.in/russross/blackfriday.v2 in gopkg.in/russross/blackfriday.v2 v2.1.0 go: github.com/github/hub/v2/md2roff imports gopkg.in/russross/blackfriday.v2: gopkg.in/russross/blackfriday.v2.0: parsing go.mod: module declares its path as: github.com/russross/blackfriday/v2 but was required as: gopkg.in/russross/blackfriday.v2 ``` Makes me think the fedora package is wrong, but again, I'm not very familiar with golang modules.
Tried to find fpokorny on IRC but failed, so I'll tag @fpokorny here... hopefully he'll know off hand if I'm just doing something stupid, or if the module declarations in blackfriday need an update.
Oops. that's the -v1 package which is retired. :( Removing the needsinfo, I'll see if I can catch zebob on IRC before tagging him here.
OK lets try this one more time, this time with the right packager. @zebob.m - I can't tell here if there's a bug in the exports of blackfriday or if I'm just missing something.
Spec URL: https://phildev.net/fedora/golang-github-hub.spec SRPM URL: https://kojipkgs.fedoraproject.org//work/tasks/4171/63024171/golang-github-hub-2.14.2-2.fc35.src.rpm Meh, decided to just patch the source, it's a simple change. Dunno if fedora-review will use the above headers from a 2nd comment or not, I guess we'll find out.
So I think the issue is that the patch is mixing up the new ipath (starts with gopkg, ends with .v2) and the old ipath (starts with github, ends with /v2); see https://src.fedoraproject.org/rpms/golang-gopkg-russross-blackfriday-2/blob/rawhide/f/golang-gopkg-russross-blackfriday-2.spec As a result, the -devel subpackage is not installable as golang(github.com/russross/blackfriday.v2) does not exist but golang(github.com/russross/blackfriday/v2) does fedora/reviews/1933471-golang-github-hub ✦ ❯ rpm -qp --requires ./results/golang-github-hub-devel-2.14.2-2.fc35.noarch.rpm go-filesystem golang(github.com/BurntSushi/toml) golang(github.com/atotto/clipboard) golang(github.com/kballard/go-shellquote) golang(github.com/mattn/go-colorable) golang(github.com/mattn/go-isatty) golang(github.com/mitchellh/go-homedir) golang(github.com/russross/blackfriday.v2) golang(golang.org/x/crypto/ssh/terminal) golang(golang.org/x/net/http/httpproxy) golang(gopkg.in/yaml.v2) rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsZstd) <= 5.4.18-1 fedora/reviews/1933471-golang-github-hub ✦ ❯ sudo dnf repoquery --whatprovides 'golang(github.com/russross/blackfriday.v2)' [sudo] password for michel: Copr repo for fbrnch owned by petersen 7.4 kB/s | 3.3 kB 00:00 Copr repo for joplin owned by taw 8.7 kB/s | 3.6 kB 00:00 Fedora Modular 33 - x86_64 14 kB/s | 14 kB 00:00 Fedora Modular 33 - x86_64 - Updates 31 kB/s | 13 kB 00:00 Fedora Modular 33 - x86_64 - Updates 65 kB/s | 147 kB 00:02 Fedora 33 - x86_64 - Updates 11 kB/s | 11 kB 00:00 Fedora 33 - x86_64 - Updates 811 kB/s | 3.0 MB 00:03 Fedora 33 - x86_64 40 kB/s | 14 kB 00:00 google-chrome 7.3 kB/s | 1.3 kB 00:00 google-chrome 17 kB/s | 3.5 kB 00:00 fedora/reviews/1933471-golang-github-hub took 24s ✦ ❯ sudo dnf repoquery --whatprovides 'golang(github.com/russross/blackfriday/v2)' Last metadata expiration check: 0:00:07 ago on Thu 04 Mar 2021 02:49:42 PM PST. compat-golang-github-russross-blackfriday-2-devel-0:2.0.1-8.fc33.noarch compat-golang-github-russross-blackfriday-2-devel-0:2.1.0-1.fc33.noarch
(In reply to Phil Dibowitz from comment #10) > Spec URL: https://phildev.net/fedora/golang-github-hub.spec > SRPM URL: > https://kojipkgs.fedoraproject.org//work/tasks/4171/63024171/golang-github- > hub-2.14.2-2.fc35.src.rpm > > Meh, decided to just patch the source, it's a simple change. > > Dunno if fedora-review will use the above headers from a 2nd comment or not, > I guess we'll find out. Patch is okay although you could simply have used a sed expression. It would be more future proof. The package was already packaged but orphaned: https://src.fedoraproject.org/rpms/hub/blob/f05bd6d3915e4fe201fedc2317b29d7e63eff0bf/f/hub.spec Take a look at the spec, especially man pages and completions, and reuse the name "hub" to unorphan this package. Also I don't think ou need the library package, just use the main package as "hub". (i.e. drop: %gopkg, %gopkginstall, %gopkgfiles)
It should be "gopkg.in/russross/blackfriday.v2"
Spec URL: https://phildev.net/fedora/golang-github-hub.spec SRPM URL: https://kojipkgs.fedoraproject.org//work/tasks/4849/63114849/golang-github-hub-2.14.2-3.fc35.src.rpm Nice catch, thanks. Verified all 4 RPMs install cleanly...
@zebob.m as I mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=1933471#c6 I cannot import that, go complains that it should be github.
Spec URL: https://phildev.net/fedora/golang-github-hub.spec SRPM URL: https://kojipkgs.fedoraproject.org//work/tasks/445/63120445/golang-github-hub-2.14.2-4.fc35.src.rpm OH! I missed the abandoned packaged @zebob.m - many thanks! Pulled in all those extras, fixed it up a bit. And you're right - it works with the gopkg.in path. I don't really understand why... but it works. I also dropped a bunch of the warnings about duplicate files that were in both my package and the abandoned one due to the many things called README.md. Hopefully this one is good.
So this mostly looks good to go, with a few exceptions: - the tarball in the SRPM is *huge* compared to the tarball I download directly with `spectool -gf`. Might want to try to see if `spectool -gf golang-github-hub.spec && mv hub*.tar.gz ~/rpmbuild/SOURCES && rpmbuild -bs golang-github-hub.spec` generates a correct SRPM? My hunch is that given the package previously existed, somehow you're getting an old tarball checked into the Fedora lookaside cache - directory ownership: for the shell completions and Vim files, you need to either own the directories or split off the files into subpackages that depend on vim, zsh and fish. The former is probably more straightforward - the vendor directory contains Golang modules that are bundled with this package; keeping it this way used to require an FPC exception (and fedora-review still says so). I don't see any filed for the old package: https://pagure.io/packaging-committee/issues?search_pattern=hub&status=Closed Ideally, try and see if the package can be built without it? That might require some changes to the build scripts. And... it also bundles Ruby gems in bundle/ :( See https://docs.fedoraproject.org/en-US/packaging-guidelines/#bundling -- at the very least you'd have to declare which modules get bundled (and at which version) so in case there are security vulnerabilities the package can be flagged as needing to be updated. 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++/ => golang, not applicable ===== MUST items ===== C/C++: [-]: Provides: bundled(gnulib) in place as required. Note: Sources not installed => going to guess not applicable [x]: Package does not contain kernel modules. [-]: Package contains no static executables. => golang, everything is static [x]: Package does not contain any libtool archives (.la) [x]: Rpath absent or only used for internal libs. Generic: [x]: Package successfully compiles and builds into binary rpms on at least one supported primary architecture. Note: Using prebuilt packages => Koji build has been done by packager [x]: Package is licensed with an open-source compatible license and meets other legal requirements as defined in the legal section of Packaging Guidelines. [?]: License field in the package spec file matches the actual license. Note: There is no build directory. Running licensecheck on vanilla upstream sources. Licenses found: "Unknown or generated", "Expat License", "*No copyright* Apache License 2.0", "Apache License 2.0", "Do What The Fuck You Want To Public License, Version 2", "BSD 3-clause "New" or "Revised" License", "BSD 2-clause "Simplified" License". 627 files have unknown license. Detailed output of licensecheck in /home/michel/src/fedora/reviews/1933471-golang-github- hub/srpm-unpacked/review-golang-github-hub/licensecheck.txt => the issues seem to be the vendored modules [!]: Package must own all directories that it creates. Note: Directories without known owners: /usr/share/zsh, /usr/share/zsh/site-functions, /usr/share/vim, /usr/share/vim/vimfiles/ftdetect, /usr/share/vim/vimfiles/syntax, /usr/share/fish/completions, /usr/share/fish, /usr/share/vim/vimfiles => two approaches here. Either own the directories, or split off zsh, fish, vim support into subpackages. owning the directories is probably easiest, it's fine if they are owned by multiple packages (removing the last one will make RPM clean up and remove the directory) [x]: %build honors applicable compiler flags or justifies otherwise. [?]: Package contains no bundled libraries without FPC exception. => that vendor directory [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. [x]: If the package is a rename of another package, proper Obsoletes and Provides are present. => the binary RPM is not renamed, the source is [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. [x]: Large documentation must go in a -doc subpackage. Large could be size (~1MB) or number of files. Note: Documentation size is 30720 bytes in 7 files. [x]: Package complies to the Packaging Guidelines [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 does not own files or directories owned by other packages. [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 does not use a name that already exists. [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: [x]: Reviewer should test that the package builds in mock. [-]: 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). [?]: Package functions as described. [x]: Latest version is packaged. [x]: Package does not include license text files separate from upstream. [!]: 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. [-]: Description and summary sections in the package spec file contains translations for supported Non-English languages, if available. [x]: Package should compile and build into binary rpms on all supported architectures. [!]: %check is present and all tests pass. [ ]: Packages should try to preserve timestamps of original installed files. [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]: Spec use %global instead of %define unless justified. ===== EXTRA items ===== Generic: [x]: Rpmlint is run on all installed packages. Note: No rpmlint messages. [x]: Large data in /usr/share should live in a noarch subpackage if package is arched. [x]: Spec file according to URL is the same as in SRPM. Rpmlint ------- Checking: hub-2.14.2-4.fc35.x86_64.rpm golang-github-hub-2.14.2-4.fc35.src.rpm golang-github-hub.src:31: W: mixed-use-of-spaces-and-tabs (spaces: line 9, tab: line 31) 2 packages and 0 specfiles checked; 0 errors, 1 warnings. Rpmlint (installed packages) ---------------------------- 1 packages and 0 specfiles checked; 0 errors, 0 warnings. Source checksums ---------------- https://github.com/github/hub/archive/v2.14.2/hub-2.14.2.tar.gz : CHECKSUM(SHA256) this package : e19e0fdfd1c69c401e1c24dd2d4ecf3fd9044aa4bd3f8d6fd942ed1b2b2ad21a CHECKSUM(SHA256) upstream package : e19e0fdfd1c69c401e1c24dd2d4ecf3fd9044aa4bd3f8d6fd942ed1b2b2ad21a Requires -------- hub (rpmlib, GLIBC filtered): libc.so.6()(64bit) libpthread.so.0()(64bit) Provides -------- hub: hub hub(x86-64) Generated by fedora-review 0.7.6 (b083f91) last change: 2020-11-10 Command line :/usr/bin/fedora-review -n golang-github-hub -p Buildroot used: fedora-rawhide-x86_64 Active plugins: C/C++, Shell-api, Generic Disabled plugins: Haskell, PHP, Python, Perl, fonts, R, Java, Ocaml, SugarActivity, Ruby Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH
Spec URL: https://phildev.net/fedora/golang-github-hub.spec SRPM URL: https://kojipkgs.fedoraproject.org//work/tasks/4179/63234179/golang-github-hub-2.14.2-5.fc35.src.rpm OK not sure how but I had a tarball with garbage in it that was getting sucked in. The sources are the same now: ``` [phil@fedora review-golang-github-hub]$ ls -l srpm-unpacked/hub-2.14.2.tar.gz -rw-r--r--. 1 phil phil 2080107 Mar 7 00:48 srpm-unpacked/hub-2.14.2.tar.gz [phil@fedora review-golang-github-hub]$ ls -l upstream/hub-2.14.2.tar.gz -rw-r--r--. 1 phil phil 2080107 Mar 7 00:48 upstream/hub-2.14.2.tar.gz ``` I added the dirs that were unowned, but of course that adds warnings about how those directories are owned by other packages. But I think the shell-completions should be part of the core package. Relatedly the dirs it complained were unowned, now that I've owned them, it's telling me they're listed twice, but they're not. I also rm -rf vendor and rm -rf bundle in prep now so those are for sure not used.
Ah, there's a special macro, %dir, you can use to just own the directory and not all the files inside recursively. so e.g. %dir %{_datadir}/zsh %dir %{_datadir}/zsh/site-functions %{_datadir}/zsh/site-functions/_hub you can also just do %{_datadir}/zsh but I think being explicit is better
Spec URL: https://phildev.net/fedora/golang-github-hub.spec SRPM URL: https://kojipkgs.fedoraproject.org//work/tasks/9524/63239524/golang-github-hub-2.14.2-6.fc35.src.rpm
Looks good to me! APPROVED
Filed unretire request: https://pagure.io/releng/issue/10052
(In reply to Michel Alexandre Salim from comment #1) > Yeah, I think it should be golang-github-github-hub. What happened to this discussion?
The golang guide says you should collapse segments that are the same.
(fedscm-admin): The Pagure repository was created at https://src.fedoraproject.org/rpms/golang-github-hub
Thanks for the explanation.
FEDORA-2021-703dbcacdc has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-703dbcacdc
FEDORA-2021-5548cf41d8 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-5548cf41d8
FEDORA-2021-703dbcacdc has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2021-703dbcacdc \*` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-703dbcacdc See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-5548cf41d8 has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2021-5548cf41d8 \*` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-5548cf41d8 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-5548cf41d8 has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-703dbcacdc has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.