Opened 4 years ago

Closed 3 years ago

#56195 closed defect (fixed)

cargo downloads files during build phase

Reported by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) Owned by: Marcus Calhoun-Lopez <marcuscalhounlopez@…>
Priority: Normal Milestone:
Component: ports Version:
Keywords: haspatch Cc: cgilles (HumanDynamo)
Port: cargo

Description

Attached is a patch that prevents cargo from downloading files during the build phase.
Unfortunately, I was also attempting to allow cargo to build universal, and the two fixes got mixed together.
If need be, I can try to separate the two changes.

The strategy used in the patch file is essentially the same as used by gentoo.
The redefinition of portfetch::assemble_url is an extremely ugly hack, but even gentoo had to do something similar with the function cargo_crate_uris.

Attachments (2)

Portfile.diff (28.4 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 4 years ago.
main.log (10.5 KB) - added by letaage 4 years ago.
Log file of cargo failure to download shell-escape v0.1.4

Download all attachments as: .zip

Change History (19)

Changed 4 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: Portfile.diff added

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

Please use path:bin/cmake:cmake instead of bin:cmake:cmake.

Please don't override portfetch::assemble_url. Use the ?dummy= trick instead; see PortfileRecipes#fetchwithgetparams.

Could this use the new cargo portgroup, instead of reimplementing a lot of what it does?

comment:2 Changed 4 years ago by cgilles (HumanDynamo)

I confirm the problem while to while digiKam MacOS bundle :

--->  Staging rust into destroot
--->  Installing rust @1.24.1_2
--->  Activating rust @1.24.1_2
--->  Cleaning rust
--->  Fetching distfiles for cargo
--->  Attempting to fetch cargo-0.25.0.tar.gz from https://distfiles.macports.org/cargo
--->  Attempting to fetch cargo-0.24.0-x86_64-apple-darwin.tar.gz from https://distfiles.macports.org/cargo
--->  Verifying checksums for cargo
--->  Extracting cargo
--->  Applying patches to cargo
--->  Configuring cargo
--->  Building cargo
Error: Failed to build cargo: command execution failed
Error: See /opt/digikam/var/macports/logs/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port ffmpeg failed
--->  Some of the ports you installed have notes:
  dbus has the following notes:
############################################################################
# Startup items were not installed for dbus
# Some programs which depend on dbus might not function properly.
# To load dbus manually, run
#
# launchctl load -w /opt/digikam/Library/LaunchDaemons/org.freedesktop.dbus-system.plist
# launchctl load -w /opt/digikam/Library/LaunchAgents/org.freedesktop.dbus-session.plist
############################################################################
  eigen3 has the following notes:
This product includes software developed by the University of Chicago, as Operator of Argonne National Laboratory.
  python36 has the following notes:
To make this the default Python or Python 3 (i.e., the version run by the 'python' or 'python3' commands), run one or both of:

    sudo port select --set python python36
    sudo port select --set python3 python36
FAILED COMMAND: port install cmake libpng jpeg tiff boost eigen3 gettext libusb libgphoto2 jasper lcms2 expat libxml2 libxslt libical lensfun bison ffmpeg sane-backends qt58 qt58-qtimageformats qt58-qtwebkit qt58-sqlite-plugin qt58-mysql-plugin qt58-qtscript wget +ssl
Last edited 4 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:3 Changed 4 years ago by cgilles (HumanDynamo)

:debug:extract setting option extract.args to '/opt/digikam/var/macports/distfiles/cargo/cargo-0.25.0.tar.gz'
:debug:extract Environment: 
:debug:extract CC_PRINT_OPTIONS='YES'
:debug:extract CC_PRINT_OPTIONS_FILE='/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/.CC_PRINT_OPTIONS'
:debug:extract CPATH='/opt/digikam/include'
:debug:extract LIBRARY_PATH='/opt/digikam/lib'
:debug:extract MACOSX_DEPLOYMENT_TARGET='10.8'
:info:extract Executing:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work" && /usr/bin/gzip -dc '/opt/digikam/var/macports/distfiles/cargo/cargo-0.25.0.tar.gz' | /usr/bin/tar -xf - 
:debug:extract system:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work" && /usr/bin/gzip -dc '/opt/digikam/var/macports/distfiles/cargo/cargo-0.25.0.tar.gz' | /usr/bin/tar -xf - 
:info:extract --->  Extracting cargo-0.24.0-x86_64-apple-darwin.tar.gz
:debug:extract setting option extract.args to '/opt/digikam/var/macports/distfiles/cargo/cargo-0.24.0-x86_64-apple-darwin.tar.gz'
:debug:extract Environment: 
:debug:extract CC_PRINT_OPTIONS='YES'
:debug:extract CC_PRINT_OPTIONS_FILE='/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/.CC_PRINT_OPTIONS'
:debug:extract CPATH='/opt/digikam/include'
:debug:extract LIBRARY_PATH='/opt/digikam/lib'
:debug:extract MACOSX_DEPLOYMENT_TARGET='10.8'
:info:extract Executing:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work" && /usr/bin/gzip -dc '/opt/digikam/var/macports/distfiles/cargo/cargo-0.24.0-x86_64-apple-darwin.tar.gz' | /usr/bin/tar -xf - 
:debug:extract system:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work" && /usr/bin/gzip -dc '/opt/digikam/var/macports/distfiles/cargo/cargo-0.24.0-x86_64-apple-darwin.tar.gz' | /usr/bin/tar -xf - 
:debug:extract Executing proc-post-org.macports.extract-extract-0
:debug:patch patch phase started at Thu Apr  5 19:36:32 CEST 2018
:debug:patch Executing org.macports.patch (cargo)
:notice:patch --->  Applying patches to cargo
:info:patch --->  Applying path-dyld.diff
:debug:patch Environment: 
:debug:patch CC_PRINT_OPTIONS='YES'
:debug:patch CC_PRINT_OPTIONS_FILE='/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/.CC_PRINT_OPTIONS'
:debug:patch CPATH='/opt/digikam/include'
:debug:patch LIBRARY_PATH='/opt/digikam/lib'
:debug:patch MACOSX_DEPLOYMENT_TARGET='10.8'
:info:patch Executing:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /usr/bin/patch -p0 < '/opt/digikam/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/cargo/files/path-dyld.diff'
:debug:patch system:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /usr/bin/patch -p0 < '/opt/digikam/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/cargo/files/path-dyld.diff'
:info:patch patching file src/cargo/util/paths.rs
:debug:configure configure phase started at Thu Apr  5 19:36:32 CEST 2018
:notice:configure --->  Configuring cargo
:debug:configure Preferred compilers: clang macports-clang-4.0
:debug:configure Using compiler 'Xcode Clang'
:debug:configure Executing org.macports.configure (cargo)
:debug:build build phase started at Thu Apr  5 19:36:32 CEST 2018
:notice:build --->  Building cargo
:debug:build Executing org.macports.build (cargo)
:debug:build Environment: 
:debug:build CC='/usr/bin/clang'
:debug:build CC_PRINT_OPTIONS='YES'
:debug:build CC_PRINT_OPTIONS_FILE='/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/.CC_PRINT_OPTIONS'
:debug:build CPATH='/opt/digikam/include'
:debug:build CXX='/usr/bin/clang++'
:debug:build LIBRARY_PATH='/opt/digikam/lib'
:debug:build MACOSX_DEPLOYMENT_TARGET='10.8'
:debug:build OPENSSL_DIR='/opt/digikam'
:info:build Executing:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.24.0-x86_64-apple-darwin/cargo/bin/cargo build --release -j8 
:debug:build system:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.24.0-x86_64-apple-darwin/cargo/bin/cargo build --release -j8 
:info:build     Updating registry `https://github.com/rust-lang/crates.io-index`
:info:build error: failed to load source for a dependency on `atty`
:info:build Caused by:
:info:build   Unable to update registry `https://github.com/rust-lang/crates.io-index`
:info:build Caused by:
:info:build   failed to fetch `https://github.com/rust-lang/crates.io-index`
:info:build Caused by:
:info:build   [16/-1] unexpected return value from ssl handshake -9808
:info:build Command failed:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.24.0-x86_64-apple-darwin/cargo/bin/cargo build --release -j8 
:info:build Exit code: 101
:error:build Failed to build cargo: command execution failed
:debug:build Error code: CHILDSTATUS 96587 101
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:debug:build could not read "/opt/digikam/share/rust/ctags.rust": no such file or directory
:debug:build     while executing
:debug:build "::file type $file"
:error:build See /opt/digikam/var/macports/logs/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/main.log for details.
Last edited 4 years ago by ryandesign (Ryan Schmidt) (previous) (diff)

comment:4 Changed 4 years ago by cgilles (HumanDynamo)

Cc: cgilles added

comment:5 Changed 4 years ago by raimue (Rainer Müller)

Please use WikiFormatting and attach large log files instead of pasting them as comment.

This seems to be an unrelated problem with cargo:

:info:build     Updating registry `https://github.com/rust-lang/crates.io-index`
:info:build error: failed to load source for a dependency on `atty`
:info:build Caused by:
:info:build   Unable to update registry `https://github.com/rust-lang/crates.io-index`
:info:build Caused by:
:info:build   failed to fetch `https://github.com/rust-lang/crates.io-index`
:info:build Caused by:
:info:build   [16/-1] unexpected return value from ssl handshake -9808

Probably the well-known problem that OS X 10.8 does not support TLS 1.2, but it is required by github.com and many other servers on the internet.

comment:6 Changed 4 years ago by cgilles (HumanDynamo)

ok, so it's another backward compatibility issue, even if i compile uner MacOS 10.13.4...

Gilles Caulier

comment:7 Changed 4 years ago by raimue (Rainer Müller)

I may have misinterpreted your MACOSX_DEPLOYMENT_TARGET=10.8. In any case, it is a different bug. Please open a new ticket if you want to discuss it.

comment:8 Changed 4 years ago by dbevans (David B. Evans)

In 2662a8d96ad1b5de6fea7c8c2d63ba5a3b2b6055/macports-ports:

librsvg: also use pre-cargo version for 10.8

Cargo build fails on 10.8 due to known SSL/TLS handshake issues with github.com.

See #56195

comment:9 Changed 4 years ago by cgilles (HumanDynamo)

I turn OSX backward compatibility to 10.13, just to be sure that all compile fine with Cargo port in this case. In fact it doesn't :

:info:patch --->  Applying path-dyld.diff
:debug:patch Environment: 
:debug:patch CC_PRINT_OPTIONS='YES'
:debug:patch CC_PRINT_OPTIONS_FILE='/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/.CC_PRINT_OPTIONS'
:debug:patch CPATH='/opt/digikam/include'
:debug:patch LIBRARY_PATH='/opt/digikam/lib'
:debug:patch MACOSX_DEPLOYMENT_TARGET='10.13'
:info:patch Executing:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /usr/bin/patch -p0 < '/opt/digikam/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/cargo/files/path-dyld.diff'
:debug:patch system:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /usr/bin/patch -p0 < '/opt/digikam/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/cargo/files/path-dyld.diff'
:info:patch patching file src/cargo/util/paths.rs
:debug:configure configure phase started at Fri Apr  6 09:45:36 CEST 2018
:notice:configure --->  Configuring cargo
:debug:configure Preferred compilers: clang macports-clang-4.0
:debug:configure Using compiler 'Xcode Clang'
:debug:configure Executing org.macports.configure (cargo)
:debug:build build phase started at Fri Apr  6 09:45:36 CEST 2018
:notice:build --->  Building cargo
:debug:build Executing org.macports.build (cargo)
:debug:build Environment: 
:debug:build CC='/usr/bin/clang'
:debug:build CC_PRINT_OPTIONS='YES'
:debug:build CC_PRINT_OPTIONS_FILE='/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/.CC_PRINT_OPTIONS'
:debug:build CPATH='/opt/digikam/include'
:debug:build CXX='/usr/bin/clang++'
:debug:build LIBRARY_PATH='/opt/digikam/lib'
:debug:build MACOSX_DEPLOYMENT_TARGET='10.13'
:debug:build OPENSSL_DIR='/opt/digikam'
:info:build Executing:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.24.0-x86_64-apple-darwin/cargo/bin/cargo build --release -j8 
:debug:build system:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.24.0-x86_64-apple-darwin/cargo/bin/cargo build --release -j8 
:info:build     Updating registry `https://github.com/rust-lang/crates.io-index`
:info:build error: failed to load source for a dependency on `atty`
:info:build Caused by:
:info:build   Unable to update registry `https://github.com/rust-lang/crates.io-index`
:info:build Caused by:
:info:build   failed to fetch `https://github.com/rust-lang/crates.io-index`
:info:build Caused by:
:info:build   [16/-1] unexpected return value from ssl handshake -9808
:info:build Command failed:  cd "/opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.25.0" && /opt/digikam/var/macports/build/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/work/cargo-0.24.0-x86_64-apple-darwin/cargo/bin/cargo build --release -j8 
:info:build Exit code: 101
:error:build Failed to build cargo: command execution failed
:debug:build Error code: CHILDSTATUS 65133 101
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:debug:build could not read "/opt/digikam/share/rust/ctags.rust": no such file or directory
:debug:build     while executing
:debug:build "::file type $file"
:error:build See /opt/digikam/var/macports/logs/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/main.log for details.

comment:10 Changed 4 years ago by cgilles (HumanDynamo)

Note : Cargo failure always appear when ffmpeg port is installed :

--->  Computing dependencies for bison
--->  Cleaning bison
--->  Computing dependencies for ffmpeg
--->  Dependencies to be installed: librsvg cargo gdk-pixbuf2 gobject-introspection py27-mako py27-beaker py27-funcsigs py27-setuptools py27-markupsafe shared-mime-info intltool gnome-common autoconf-archive p5.26-getopt-long p5.26-pathtools p5.26-scalar-list-utils p5.26-xml-parser p5.26-libwww-perl p5.26-encode-locale p5.26-file-listing p5.26-http-date p5.26-html-form p5.26-html-parser p5.26-html-tagset p5.26-http-message p5.26-io-html p5.26-lwp-mediatypes p5.26-try-tiny p5.26-capture-tiny p5.26-sub-name p5.26-devel-checkbin p5.26-extutils-makemaker p5.26-cpan-meta-requirements p5.26-extutils-manifest p5.26-uri p5.26-test-needs p5.26-http-cookies p5.26-http-daemon p5.26-http-negotiate p5.26-lwp-protocol-https p5.26-io-socket-ssl p5.26-io-socket-inet6 p5.26-io p5.26-socket6 p5.26-io-socket-ip p5.26-socket p5.26-mozilla-ca p5.26-net-libidn libidn p5.26-net-ssleay p5.26-test-exception p5.26-sub-uplevel p5.26-test-nowarnings p5.26-test-warn p5.26-net-http p5.26-test-fatal p5.26-test-requiresinternet p5.26-www-robotrules libcroco pango Xft2 harfbuzz graphite2 vala flex lzip graphviz gts libnetpbm libLASi urw-fonts xorg-libXaw groff ghostscript jbig2dec libpaper netpbm jbigkit psutils xorg-libXmu libsdl2 libtheora libvorbis libvpx clang-3.9 clang_select ld64 ld64-latest libmacho-headers llvm-5.0 libomp llvm-3.9 nasm openjpeg soxr speex x264 x265
--->  Building cargo
Error: Failed to build cargo: command execution failed
Error: See /opt/digikam/var/macports/logs/_opt_digikam_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cargo/cargo/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port ffmpeg failed
FAILED COMMAND: port install cmake libpng jpeg tiff boost eigen3 gettext libusb libgphoto2 jasper lcms2 expat libxml2 libxslt libical lensfun bison ffmpeg sane-backends qt59 qt59-qtimageformats qt59-qtwebkit qt59-sqlite-plugin qt59-mysql-plugin qt59-qtscript wget +ssl
bash-3.2$)

