Opened 5 months ago

Last modified 4 months ago

#70283 assigned defect

gopls @0.16.0: checksum mismatch

Reported by: amake (Aaron Madlon-Kay) Owned by: ra1nb0w
Priority: High Milestone:
Component: ports Version:
Keywords: Cc: herbygillot (Herby Gillot)
Port: gopls

Description

The gopls checksums are apparently incorrect. Looking at the Port Health at https://ports.macports.org/port/gopls/details/ it looks like upstream did a stealth update.

DEBUG: checksum phase started at Mon Jun 24 09:55:54 JST 2024
--->  Verifying checksums for gopls
DEBUG: Executing org.macports.checksum (gopls)
--->  Checksumming tools-0.16.0.tar.gz
DEBUG: Calculated (rmd160) is 4b93bff003eabc1129bcfaa22f2c94ee2497e920
Error: Checksum (rmd160) mismatch for tools-0.16.0.tar.gz
Portfile checksum: tools-0.16.0.tar.gz rmd160 4fb04a9172e61f2d4328111655d71314778bbe49
Distfile checksum: tools-0.16.0.tar.gz rmd160 4b93bff003eabc1129bcfaa22f2c94ee2497e920
DEBUG: Calculated (sha256) is 0775f9769a4dfc54dfaa41182d3725f44a8fd6eaed2568390dde7f5803f931be
Error: Checksum (sha256) mismatch for tools-0.16.0.tar.gz
Portfile checksum: tools-0.16.0.tar.gz sha256 c63ef6f604e82be6c5b6e5f65fa291440459b4da7cde7b4e01d46ad1ac066ea9
Distfile checksum: tools-0.16.0.tar.gz sha256 0775f9769a4dfc54dfaa41182d3725f44a8fd6eaed2568390dde7f5803f931be
DEBUG: Calculated (size) is 3872411
Error: Checksum (size) mismatch for tools-0.16.0.tar.gz
Portfile checksum: tools-0.16.0.tar.gz size 3625708
Distfile checksum: tools-0.16.0.tar.gz size 3872411
The correct checksum line may be:
checksums           rmd160  4b93bff003eabc1129bcfaa22f2c94ee2497e920 \
                    sha256  0775f9769a4dfc54dfaa41182d3725f44a8fd6eaed2568390dde7f5803f931be \
                    size    3872411
Error: Failed to checksum gopls: Unable to verify file checksums

Change History (6)

comment:1 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: ra1nb0w removed
Owner: set to ra1nb0w
Status: newassigned
Summary: gopls: checksum mismatchgopls @0.16.0: checksum mismatch

The diff between the old 0.16.0 from November 27, 2023 and the new 0.16.0 from June 20, 2024 is over 28,000 lines long. The name of the enclosing directory also changed from tools-0.16.0 to tools-gopls-v0.16.0.

We are downloading from GitHub automatically-generated tarballs using the v0.16.0 tag. That tag is from November 27, 2023: https://github.com/golang/tools/releases/tag/v0.16.0

But now we are getting code from the gopls/v0.16.0 tag from June 20, 2024 for some reason: https://github.com/golang/tools/releases/tag/gopls%2Fv0.16.0

Since the port was just updated to this version three days ago, I assume it is in fact the gopls/v0.16.0 tag that was intended, so the port should specify that tag, not the older v0.16.0 tag.

comment:2 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

No, the port already does specify the gopls/v tag prefix that it should.

The problem is that all go distfiles get downloaded into a single go directory. We already mirrored the distfile tools-0.16.0.tar.gz back in November 2023 when go-tools was updated to 0.16.0.

This is not the first time grouping all go distfiles into a single directory has caused a problem. There are distfiles in that directory named 0.3.0.tar.gz, 0.4.0.tar.gz… who knows what package those are for.

The gopls port needs to change the distname so that it does not collide with the go-tools port's distname. Please keep the potential for distname collisions in mind for any future updates of any go ports.

comment:3 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)

The way to do that is:

  • devel/gopls/Portfile

    diff --git a/devel/gopls/Portfile b/devel/gopls/Portfile
    index 83a7c8eb846..f38b4a3c69e 100644
    a b long_description {*}${description} 
    1515go.setup            golang.org/x/tools 0.16.0 gopls/v
    1616go.offline_build    no
    1717github.tarball_from archive
    18 revision            0
    19 
    20 checksums           rmd160  4fb04a9172e61f2d4328111655d71314778bbe49 \
    21                     sha256  c63ef6f604e82be6c5b6e5f65fa291440459b4da7cde7b4e01d46ad1ac066ea9 \
    22                     size    3625708
     18distname            ${name}-${version}
     19revision            1
     20checksums           rmd160  4b93bff003eabc1129bcfaa22f2c94ee2497e920 \
     21                    sha256  0775f9769a4dfc54dfaa41182d3725f44a8fd6eaed2568390dde7f5803f931be \
     22                    size    3872411
    2323
    2424build.dir           ${worksrcpath}/${name}
    2525

Unfortunately the golang portgroup is not compatible with changing the distname. The golang portgroup needs to be fixed or the gopls port and any other affected ports need to work around that deficiency by renaming the worksrcdir after extraction.

comment:4 Changed 4 months ago by kopiczko (Paweł Kopiczko)

Possibly it's obvious but it also fail to match checksum for 0.16.1

comment:5 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)

Priority: NormalHigh

This is a serious design flaw in the golang portgroup and the ports that use it that needs to be resolved properly and quickly.

comment:6 Changed 4 months ago by ra1nb0w

Unfortunately, I am very busy with work these days. Is there someone that can propose a PR?

Note: See TracTickets for help on using tickets.