From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id +NjuEhnYH2aHSwEA62LTzQ:P1 (envelope-from ) for ; Wed, 17 Apr 2024 16:09:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id +NjuEhnYH2aHSwEA62LTzQ (envelope-from ) for ; Wed, 17 Apr 2024 16:09:29 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=kSSaq4+e; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713362969; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2oRnof/0tuqyHCsCmsKIvB0ZYbwCL47CNI96wWs/H2k=; b=tMO2vC027LecuWHzZa2afumIdOCxL20yJL1/c4gnEwaXrp0WIGzq8il912vj99jtDfqt7b 0vvK3O+hHKCcbGEMliPC7RZEIA+aQu8LMMBtTAaVqfbNlCL8vZ4+vudlN3uMlRLRA84med lj+YJ9mNRFpxZcsRbNpMshMLlECX5V9nsMGB18KyO2+ku4sykUqn8J+qNApMMOkjKEXKNh hJWeWNPCXbZT4J++P1IrNc4ogk1KO2BMFjSBjs8MutaCpzrcYXgWk8LdIUs9zup40HRJTC XvqtOBK4x5ATlP+P4fm4zosfJCdkfrG8nDZZtHRtpk2S3EO+V4eqkf7rxQBa6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=protonmail.com header.s=protonmail3 header.b=kSSaq4+e; dmarc=pass (policy=quarantine) header.from=protonmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713362969; a=rsa-sha256; cv=none; b=Pc4BC7yOTEvkR5wWSsJB77S+tg9qUXDmsjQ4fAOVysoxwg2ibILKSD9c8CGiuhNHPy1tXa Crg73/WmtGHpEkuBVwfT4RKK2EXrV8R/naA6rup7FpCiTuC19dqmcIurbpItj0idifmheD b/8xTLBwiBPNPzMfoN4Hd3G3dJg7OXMaoRVMxBIuQQVrTQaF/SFT/BEmX0rbcut+eh3kR3 xrN2jWYNcT1v5Hy+S7PRoUmMm9zljVHul5gq0OA9UJ5eVVc4Em/nnub7mZe0ZSNQa3BRiI aPZ7MU96NCK7CYhw5r+nIfxaAlsEDy39Ov/UWRZPBr3dLqAKW7Zm2PqkFxGqJQ== 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 E3FA7A81C for ; Wed, 17 Apr 2024 16:09:28 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rx5yA-0006zr-6v; Wed, 17 Apr 2024 10:09:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rx2XH-0002Wf-TF for help-guix@gnu.org; Wed, 17 Apr 2024 06:29:04 -0400 Received: from mail-4318.protonmail.ch ([185.70.43.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rx2XE-0004Pl-Tv for help-guix@gnu.org; Wed, 17 Apr 2024 06:29:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1713349736; x=1713608936; bh=2oRnof/0tuqyHCsCmsKIvB0ZYbwCL47CNI96wWs/H2k=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=kSSaq4+e0OGfqVD4Qn0QzJdKOubdJguUr7rRAa7T4/xfan8vv9xYXGSumswmQCbfZ QqRrN3FtYnAmfGTy3ntS+Ux0rk/i/QSdMTehGa/KNd/tvdJ0KO+1ionZVzYYU1Ksyh cPbITMCqj7D9nfbX4v+feDKWo9aukeZ+LM6pDXALwHl0Vv2xMhYJc8POyrnNmRmwZg 9W/V3STOwOiIHZZ64khaQMjuaJB+WfQ4YsEZjDuWgoyp0HU2dsAHjNKVrChS27zBPv d7+h26L7nstEnfca/22iamjmaKv6Y1aTbaC4/IENPBCMBCrzVxncYtkuOYIWMMy8C5 WoOzEa06xpurA== Date: Wed, 17 Apr 2024 10:28:51 +0000 To: "help-guix@gnu.org" From: Antoine Poinsot Subject: Bootstrappable Release Build of Rust Application Message-ID: Feedback-ID: 7060259:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.18; envelope-from=darosior@protonmail.com; helo=mail-4318.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 17 Apr 2024 10:09:00 -0400 X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -9.77 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -9.77 X-Migadu-Queue-Id: E3FA7A81C X-TUID: NlB2eqdByRvI Good morning all, I've been working on using Guix for the reproducible builds of my Rust soft= ware. My main question is about linking my program against an older glibc v= ersion (or better yet, statically linking it against musl). But first let m= e give a bit of context. We are developing a Rust software and releasing binaries. For Linux binarie= s we use Guix for reproducible release builds. We need to link against a re= asonable glibc version to support older systems. For the past year i've bee= n using a `guix shell` container in a `guix time-machine` in which i would = `cargo rustc` my project. This allowed us to target an older glibc, at the = expense of requiring compatibility with older rustc compilers. As new rustc= releases are frequent (and Rust libraries tend to require bleeding edge ve= rsions of the compiler...) i knew this was only a short-term solution. Well= , short term lasted a year and a half! Not bad. Now i need to do a proper G= uix packaging of my Rust program. To write the backbone of my package with the insane number of dependencies = a Rust project may have, i hacked a small program which would translate a `= Cargo.lock` into a `mypackage.scm`. Some of our dependencies are git repos,= and surprisingly `cargo-build-system` doesn't support them correctly (they= don't get unpacked in the vendor directory). This is only a small annoyanc= e, i can package them and upload them to crates.io myself. So far so good. Now this links against glibc 2.35. I need to target ideally 2.29 or at most= 2.31. That's what i'm seeking help for. I've tried the obvious: ``` guix build -f test2.scm --with-input=3Dglibc=3Dglibc@2.29 ``` But i immediately hit a dependency cycle on perl: ``` gnu/packages/perl.scm:106:2: error: perl@5.36.0: dependency cycle detected: perl@5.36.0 -> linux-libre-headers@5.15.49 -> glibc@2.29 -> glibc-utf8-lo= cales@2.35 -> coreutils@9.1 -> tar@1.34 -> perl@5.36.0 -> texinfo@6.8 -> gd= b@12.1 -> rust@1.75.0 -> liana_gui@5.0.0 ``` For what it's worth you can simply reproduce this with other crates. For in= stance trying to build the `log` crate will give the same error: ``` guix build rust-log --with-input=3Dglibc=3Dglibc@2.29 ``` Then i've tried using `with-c-toolchain` and `make-gcc-toolchain` (not sure= it would even help but i tried anyways): ``` (define gcc-toolchain-2.29 (make-gcc-toolchain gcc-7 glibc-2.29)) (package-with-c-toolchain rust-liana_gui-5.0.0 `(("toolchain" ,gcc-toolchai= n-2.29))) ``` This one keeps failing to compile no matter the flavour (different glibc / = gcc versions). For instance for gcc-7 + glibc-2.29: ``` g++ -std=3Dgnu++98 -no-pie -g -DIN_GCC -fno-exceptions -fno-rtti -fas= ynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qua= l -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wn= o-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAV= E_CONFIG_H -static-libstdc++ -static-libgcc -Wl,-rpath=3D/gnu/store/wry6srb= z3wr35kdqnwyls9ypkkfq172j-glibc-2.29/lib -Wl,-dynamic -linker -Wl,/gnu/store/wry6srbz3wr35kdqnwyls9ypkkfq172j-glibc-2.29/lib/ld-l= inux-x86-64.so.2 gcov-dump.o \ = = = = =20 hash-table.o ggc-none.o\ = = = = = =20 libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbacktrace= .a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -o gcov-dump = = = = =20 ld: /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_= 64-unknown-linux-gnu/11.3.0/../../../libstdc++.a(stdexcept.o): in function = `std::logic_error::~logic_error()': = = = =20 (.text._ZNSt11logic_errorD2Ev+0x43): undefined reference to `__libc_single_= threaded' = = = = =20 ld: /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_= 64-unknown-linux-gnu/11.3.0/../../../libstdc++.a(stdexcept.o): in function = `std::runtime_error::~runtime_error()': = = = =20 (.text._ZNSt13runtime_errorD2Ev+0x43): undefined reference to `__libc_singl= e_threaded' = = = = =20 ld: /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_= 64-unknown-linux-gnu/11.3.0/../../../libstdc++.a(stdexcept.o): in function = `std::logic_error::logic_error(std::string const&)': = = = =20 (.text._ZNSt11logic_errorC2ERKSs+0x63): undefined reference to `__libc_sing= le_threaded' = = = = =20 ld: /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_= 64-unknown-linux-gnu/11.3.0/../../../libstdc++.a(stdexcept.o): in function = `std::runtime_error::runtime_error(std::string const&)': = = = =20 (.text._ZNSt13runtime_errorC2ERKSs+0x63): undefined reference to `__libc_si= ngle_threaded' = = = = =20 ld: /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_= 64-unknown-linux-gnu/11.3.0/../../../libstdc++.a(cow-stdexcept.o): in funct= ion `_txnal_cow_string_D1_commit(void*)': = = = =20 (.text._Z27_txnal_cow_string_D1_commitPv+0x13): undefined reference to `__l= ibc_single_threaded' = = = = =20 ld: /gnu/store/930nwsiysdvy2x5zv1sf6v7ym75z8ayk-gcc-11.3.0-lib/lib/gcc/x86_= 64-unknown-linux-gnu/11.3.0/../../../libstdc++.a(cow-stdexcept.o):(.text._Z= NSt11logic_errorC2ERKS_+0x63): more undefined references to `__libc_single_= threaded' follow = = =20 g++ -std=3Dgnu++98 -no-pie -g -DIN_GCC -fno-exceptions -fno-rtti -fas= ynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qua= l -Wno-format -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wn= o-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAV= E_CONFIG_H -static-libstdc++ -static-libgcc -Wl,-rpath=3D/gnu/store/wry6srb= z3wr35kdqnwyls9ypkkfq172j-glibc-2.29/lib -Wl,-dynamic -linker -Wl,/gnu/store/wry6srbz3wr35kdqnwyls9ypkkfq172j-glibc-2.29/lib/ld-l= inux-x86-64.so.2 gcov-tool.o libgcov-util.o libgcov-driver-tool.o libgcov-m= erge-tool.o libcommon.a ../libcpp/libcpp.a ../libbacktrace/.libs/libbackt= race.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -o gcov-too= l = =20 collect2: error: ld returned 1 exit status = = = = = =20 make[3]: *** [Makefile:2851: gcov] Error 1 ``` But anyways would this help at all to have a gcc-toolchain with an older gl= ibc? Isn't this just building gcc against an older glibc? Would this also m= ake cargo-build-system link against this glibc? Finally, i've tried both with musl as well. In both cases it complains that= the musl package doesn't provide a "static" output. I'm running out of options to try here. Does anyone have any pointer on how= to link against an older glibc in Guix? Is it at all supposed to be suppor= ted without using the time-machine? Is my approach misguided? Any pointer o= r partial answer is appreciated, even if it's only "you clearly don't under= stand how Guix works go read resource X and Y and come back". Thanks, Antoine