comment:11 Changed 4 years ago by cgilles (HumanDynamo)

Q: there is a way to drop support of Cargo with ffmpeg port. Cargo is really problematic here... Which ffmpeg variant need to be disabled in this case ?

Thanks in advance

Gilles Caulier

comment:12 Changed 4 years ago by seanfarley (Sean Farley)

Owner: sean@… deleted
Status: newassigned

Looking at the output of port -v rdeps digikam, it seems cargo is pulled in due to cairo. I have no idea what's going on in this thread and don't have the bandwidth for it at the moment.

Changed 4 years ago by letaage

Attachment: main.log added

Log file of cargo failure to download shell-escape v0.1.4

comment:13 Changed 4 years ago by letaage

I am also having trouble upgrading cargo on 10.8, failed to download shell-escape v0.1.4, fails with SSL error, log file attached

Last edited 4 years ago by letaage (previous) (diff)

comment:14 Changed 4 years ago by cgilles (HumanDynamo)

Note :

The SSL error is not only limited to MacOS 10.8. I can reproduce this error with MacOS 10.13.4 without backward compatibility...

Gilles Caulier

comment:15 Changed 4 years ago by raimue (Rainer Müller)

This ticket discusses an updated Portfile for cargo. Please file new tickets for issues with the current version of the port. These problems are not related.

comment:16 Changed 4 years ago by ryandesign (Ryan Schmidt)

cargo is a build system. It is used to build librsvg, as of librsvg version 2.42. ffmpeg declares a nonoptional dependency on librsvg. Therefore if you want ffmpeg, you will need cargo; there is no workaround.

comment:17 Changed 3 years ago by Marcus Calhoun-Lopez <marcuscalhounlopez@…>

Owner: set to Marcus Calhoun-Lopez <marcuscalhounlopez@…>
Resolution: fixed
Status: assignedclosed

In 0d4b18fbffaf6907796e78809f694c59e527902f/macports-ports (master):

split cargo PG into cargo and cargo_fetch

Fixes #56377
Fixes #56195

Note: See TracTickets for help on using tickets.