Opened 2 years ago

Closed 2 years ago

#65219 closed defect (fixed)

cargo @0.61.0: checksum mismatch due to wrong master_sites

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: herbygillot (Herby Gillot), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port: cargo

Description

https://build.macports.org/builders/ports-11_arm64-builder/builds/54553/steps/install-port/logs/stdio

--->  Attempting to fetch cargo-0.61.0.tar.gz from https://codeload.github.com/rust-lang/cargo/legacy.tar.gz/0.61.0?dummy=
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 13050    0 13050    0     0  48694      0 --:--:-- --:--:-- --:--:-- 48513
100 1943k    0 1943k    0     0  3709k      0 --:--:-- --:--:-- --:--:-- 3702k
--->  Verifying checksums for cargo
DEBUG: Executing org.macports.checksum (cargo)
--->  Checksumming cargo-0.61.0.tar.gz
Portfile checksum: cargo-0.61.0.tar.gz rmd160 f46c372b14f97eac1239d6dfc54d08d20f6ff8a5
Distfile checksum: cargo-0.61.0.tar.gz rmd160 423c267e2719934aaa67574aa6f5f923b2cd7f17
DEBUG: Calculated (rmd160) is 423c267e2719934aaa67574aa6f5f923b2cd7f17
Error: Checksum (rmd160) mismatch for cargo-0.61.0.tar.gz
Portfile checksum: cargo-0.61.0.tar.gz sha256 bf32925fa30a1014a789cdbcc40dc663b36b1f183dcd8150e7cb524e5f367709
Distfile checksum: cargo-0.61.0.tar.gz sha256 1d642e32ab150d3b12887924139b816aa6d7bdef9d90f69146c40916b68403fd
DEBUG: Calculated (sha256) is 1d642e32ab150d3b12887924139b816aa6d7bdef9d90f69146c40916b68403fd
Error: Checksum (sha256) mismatch for cargo-0.61.0.tar.gz
DEBUG: Calculated (size) is 1990526
Error: Checksum (size) mismatch for cargo-0.61.0.tar.gz
Portfile checksum: cargo-0.61.0.tar.gz size 1990410
Distfile checksum: cargo-0.61.0.tar.gz size 1990526

0.61.1 and 0.62.0 have been released, so updating would fix this.

Note that this port is downloading from the GitHub's deprecated legacy endpoint ("legacy.tar.gz"), although the port appears to be intending to download from the newer archive endpoint. (The port does contain github.tarball_from archive).

This is due to a bad interaction between the cargo and github portgroups with regard to default master_sites. The cargo port calls rust.add_bootstrap_components (which appends to master_sites, thereby solidifying whatever default master_sites was in effect at the time) before calling github.tarball_from archive (which changes the default master_sites which no longer matters since the default has already been copied into the variable by that point). The solution is to call github.tarball_from archive before calling rust.add_bootstrap_components. Using the typical ordering of statements (placing github.tarball_from where master_sites would typically go, after homepage, which both come before anything related to how the port builds) achieves this.

Change History (1)

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In 58f26d96fd523ed56330678cc259eb3f776f2b7d/macports-ports (master):

cargo: Fix wrong master_sites -> checksum mismatch

Fix master_sites by using "github.tarball_from archive" before using "rust.add_bootstrap_components".

Closes: #65219

Note: See TracTickets for help on using tickets.