From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IG+XGoLYvGC+eQAAgWs5BA (envelope-from ) for ; Sun, 06 Jun 2021 16:15:30 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id GHgOFoLYvGAufwAAbx9fmQ (envelope-from ) for ; Sun, 06 Jun 2021 14:15:30 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6487BA631 for ; Sun, 6 Jun 2021 16:15:26 +0200 (CEST) Received: from localhost ([::1]:43912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lptYj-0007MT-9f for larch@yhetil.org; Sun, 06 Jun 2021 10:15:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lptYY-0007K1-0Y for guix-devel@gnu.org; Sun, 06 Jun 2021 10:15:14 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:41627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lptYV-0000rh-5v for guix-devel@gnu.org; Sun, 06 Jun 2021 10:15:13 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Fydn64xlmz1s8dB for ; Sun, 6 Jun 2021 16:15:06 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Fydn62k3wz1qql2 for ; Sun, 6 Jun 2021 16:15:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 7WZ_utFKZGgZ for ; Sun, 6 Jun 2021 16:15:05 +0200 (CEST) Received: from hermia.goebel-consult.de (ppp-188-174-61-158.dynamic.mnet-online.de [188.174.61.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for ; Sun, 6 Jun 2021 16:15:05 +0200 (CEST) Received: from lenashee.goebel-consult.de (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id E6E8760204 for ; Sun, 6 Jun 2021 16:15:02 +0200 (CEST) From: Hartmut Goebel To: guix-devel Organization: crazy-compilers.com Subject: Some more rust/cargo insights Message-ID: <7d180f4a-3e5f-374b-0fcd-6ae5b438a1c8@crazy-compilers.com> Date: Sun, 6 Jun 2021 16:15:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------3995FA3A909BB036AA687206" Content-Language: en-US Received-SPF: none client-ip=212.18.0.10; envelope-from=h.goebel@crazy-compilers.com; helo=mail-out.m-online.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622988928; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=WN7ebWFHiVbbXA0uKBvxceyfWO9blHrKM8vLilON1MA=; b=kVyRztZcWWXDhI8hZXPpmvswAHfhOgmW3RMdZjnyVMeZATSxULkH6BlNvBk3F1iV1Hdm9G r0/7nZiqQey2uYImNytLsmVSdvKs/a7u5rlsUAivjvYU3g02zYY8MuniDbNrZdSIEyrpwj B6p0+vZJ7UkdwgtHVw3hGzB4mt9p1bH8PAimnXGAvExJ/7lSfZfk+RXL1+Ze1gEmmnx1yl Nj04vvMkiBi67xo/uiWDFMpqk0iqxcp3YqQMl2WIeKE1nDH1b0/OP3tt+iQ9ULqv4PubeT nQ1TjpgCjpmtlr1HJQaVHWESK031UQrr3C4ihlMRIoynTdURVF/nSIDPEHY/Kg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622988928; a=rsa-sha256; cv=none; b=Mkqzy9xavDI/WnaXkrYrf9Oj6HTAPZ8ExVcOfYcVTDb+30IZ6S7yyQJnNZxDud/zfwaQZP unjS/09bAMjqrnL+BX61y4pieTpy8oECFf1IBE/I+ZTtK+2Ux73fAcaXwlBUyc32mhKQd0 7EptV7NpzICZurZD/jEzyI+bMNzaEBygiKW7+MuA5WtPmgLlzNeKbDY6t3goP1IYa3Jz2c Dn0YwGPBHqg6ntIZtUwmjUGfaeUSy+vpz7aIzLCoIiIUGINxOslsORLJUk3PdGHGUI4tkD GMGECiHMjqwzPiCErEVZaL2SmR72W/GPOf2OI/OTpbfUIGkCup3h4+ZHlOH2Rw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 6487BA631 X-Spam-Score: -2.43 X-Migadu-Scanner: scn1.migadu.com X-TUID: UC13RmoZZlHP This is a multi-part message in MIME format. --------------3995FA3A909BB036AA687206 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi., these day I had spent some more hours struggling with rust ans cargo,=20 trying to get "pre-built" crates. Summery; Cargo is cruft, no solution found yet. I tried reusing a crate from the very same place it was built (see=20 enclosed script). Anyhow, this does not work since cargo uses a=20 different "metadata" value, even if noting changed. Based in the verbose = output (cargo build -v =E2=80=A6) I assume that some parameters of the=20 "destination" build get included into this value. This meets another observation; when building the sequoia suite, several = crates are build several times - even if all builds are performed in the = same environment. Rust's build system is such a cruft - I really would like to throw it=20 where it belongs: into the trash. --=20 Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | --------------3995FA3A909BB036AA687206 Content-Type: text/x-scheme; charset=UTF-8; name="rlib-test.scm" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="rlib-test.scm" (use-modules (guix download) (guix packages) (guix build-system cargo) (gnu packages crates-io) (srfi srfi-1) (srfi srfi-26) (gnu packages crates-graphics) (gnu packages rust-apps)) (define-public rust-pretty-assertions-0.5 (package (inherit rust-pretty-assertions-0.6) (name "rust-pretty-assertions") (version "0.5.1") (source (origin (method url-fetch) (uri (crate-uri "pretty_assertions" version)) (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 "1ins6swkpxmrh8q5h96h8nv0497d3dclsiyx2lyvqi6py0q980is")= ))) (build-system cargo-build-system) (arguments `(#:tests? #f #:cargo-inputs (("rust-ansi-term" ,rust-ansi-term-0.11) ("rust-difference" ,rust-difference-2)))))) ;; /gnu/store/wknzymkfbfjbxwfd3djrn4hk9zdfgs56-rust-xmlparser-0.13.3 -- o= riginal ;;=20 ;; libxmlparser-f82b201ea4144ed3.rlib (define-public myrust-xmlparser (package (inherit rust-xmlparser-0.13) (outputs '("out" "rlib")) (arguments `(#:skip-build? #f #:tests? #f #:cargo-build-flags (list "--release" "-vv") #:phases (modify-phases %standard-phases (add-after 'install 'install-rlib (lambda* (#:key outputs #:allow-other-keys) (let* ((rout (assoc-ref outputs "rlib")) (dest (string-append rout "/rlib"))) ;;(mkdir dest) ;;(for-each (cut install-file <> (string-append rout "/rli= b")) (for-each (lambda (fn) (install-file fn (string-append rout "/rlib"))= ) (find-files "target/release/deps" "\\.(rlib|rmet= a)$")) ))) ;; (add-after 'install 'fail ;; (lambda _ #f)) ))))) (define-public myrust-roxmltree (package (inherit rust-roxmltree-0.14) ;;(outputs '("out" "crate")) (inputs `(("rust-xmlparser" ,myrust-xmlparser "rlib"))) (arguments `(#:skip-build? #f #:tests? #f ;;#:vendor-dir "/tmp/src" #:cargo-build-flags (list "--release" "-vv") #:cargo-inputs (("rust-xmlparser:src" ,rust-xmlparser-0.13) ("rust-pretty-assertions" ,rust-pretty-assertions-0.5)) #:phases (modify-phases %standard-phases (add-after 'patch-cargo-checksums 'bring-in-rlib (lambda* (#:key inputs #:allow-other-keys) (let* ((rin (assoc-ref inputs "rust-xmlparser")) (src (assoc-ref inputs "rust-xmlparser")) (rlib (string-append rin "/rlib"))) (mkdir "/tmp/guix-build-rust-xmlparser-0.13.3.drv-0/") (copy-recursively "guix-vendor/rust-xmlparser-0.13.3.tar.gz" "/tmp/guix-build-rust-xmlparser-0.13.3.drv-0/xmlparser-0.1= 3.3") (rename-file "guix-vendor/rust-xmlparser-0.13.3.tar.gz" "../rust-xmlparser-0.13.3.tar.gz") (symlink "/tmp/guix-build-rust-xmlparser-0.13.3.drv-0/xmlparser-0.= 13.3" "guix-vendor/rust-xmlparser-0.13.3") ;; (let ((port (open-file ".cargo/config" "w" #:encoding "= utf-8"))) ;; (display " ;; #paths =3D [\"/tmp/guix-build-rust-xmlparser-0.13.3.drv-0/xmlparser-0.= 13.3\"] ;; [source.crates-io] ;; replace-with =3D 'vendored-sources' ;; #[patch.crates-io] ;; #xmlparser =3D { path =3D '/tmp/guix-build-rust-xmlparser-0.13.3.drv-0= /xmlparser-0.13.3' } ;; [source.vendored-sources] ;; directory =3D '" port) ;; (display (string-append (getcwd) "/guix-vendor") port= ) ;; (display "' ;; " port) ;; (close-port port)) ;; (substitute* ".cargo/config" ;; (("\\.vendored-sources\\]" _) ;; (string-append _ "\n[paths]")) (for-each (lambda (fn) (install-file fn "target/release/deps")) (pk (find-files rlib "\\.(rlib|rmeta)$"))) #t ))) (add-before 'install 'fail (lambda _ #f))) )))) ;;myrust-xmlparser myrust-roxmltree --------------3995FA3A909BB036AA687206--