[MacPorts] #71772: Bug/edge case re: checksum and port index.

MacPorts noreply at macports.org
Mon Jan 6 18:18:17 UTC 2025


#71772: Bug/edge case re: checksum and port index.
--------------------------------------+--------------------
 Reporter:  Lord-Kamina               |      Owner:  (none)
     Type:  defect                    |     Status:  new
 Priority:  Normal                    |  Milestone:
Component:  base                      |    Version:
 Keywords:  portindex checksum fetch  |       Port:
--------------------------------------+--------------------
 I experienced something weird today.
 I was trying to make a boost187 port to test a program; so to get it
 started I used another boost version as base, went into the port directory
 itself and did `port fetch boost187`, thinking it would just fetch it
 without checking the checksum.

 The archive downloaded, and reported checksum ok, which was utterly
 vexing, because I had not yet updated them.

 {{{#!bash
 $ port -d fetch boost187
 DEBUG: Copying /Users/Koji/Library/Preferences/com.apple.dt.Xcode.plist to
 /opt/local/var/macports/home/Library/Preferences
 DEBUG: Opening port in directory:
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/boost187
 DEBUG: OS darwin/22.6.0 (macOS 13.7.2) arch i386
 DEBUG: Sourcing PortGroup compiler_blacklist_versions 1.0 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/compiler_blacklist_versions-1.0.tcl
 DEBUG: Sourcing PortGroup legacysupport 1.1 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/legacysupport-1.1.tcl
 DEBUG: Sourcing PortGroup active_variants 1.1 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/active_variants-1.1.tcl
 DEBUG: GCC versions for Darwin 22 i386 - 10 11 12 13 14 devel
 DEBUG: Clang versions for Darwin 22 i386 - 9.0 10 11 12 13 14 15 16 17 18
 19 devel
 DEBUG: Sourcing PortGroup compilers 1.0 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/compilers-1.0.tcl
 DEBUG: Sourcing PortGroup mpi 1.0 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/mpi-1.0.tcl
 DEBUG: PortGroup active_variants 1.1 included previously, not sourcing
 again
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 extract.env
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 configure.env
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 build.env
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 destroot.env
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 test.env
 DEBUG: compiler clang 1500.1.0.2.5 not blacklisted because it doesn't
 match {clang < 1000}
 DEBUG: Reading variant descriptions from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/variant_descriptions.conf
 DEBUG: removing universal variant due to < 2 supported universal_archs
 DEBUG: Requested variant -universal is not provided by port boost187.
 DEBUG: Requested variant -x11 is not provided by port boost187.
 DEBUG: Requested variant +quartz is not provided by port boost187.
 DEBUG: Executing variant python312 provides python312
 DEBUG: Executing variant no_static provides no_static
 DEBUG: Executing variant no_single provides no_single
 DEBUG: Running callback portconfigure::add_automatic_compiler_dependencies
 DEBUG: Finished running callback
 portconfigure::add_automatic_compiler_dependencies
 DEBUG: Running callback portbuild::add_automatic_buildsystem_dependencies
 DEBUG: Finished running callback
 portbuild::add_automatic_buildsystem_dependencies
 DEBUG: Running callback portstartupitem::add_notes
 DEBUG: Finished running callback portstartupitem::add_notes
 DEBUG: Running callback legacysupport::add_legacysupport
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 extract.env
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 configure.env
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 build.env
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 destroot.env
 DEBUG: legacysupport: Will append MACPORTS_LEGACY_SUPPORT_DISABLED=1 to
 test.env
 DEBUG: Finished running callback legacysupport::add_legacysupport
 DEBUG: Running callback compilers::add_fortran_legacy_support
 DEBUG: Finished running callback compilers::add_fortran_legacy_support
 DEBUG: Attempting ln -sf
 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_boost187/boost187/work
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/boost187/work
 DEBUG: dropping privileges: euid changed to 503, egid changed to 501.
 DEBUG: Starting logging for boost187
 @1.87.0_0+no_single+no_static+python312
 DEBUG: macOS 13.7.2 (darwin/22.6.0) arch i386
 DEBUG: MacPorts 2.10.5
 DEBUG: Xcode 15.2, CLT none
 DEBUG: SDK 13
 DEBUG: MACOSX_DEPLOYMENT_TARGET: 12.0
 DEBUG: adding /opt/.TemporaryItems to allowed Sandbox paths
 DEBUG: Executing org.macports.main (boost187)
 DEBUG: dropping privileges: euid changed to 503, egid changed to 501.
 DEBUG: Privilege de-escalation not attempted as not running as root.
 DEBUG: adding /opt/.TemporaryItems to allowed Sandbox paths
 DEBUG: fetch phase started at Mon Jan  6 11:34:02 -03 2025
 --->  Fetching distfiles for boost187
 DEBUG: Executing proc-pre-org.macports.fetch-fetch-0
 DEBUG: Executing proc-pre-org.macports.fetch-fetch-1
 DEBUG: mpi.enforce_variant list:
 DEBUG: Executing org.macports.fetch (boost187)
 DEBUG: Privilege de-escalation not attempted as not running as root.
 DEBUG: adding /opt/.TemporaryItems to allowed Sandbox paths
 DEBUG: checksum phase started at Mon Jan  6 11:34:02 -03 2025
 --->  Verifying checksums for boost187
 DEBUG: Executing org.macports.checksum (boost187)
 --->  Checksumming boost_1_87_0.tar.bz2
 DEBUG: Calculated (rmd160) is f7fc065a57b0daee8cdae3befd7de0ec2799d99b
 DEBUG: Correct (rmd160) checksum for boost_1_87_0.tar.bz2
 DEBUG: Calculated (sha256) is
 af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89
 DEBUG: Correct (sha256) checksum for boost_1_87_0.tar.bz2
 DEBUG: Calculated (size) is 131473200
 DEBUG: Correct (size) checksum for boost_1_87_0.tar.bz2
 }}}

 After trying to figure out what happened, I realized that I had not, in
 fact, ran portindex between creating the portfile, and trying to fetch it.
 I figure it worked because I was inside the directory with the Portfile.

 So I went to the root of this source I use for my custom ports, ran
 portindex, and from then on, the the command failed as expected:

 {{{
 #!shell
 $ port -d checksum boost187
 DEBUG: Copying /Users/Koji/Library/Preferences/com.apple.dt.Xcode.plist to
 /opt/local/var/macports/home/Library/Preferences
 DEBUG: Opening port in directory: /opt/portfiles/devel/boost187
 DEBUG: OS darwin/22.6.0 (macOS 13.7.2) arch i386
 DEBUG: Sourcing PortGroup compiler_blacklist_versions 1.0 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/compiler_blacklist_versions-1.0.tcl
 DEBUG: Sourcing PortGroup active_variants 1.1 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/active_variants-1.1.tcl
 DEBUG: GCC versions for Darwin 22 i386 - 10 11 12 13 14 devel
 DEBUG: Clang versions for Darwin 22 i386 - 9.0 10 11 12 13 14 15 16 17 18
 19 devel
 DEBUG: Sourcing PortGroup compilers 1.0 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/compilers-1.0.tcl
 DEBUG: Sourcing PortGroup mpi 1.0 from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/group/mpi-1.0.tcl
 DEBUG: PortGroup active_variants 1.1 included previously, not sourcing
 again
 DEBUG: compiler clang 1500.1.0.2.5 not blacklisted because it doesn't
 match {clang < 1000}
 DEBUG: Reading variant descriptions from
 /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/_resources/port1.0/variant_descriptions.conf
 DEBUG: removing universal variant due to < 2 supported universal_archs
 DEBUG: Requested variant -universal is not provided by port boost187.
 DEBUG: Requested variant -x11 is not provided by port boost187.
 DEBUG: Requested variant +quartz is not provided by port boost187.
 DEBUG: Executing variant python312 provides python312
 DEBUG: Executing variant no_static provides no_static
 DEBUG: Executing variant no_single provides no_single
 DEBUG: Running callback portconfigure::add_automatic_compiler_dependencies
 DEBUG: Finished running callback
 portconfigure::add_automatic_compiler_dependencies
 DEBUG: Running callback portbuild::add_automatic_buildsystem_dependencies
 DEBUG: Finished running callback
 portbuild::add_automatic_buildsystem_dependencies
 DEBUG: Running callback portstartupitem::add_notes
 DEBUG: Finished running callback portstartupitem::add_notes
 DEBUG: Running callback compilers::add_fortran_legacy_support
 DEBUG: Finished running callback compilers::add_fortran_legacy_support
 DEBUG: Attempting ln -sf
 /opt/local/var/macports/build/_opt_portfiles_devel_boost187/boost187/work
 /opt/portfiles/devel/boost187/work
 DEBUG: dropping privileges: euid changed to 503, egid changed to 501.
 DEBUG: Starting logging for boost187
 @1.87.0_11+no_single+no_static+python312
 DEBUG: macOS 13.7.2 (darwin/22.6.0) arch i386
 DEBUG: MacPorts 2.10.5
 DEBUG: Xcode 15.2, CLT none
 DEBUG: SDK 13
 DEBUG: MACOSX_DEPLOYMENT_TARGET: 12.0
 DEBUG: adding /opt/.TemporaryItems to allowed Sandbox paths
 DEBUG: Executing org.macports.main (boost187)
 DEBUG: dropping privileges: euid changed to 503, egid changed to 501.
 DEBUG: Privilege de-escalation not attempted as not running as root.
 DEBUG: adding /opt/.TemporaryItems to allowed Sandbox paths
 DEBUG: fetch phase started at Mon Jan  6 11:35:04 -03 2025
 --->  Fetching distfiles for boost187
 DEBUG: Executing proc-pre-org.macports.fetch-fetch-0
 DEBUG: Executing proc-pre-org.macports.fetch-fetch-1
 DEBUG: mpi.enforce_variant list:
 DEBUG: Executing org.macports.fetch (boost187)
 DEBUG: Privilege de-escalation not attempted as not running as root.
 DEBUG: adding /opt/.TemporaryItems to allowed Sandbox paths
 DEBUG: checksum phase started at Mon Jan  6 11:35:04 -03 2025
 --->  Verifying checksums for boost187
 DEBUG: Executing org.macports.checksum (boost187)
 --->  Checksumming boost_1_87_0.tar.bz2
 DEBUG: Calculated (rmd160) is f7fc065a57b0daee8cdae3befd7de0ec2799d99b
 Error: Checksum (rmd160) mismatch for boost_1_87_0.tar.bz2
 Portfile checksum: boost_1_87_0.tar.bz2 rmd160
 2af2e4c8653eaf2e5b874c707151bfdfc5bf0005
 Distfile checksum: boost_1_87_0.tar.bz2 rmd160
 f7fc065a57b0daee8cdae3befd7de0ec2799d99b
 DEBUG: Calculated (sha256) is
 af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89
 Error: Checksum (sha256) mismatch for boost_1_87_0.tar.bz2
 Portfile checksum: boost_1_87_0.tar.bz2 sha256
 1bed88e40401b2cb7a1f76d4bab499e352fa4d0c5f31c0dbae64e24d34d7513b
 Distfile checksum: boost_1_87_0.tar.bz2 sha256
 af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89
 DEBUG: Calculated (size) is 131473200
 Error: Checksum (size) mismatch for boost_1_87_0.tar.bz2
 Portfile checksum: boost_1_87_0.tar.bz2 size 126220652
 Distfile checksum: boost_1_87_0.tar.bz2 size 131473200
 The correct checksum line may be:
 checksums           rmd160  f7fc065a57b0daee8cdae3befd7de0ec2799d99b \
                     sha256
 af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89 \
                     size    131473200
 Error: Failed to checksum boost187: Unable to verify file checksums
 DEBUG: Error code: NONE
 DEBUG: Backtrace: Unable to verify file checksums
     while executing
 "$procedure $targetname"
 Error: See
 /opt/local/var/macports/logs/_opt_portfiles_devel_boost187/boost187/main.log
 for details.
 Error: Follow https://guide.macports.org/#project.tickets if you believe
 there is a bug.
 Error: Processing of port boost187 failed
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/71772>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list