From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id AA92C3858424 for ; Tue, 5 Dec 2023 10:35:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA92C3858424 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AA92C3858424 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::22f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701772516; cv=none; b=F9XvPcRjOgRv+GzdMBRio6yRspNBObR6TA2TEKltR7ZclHYDUCNSl/LJG0ArhIAOwmVEHm10Bo5joN5FGcUAmcfrLEmT/xi9sOFTSCsBP0DKKxim6JE6fQfbKbBMZTi8pXEyF7GTACDNZt1jx4QqJ9RZGTo4qoIKPwHg7zlSlf4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701772516; c=relaxed/simple; bh=SxiK6yN1jjoEUG51GBAm0+Z8i5N6hmMpaOYgI2+9arU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=sGWEpPxDi2lfxsD/qHF+sw6KSNuJ8Wt/A8d27tiAWuDm9ba4EFGrK5unj9S9MVKhqV1ZW0TVKvCo7VVybX/JLfzcKsX/6TuMWApk/To6bGR6rfnYq6jhD+E4GSqFC/f1a8k1rNQyF0kIQcz/h4q4vhnIZdYzqS6+uuqU4JjQv8Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2c9fdf53abcso21246841fa.1 for ; Tue, 05 Dec 2023 02:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701772513; x=1702377313; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=iSMR/vG1lnYC7m41C3Ttur+Hap+FlM6c761gXcUozpA=; b=nAxK3+MluGpAPnmPvOLTLFVQXUXMJPTYgCHzenxgOrun7youT9qCcBCZtRGckn8LU8 XodG/juX0OVKHTIaqFhPHpLCfV+Ka7KRGb+p+TT1di0f29D9gce5bxFlgztKB30JXdxr Ypd4p5oRUdH29M9Jai/cNPS8IvQRXnIR9c91tyHNIv2Lk+G92FO+2Qsoa7bLLek12VZy nVhclMktxUravhd4+F6/GKnJWnIq2fZUCslwNbSyCngk152ste9oznn/6bTxYPdWpE1v A4z8i8SJrjdLFPVUI0HcUZ/Jwy1GKs0p8r///sfmzq07CxuPboIasn3KK13wreEGvF7H 5A1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701772513; x=1702377313; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iSMR/vG1lnYC7m41C3Ttur+Hap+FlM6c761gXcUozpA=; b=XA4gCM5qULXWkYc9IMf37LYyu5wnupo3oH1IHMCHA8TJv1TRMB0F0FMyfQs8BE8joJ RO8cS9kaIC5DRLlD1lgt4c3Xrz9flzy8Ugt/Q+wpBxQHSAHlfkJ6LAu6fWyMPj1z4b6H Kzg3Azv0my9F0/ZHtSiHNeyh+LNJmbWZ0V6fDMpVGSaqqElC9b6V2c2b/p+IGEtBmMvH 7UGbZ2yGHCjDMGAwSFqmoYOvqdmN4cYsoZV9p06RmJxCUNGW98O0auYeMvzgEZtsv7k5 QDbYwuHyHS2pTvN0Vt4GVka2jaUrw/mmAPPI8DlTL/ydV21jfoVmcZGloY7ZJoizzjHW HVHA== X-Gm-Message-State: AOJu0YwCR97huJHFmZbL+MJZxQvalmR8yhgZyrXMJl/1JJdwHfaSJBoB Pj44S+nMVoWEZMaYwsJDLIbqn/tWjvbU1yTTDyE= X-Google-Smtp-Source: AGHT+IFg8dXUpc+YPfXMuyqZUqsXsNWI3j7RPhbmv8kw2d4sX0/bjIqwGqCLOZlOz4k8y+dYOP5TVQsxdgYcfPL/agQ= X-Received: by 2002:a2e:82d5:0:b0:2c9:f89c:d964 with SMTP id n21-20020a2e82d5000000b002c9f89cd964mr771957ljh.1.1701772512285; Tue, 05 Dec 2023 02:35:12 -0800 (PST) MIME-Version: 1.0 References: <20231205005541.38072-1-vincenzopalazzodev@gmail.com> <3bc43468-b91a-4a1c-a3d7-8ff96caf3c50@gmail.com> In-Reply-To: From: Vincenzo Palazzo Date: Tue, 5 Dec 2023 11:35:00 +0100 Message-ID: Subject: Re: [RFC PATCH 1/1] nix: add a simple flake nix shell To: Richard Biener Cc: Eli Schwartz , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi all, >Generally we have various stuff in contrib/, one of it scripts like gcc_build. IMHO the flake.nix file (or a script to create it) could be put there as well. I was not sure about that, I will try to see what if I can put in there >But you can do the same with various other distro build procedures too? >e.g. Gentoo Prefix allows you to install a full-blown Gentoo anywhere you like, "by using portage". With a single difference on Gentoo you are allowed to put stuff in the global path and use it from a terminal like `$ pacman -Sy foo`. On nix os you do not, because the development environment is used for that. So all the nice dependencies that gcc required to build can not be installed in NixOS global pat (e.g libc) so in NixOS you should define the development environment otherwise you can do the build. Instead in all the other systems that you mention you can do. Please note that the flake.nix does not define how to build gcc, but just what are the dependencies that gcc is required in order to contribute to the compiler. In other words, is you run the flake.nix on NixOS or any other system you do not have gcc installed on your system, this is the job of the distro. Cheers, Vincent. On Tue, Dec 5, 2023 at 10:03=E2=80=AFAM Richard Biener wrote: > > On Tue, Dec 5, 2023 at 5:26=E2=80=AFAM Eli Schwartz wrote: > > > > On 12/4/23 9:01 PM, Vincenzo Palazzo wrote: > > > On Tue, Dec 5, 2023 at 2:54=E2=80=AFAM Jeff Law wrote: > > >> Distro build procedures are not something the GCC project generally = gets > > >> involved with. > > > > > > I see, but to me, this do not look like a distro build procedure, > > > because you can use > > > with any kind of system (OSX/UNIX) by using nix. > > > > > > But you can do the same with various other distro build procedures too? > > > > e.g. Gentoo Prefix allows you to install a full-blown gentoo anywhere > > you like, "by using portage". > > > > But also by the same token, I can just install pacman or rpm or dpkg on > > any system, and use the recipe executor just without requiring a > > database of installed packages. > > > > > > > I disagree with you just because my patch is not building a package > > > but is just giving > > > an agnostic way to develop with GCC. OFC is most useful with NixOs be= cause > > > it does not have apt or pacman or any other kind of package manager. > > > > > > I'm not entirely sure what this statement means (unless you are saying > > that nix isn't a package manager and NixOS doesn't have any package > > manager)? > > > > But I'd actually go one step further. It looks like this "flake.nix" > > file is the NixOS specific equivalent of a README.md which says "to > > install the software, you must first install XX, YY, and ZZ using your > > system package manager. Often they will have names such as XX-devel and > > suchlike". > > > > Which for GCC would be https://gcc.gnu.org/install/prerequisites.html -= - > > this page actually lists a bunch of things I don't see mentioned in you= r > > "flake.nix" file so I suspect that it won't, in fact, produce a good > > development environment for developing GCC. > > > > I don't think it's the job of the GCC maintainers to maintain special > > snowflake integrations with niche linux distros, whether those > > integrations work or not. But, if it *was* the job of the GCC > > maintainers, perhaps it would be better to make a script: > > > > `tools/setup-development-env.sh $distro` > > > > which could abstract away all of this for any distro, not just a niche = one. > > Generally we have various stuff in contrib/, one of it scripts like > gcc_build. IMHO the flake.nix file (or a script to create it) could be > put there as well. > > Richard. > > > > > -- > > Eli Schwartz > >