#48 [Tracker] Leaf Go library packages
Closed a year ago by gotmax23. Opened 2 years ago by gotmax23.

Let's use this ticket to track leaf Go library packages. Of course, leaf applications should not be listed here. Anyone who finds a leaf package can leave a comment with the package name and @ mention the maintainer. Maintainers who are mentioned, please confirm that your package is indeed a leaf. After doing so, please fedpkg retire and orphan your package, and then leave a comment saying that you've done so.


At the next Go SIG meeting, we can decide what to do if/when maintainers don't respond.


@eclipseo: golang-github-mileusna-useragent [R]

is needed for golang-github-influxdata-influxdb in F35 and F36, but it's no longer needed in F37 or F38.

@nathans, @agerstmayr, @mgoodwin: golang-github-gosimple-slug [R]

@nathans, @agerstmayr, @mgoodwin: golang-github-facebookarchive-inject [R]

@nathans, @agerstmayr, @mgoodwin: golang-github-facebookarchive-structtag [R]

is only needed by golang-github-facebookarchive-inject

@eclipseo: golang-github-mileusna-useragent is needed for golang-github-influxdata-influxdb in F35 and F36, but it's no longer needed in F37 or F38.

https://src.fedoraproject.org/rpms/golang-github-influxdata-influxdb/c/ac79c8d7d23b0ab4e248840585abb70cad9bf4ee?branch=rawhide

It's orphaned cause lack of manpower but that package is probably needed elsewhere.

@nathans, @agerstmayr, @mgoodwin: golang-github-gosimple-slug

@nathans, @agerstmayr, @mgoodwin: golang-github-facebookarchive-inject

Would be needed if we ever unbundle grafana

Edit influxdb v2 is also needed only by Grafana

@nathans, @agerstmayr, @mgoodwin: golang-github-gosimple-slug

@nathans, @agerstmayr, @mgoodwin: golang-github-facebookarchive-inject

Would be needed if we ever unbundle grafana

Edit influxdb v2 is also needed only by Grafana

Is that likely to happen any time soon? I'd rather retire them now and unretire later if needed so we don't have to maintain packages that aren't in use.

@olem:: golang-github-jsonnet-bundler

@olem:: golang-github-jsonnet-bundler

This is an application, not (only) a library.
See https://github.com/jsonnet-bundler/jsonnet-bundler#package-install

| Is that likely to happen any time soon?

There are no plans to unbundle Grafana. When I get some time I'll be orphaning the remaining go packages I have as a result of the earlier packaging style (like agrestmayr recently did).

olem:: golang-github-jsonnet-bundler

This is an application, not (only) a library.
See https://github.com/jsonnet-bundler/jsonnet-bundler#package-install

I see. I assumed it was a library because of its name.

@eclipseo:: golang-github-containerd-cri

| Is that likely to happen any time soon?

There are no plans to unbundle Grafana. When I get some time I'll be orphaning the remaining go packages I have as a result of the earlier packaging style (like agrestmayr recently did).

Ack. Please update the ticket when you've done that. I'm trying to keep things tidy.

@dcavalca: golang-github-intel-cpuid [R]

This package FTBFS, and it's not needed by anything.

@eclipseo: golang-github-jackc-pgmock [R]

FTBFS and it has no dependents.

@dcavalca: golang-github-intel-cpuid [R]

This package FTBFS, and it's not needed by anything.

This one should be fixed now.

@dcavalca: golang-github-intel-cpuid [R]

This package FTBFS, and it's not needed by anything.

This one should be fixed now.

Thanks for fixing the FTBFS! Is there something that this is still needed for, though? The Go SIG maintains a lot of packages, and getting rid of leaves is an easy way to reduce that, IMO.

Outputs if a package is leaf to leaf_packages.txt:

leaf.py

import solv
import sys

pool = solv.Pool()
pool.setarch()

for r in ('rawhide', 'rawhide-source'):
    repo = pool.add_repo(r)
    f = solv.xfopen(f'/var/cache/dnf/{r}.solv')
    repo.add_solv(f)
    f.close()

pool.addfileprovides()
pool.createwhatprovides()

sel = pool.select(sys.argv[1], solv.Selection.SELECTION_NAME | solv.Selection.SELECTION_WITH_SOURCE)
s = pool.best_solvables(sel.solvables())[0]
if s.arch != 'src':
    src = s.lookup_sourcepkg()[:-4]
    sel = pool.select(src, solv.Selection.SELECTION_CANON | solv.Selection.SELECTION_SOURCE_ONLY)
    if sel.isempty():
        raise Exception(s)
    s = sel.solvables()[0]

ss = f'{s}.rpm'
last = ''
for p in pool.solvables:
    if p.arch == 'src' or p.lookup_sourcepkg() != ss:
        continue

    sel = pool.Selection_all()
    sel.matchsolvable(p, 0, solv.SOLVABLE_REQUIRES)


    if not "-devel-" in f'{p}':
        print(f'{p} is binary')
        if last == f'{s}':  
            with open(r"leaf_packages.txt", 'r+') as output:
                lines = output.readlines()
                output.seek(0)
                output.truncate()
                output.writelines(lines[:-1])

        last = f'{s}'
        break

    if f'{p}'.startswith("compat"):
        print(f'{p} is a compat package')
        continue

    if sel.isempty() or all(f'{i}'.startswith("compat") for i in f'{sel}'.split(" + ")):  
        if "-devel-" in f'{p}':
            if last != f'{s}':
                print(f'{p} is leaf')
                with open("leaf_packages.txt","a") as output:
                    output.write(f'{s}\n')
            else:
                 print(f'{p} src already detected')
        last = f'{s}'
        continue

    print(f'{p} is required by:')
    for pp in sel.solvables():
        if pp.arch not in {'src', 'nosrc'} and pp.lookup_sourcepkg() == ss:
            continue
        print(f'  - {pp}')
        # for dep in pp.lookup_deparray(solv.SOLVABLE_REQUIRES):
        #    print(f'    - {dep}')
    last = f'{s}'

You need to init the cache first:

sudo dnf makecache --enablerepo=rawhide,rawhide-source --disablerepo="*modular*" --refresh

Most of the code is adapted from an older script by Igor Raits.

Takes a package name as input, so for a directory containing your Golang package, you would do something like this in Fish:

for i in *
  python3 ~/leaf.py $i
end

I'll post a list afterwards.

I'm wondering if it'd be a good idea to submit a Change Proposal to remove golang leaves. We can file Bugzillas or otherwise contact maintainers and then automatically retire the packages if the maintainers don't respond after a certain period of time.

A draft change proposal is available at https://fedoraproject.org/wiki/Changes/Mass_Retire_Golang_Leaves. Let me know what you think.

I'm closing this issue. This approach didn't work and I'm moving forward with https://fedoraproject.org/wiki/Changes/Mass_Retire_Golang_Leaves.

Metadata Update from @gotmax23:
- Issue untagged with: meeting

a year ago

Metadata Update from @gotmax23:
- Issue status updated to: Closed (was: Open)

a year ago

Login to comment on this ticket.

Metadata
Attachments 1
Attached a year ago View Comment