public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/1] nix: add a simple flake nix shell
@ 2023-12-05  0:55 Vincenzo Palazzo
  2023-12-05  1:02 ` Andrew Pinski
  0 siblings, 1 reply; 15+ messages in thread
From: Vincenzo Palazzo @ 2023-12-05  0:55 UTC (permalink / raw)
  To: gcc-patches; +Cc: Vincenzo Palazzo

This commit is specifically targeting enhancements in
Nix support for GCC development. This initiative stems
from the recognized need within our community for a more
streamlined and efficient development process when using Nix.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
---
 flake.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 flake.nix  | 35 +++++++++++++++++++++++++++++++
 2 files changed, 95 insertions(+)
 create mode 100644 flake.lock
 create mode 100644 flake.nix

diff --git a/flake.lock b/flake.lock
new file mode 100644
index 00000000000..de713ff0da9
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,60 @@
+{
+  "nodes": {
+    "flake-utils": {
+      "inputs": {
+        "systems": "systems"
+      },
+      "locked": {
+        "lastModified": 1694529238,
+        "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1696095070,
+        "narHash": "sha256-iDx02dT+OHYYgaRGJxp2HXvzSHkA9l8/3O8GJB2wttU=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "1f0e8ac1f9a783c4cfa0515483094eeff4315fe2",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "nixpkgs": "nixpkgs"
+      }
+    },
+    "systems": {
+      "locked": {
+        "lastModified": 1681028828,
+        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+        "owner": "nix-systems",
+        "repo": "default",
+        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-systems",
+        "repo": "default",
+        "type": "github"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 00000000000..b0ff1915adc
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,35 @@
+{
+  description = "gcc compiler";
+
+  inputs = {
+    nixpkgs.url = "github:nixos/nixpkgs";
+    flake-utils.url = "github:numtide/flake-utils";
+  };
+
+  outputs = { self, nixpkgs, flake-utils }:
+    flake-utils.lib.eachDefaultSystem (system:
+      let pkgs = nixpkgs.legacyPackages.${system};
+      in {
+        packages = {
+          default = pkgs.gnumake;
+        };
+        formatter = pkgs.nixpkgs-fmt;
+
+        devShell = pkgs.mkShell {
+          buildInputs = [
+            pkgs.gnumake
+            pkgs.gcc13
+
+            pkgs.gmp
+            pkgs.libmpc
+            pkgs.mpfr
+            pkgs.isl
+            pkgs.pkg-config
+            pkgs.autoconf-archive
+            pkgs.autoconf
+            pkgs.automake
+          ];
+        };
+      }
+    );
+}
-- 
2.43.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  0:55 [RFC PATCH 1/1] nix: add a simple flake nix shell Vincenzo Palazzo
@ 2023-12-05  1:02 ` Andrew Pinski
  2023-12-05  1:07   ` Jeff Law
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Pinski @ 2023-12-05  1:02 UTC (permalink / raw)
  To: Vincenzo Palazzo; +Cc: gcc-patches

On Mon, Dec 4, 2023 at 4:58 PM Vincenzo Palazzo
<vincenzopalazzodev@gmail.com> wrote:
>
> This commit is specifically targeting enhancements in
> Nix support for GCC development. This initiative stems
> from the recognized need within our community for a more
> streamlined and efficient development process when using Nix.

I think this is wrong place for this.

>
> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
> ---
>  flake.lock | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  flake.nix  | 35 +++++++++++++++++++++++++++++++
>  2 files changed, 95 insertions(+)
>  create mode 100644 flake.lock
>  create mode 100644 flake.nix
>
> diff --git a/flake.lock b/flake.lock
> new file mode 100644
> index 00000000000..de713ff0da9
> --- /dev/null
> +++ b/flake.lock
> @@ -0,0 +1,60 @@
> +{
> +  "nodes": {
> +    "flake-utils": {
> +      "inputs": {
> +        "systems": "systems"
> +      },
> +      "locked": {
> +        "lastModified": 1694529238,
> +        "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
> +        "owner": "numtide",
> +        "repo": "flake-utils",
> +        "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
> +        "type": "github"
> +      },
> +      "original": {
> +        "owner": "numtide",
> +        "repo": "flake-utils",
> +        "type": "github"
> +      }
> +    },
> +    "nixpkgs": {
> +      "locked": {
> +        "lastModified": 1696095070,
> +        "narHash": "sha256-iDx02dT+OHYYgaRGJxp2HXvzSHkA9l8/3O8GJB2wttU=",
> +        "owner": "nixos",
> +        "repo": "nixpkgs",
> +        "rev": "1f0e8ac1f9a783c4cfa0515483094eeff4315fe2",
> +        "type": "github"
> +      },
> +      "original": {
> +        "owner": "nixos",
> +        "repo": "nixpkgs",
> +        "type": "github"
> +      }
> +    },
> +    "root": {
> +      "inputs": {
> +        "flake-utils": "flake-utils",
> +        "nixpkgs": "nixpkgs"
> +      }
> +    },
> +    "systems": {
> +      "locked": {
> +        "lastModified": 1681028828,
> +        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
> +        "owner": "nix-systems",
> +        "repo": "default",
> +        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
> +        "type": "github"
> +      },
> +      "original": {
> +        "owner": "nix-systems",
> +        "repo": "default",
> +        "type": "github"
> +      }
> +    }
> +  },
> +  "root": "root",
> +  "version": 7
> +}
> diff --git a/flake.nix b/flake.nix
> new file mode 100644
> index 00000000000..b0ff1915adc
> --- /dev/null
> +++ b/flake.nix
> @@ -0,0 +1,35 @@
> +{
> +  description = "gcc compiler";
> +
> +  inputs = {
> +    nixpkgs.url = "github:nixos/nixpkgs";
> +    flake-utils.url = "github:numtide/flake-utils";
> +  };
> +
> +  outputs = { self, nixpkgs, flake-utils }:
> +    flake-utils.lib.eachDefaultSystem (system:
> +      let pkgs = nixpkgs.legacyPackages.${system};
> +      in {
> +        packages = {
> +          default = pkgs.gnumake;
> +        };
> +        formatter = pkgs.nixpkgs-fmt;
> +
> +        devShell = pkgs.mkShell {
> +          buildInputs = [
> +            pkgs.gnumake
> +            pkgs.gcc13
> +
> +            pkgs.gmp
> +            pkgs.libmpc
> +            pkgs.mpfr
> +            pkgs.isl
> +            pkgs.pkg-config
> +            pkgs.autoconf-archive
> +            pkgs.autoconf
> +            pkgs.automake
> +          ];
> +        };
> +      }
> +    );
> +}
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  1:02 ` Andrew Pinski
@ 2023-12-05  1:07   ` Jeff Law
  2023-12-05  1:38     ` Vincenzo Palazzo
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Law @ 2023-12-05  1:07 UTC (permalink / raw)
  To: Andrew Pinski, Vincenzo Palazzo; +Cc: gcc-patches



On 12/4/23 18:02, Andrew Pinski wrote:
> On Mon, Dec 4, 2023 at 4:58 PM Vincenzo Palazzo
> <vincenzopalazzodev@gmail.com> wrote:
>>
>> This commit is specifically targeting enhancements in
>> Nix support for GCC development. This initiative stems
>> from the recognized need within our community for a more
>> streamlined and efficient development process when using Nix.
> 
> I think this is wrong place for this.
+1.  I think this is best left to the distros.

jeff

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  1:07   ` Jeff Law
@ 2023-12-05  1:38     ` Vincenzo Palazzo
  2023-12-05  1:54       ` Jeff Law
  0 siblings, 1 reply; 15+ messages in thread
From: Vincenzo Palazzo @ 2023-12-05  1:38 UTC (permalink / raw)
  To: Jeff Law; +Cc: Andrew Pinski, gcc-patches

Ciao all,

>+1.  I think this is best left to the distros.

What do you mean? this is not a package, it is an env shell in order
to build an work on GCC on NixOS.

NixOS has already the packages for GCC

Cheers,

   Vincent.

On Tue, Dec 5, 2023 at 2:07 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
>
> On 12/4/23 18:02, Andrew Pinski wrote:
> > On Mon, Dec 4, 2023 at 4:58 PM Vincenzo Palazzo
> > <vincenzopalazzodev@gmail.com> wrote:
> >>
> >> This commit is specifically targeting enhancements in
> >> Nix support for GCC development. This initiative stems
> >> from the recognized need within our community for a more
> >> streamlined and efficient development process when using Nix.
> >
> > I think this is wrong place for this.
> +1.  I think this is best left to the distros.
>
> jeff

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  1:38     ` Vincenzo Palazzo
@ 2023-12-05  1:54       ` Jeff Law
  2023-12-05  2:01         ` Vincenzo Palazzo
  0 siblings, 1 reply; 15+ messages in thread
From: Jeff Law @ 2023-12-05  1:54 UTC (permalink / raw)
  To: Vincenzo Palazzo; +Cc: Andrew Pinski, gcc-patches



On 12/4/23 18:38, Vincenzo Palazzo wrote:
> Ciao all,
> 
>> +1.  I think this is best left to the distros.
> 
> What do you mean? this is not a package, it is an env shell in order
> to build an work on GCC on NixOS.
> 
Distro build procedures are not something the GCC project generally gets 
involved with.

jeff

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  1:54       ` Jeff Law
@ 2023-12-05  2:01         ` Vincenzo Palazzo
  2023-12-05  2:02           ` Vincenzo Palazzo
  2023-12-05  4:25           ` Eli Schwartz
  0 siblings, 2 replies; 15+ messages in thread
From: Vincenzo Palazzo @ 2023-12-05  2:01 UTC (permalink / raw)
  To: Jeff Law; +Cc: Andrew Pinski, gcc-patches

>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.

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 because
it does not have apt or pacman or any other kind of package manager.

Cheers,

   Vincent.

On Tue, Dec 5, 2023 at 2:54 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
>
>
>
> On 12/4/23 18:38, Vincenzo Palazzo wrote:
> > Ciao all,
> >
> >> +1.  I think this is best left to the distros.
> >
> > What do you mean? this is not a package, it is an env shell in order
> > to build an work on GCC on NixOS.
> >
> Distro build procedures are not something the GCC project generally gets
> involved with.
>
> jeff

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  2:01         ` Vincenzo Palazzo
@ 2023-12-05  2:02           ` Vincenzo Palazzo
  2023-12-05  4:25           ` Eli Schwartz
  1 sibling, 0 replies; 15+ messages in thread
From: Vincenzo Palazzo @ 2023-12-05  2:02 UTC (permalink / raw)
  To: Jeff Law; +Cc: Andrew Pinski, gcc-patches

However, I understand your point.

Cheers,

   Vincent.

On Tue, Dec 5, 2023 at 3:01 AM Vincenzo Palazzo
<vincenzopalazzodev@gmail.com> 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.
>
> 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 because
> it does not have apt or pacman or any other kind of package manager.
>
> Cheers,
>
>    Vincent.
>
> On Tue, Dec 5, 2023 at 2:54 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
> >
> >
> >
> > On 12/4/23 18:38, Vincenzo Palazzo wrote:
> > > Ciao all,
> > >
> > >> +1.  I think this is best left to the distros.
> > >
> > > What do you mean? this is not a package, it is an env shell in order
> > > to build an work on GCC on NixOS.
> > >
> > Distro build procedures are not something the GCC project generally gets
> > involved with.
> >
> > jeff

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  2:01         ` Vincenzo Palazzo
  2023-12-05  2:02           ` Vincenzo Palazzo
@ 2023-12-05  4:25           ` Eli Schwartz
  2023-12-05  8:59             ` Richard Biener
  1 sibling, 1 reply; 15+ messages in thread
From: Eli Schwartz @ 2023-12-05  4:25 UTC (permalink / raw)
  To: Vincenzo Palazzo, gcc-patches

On 12/4/23 9:01 PM, Vincenzo Palazzo wrote:
> On Tue, Dec 5, 2023 at 2:54 AM Jeff Law <jeffreyalaw@gmail.com> 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 because
> 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 your
"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.


-- 
Eli Schwartz


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  4:25           ` Eli Schwartz
@ 2023-12-05  8:59             ` Richard Biener
  2023-12-05 10:35               ` Vincenzo Palazzo
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Biener @ 2023-12-05  8:59 UTC (permalink / raw)
  To: Eli Schwartz; +Cc: Vincenzo Palazzo, gcc-patches

On Tue, Dec 5, 2023 at 5:26 AM Eli Schwartz <eschwartz93@gmail.com> wrote:
>
> On 12/4/23 9:01 PM, Vincenzo Palazzo wrote:
> > On Tue, Dec 5, 2023 at 2:54 AM Jeff Law <jeffreyalaw@gmail.com> 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 because
> > 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 your
> "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
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05  8:59             ` Richard Biener
@ 2023-12-05 10:35               ` Vincenzo Palazzo
  2023-12-05 12:43                 ` Eli Schwartz
  0 siblings, 1 reply; 15+ messages in thread
From: Vincenzo Palazzo @ 2023-12-05 10:35 UTC (permalink / raw)
  To: Richard Biener; +Cc: Eli Schwartz, gcc-patches

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 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Tue, Dec 5, 2023 at 5:26 AM Eli Schwartz <eschwartz93@gmail.com> wrote:
> >
> > On 12/4/23 9:01 PM, Vincenzo Palazzo wrote:
> > > On Tue, Dec 5, 2023 at 2:54 AM Jeff Law <jeffreyalaw@gmail.com> 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 because
> > > 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 your
> > "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
> >

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05 10:35               ` Vincenzo Palazzo
@ 2023-12-05 12:43                 ` Eli Schwartz
  2023-12-11 16:10                   ` Vincenzo Palazzo
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Schwartz @ 2023-12-05 12:43 UTC (permalink / raw)
  To: Vincenzo Palazzo, gcc-patches

On 12/5/23 5:35 AM, Vincenzo Palazzo wrote:
>>> 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".
> 
> 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.


And yet, it seems your original point was that this doesn't qualify as a
"distro build procedure" because nix isn't specific to NixOS.

Are you backing down from that opinion and deciding that this proposal
is, indeed, after all specific to NixOS and only NixOS and is neither
needed nor used on any other distro?


> 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.


Its lack of completeness is surely an issue, but not the issue at hand
*here*. Why do you think the lack of completeness is a supporting
argument, rather than an opposing argument?


-- 
Eli Schwartz


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2023-12-05 12:43                 ` Eli Schwartz
@ 2023-12-11 16:10                   ` Vincenzo Palazzo
  0 siblings, 0 replies; 15+ messages in thread
From: Vincenzo Palazzo @ 2023-12-11 16:10 UTC (permalink / raw)
  To: Eli Schwartz; +Cc: gcc-patches

Hi all,

>Are you backing down from that opinion and deciding that this proposal
is, indeed, after all specific to NixOS and only NixOS and is neither
needed nor used on any other distro?

I may be misreading the conversation, so let's restart it.

Why should my RFC be inside the distro's repository? What makes this a distro
build package? and not a developer configuration for building a
development environment?

Cheers,

   Vincent.

On Tue, Dec 5, 2023 at 1:43 PM Eli Schwartz <eschwartz93@gmail.com> wrote:
>
> On 12/5/23 5:35 AM, Vincenzo Palazzo wrote:
> >>> 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".
> >
> > 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.
>
>
> And yet, it seems your original point was that this doesn't qualify as a
> "distro build procedure" because nix isn't specific to NixOS.
>
> Are you backing down from that opinion and deciding that this proposal
> is, indeed, after all specific to NixOS and only NixOS and is neither
> needed nor used on any other distro?
>
>
> > 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.
>
>
> Its lack of completeness is surely an issue, but not the issue at hand
> *here*. Why do you think the lack of completeness is a supporting
> argument, rather than an opposing argument?
>
>
> --
> Eli Schwartz
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2024-01-31 22:19 ` Eli Schwartz
@ 2024-02-01 21:04   ` Vincenzo Palazzo
  0 siblings, 0 replies; 15+ messages in thread
From: Vincenzo Palazzo @ 2024-02-01 21:04 UTC (permalink / raw)
  To: Eli Schwartz; +Cc: gcc-patches

Hi Eli,

Yeah sorry I forgot to tag with -v2, so I am creating a -v3, after a while that
I do not use email to send patches I get a little bit rusty.

Thanks for your useful feedback, I am sending the v3 now.

Cheers,

   Vincent.


On Wed, Jan 31, 2024 at 11:19 PM Eli Schwartz <eschwartz93@gmail.com> wrote:
>
> On 1/31/24 4:43 PM, Vincenzo Palazzo wrote:
> > This commit is specifically targeting enhancements in
> > Nix support for GCC development. This initiative stems
> > from the recognized need within our community for a more
> > streamlined and efficient development process when using Nix.
> >
> > Please not that in this case the Nix tool is used to define
> > what should be in the dev environment, and not as a NixOS distro
> > package manager.
> >
> > Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
> > ---
>
>
> I was originally trying to figure out what the idea behind this patch
> was, as I recalled discussing the patch before. Then I double checked
> the mailing list and saw:
>
> https://inbox.sourceware.org/gcc-patches/20240131214259.142253-1-vincenzopalazzodev@gmail.com/T/#u
>
> One thing that can potentially reduce confusion here is:
>
> - use git send-email -v2 to mark the patch as an update to an existing
>   patch.
>
> - Use the --annotate option, and edit the patch before sending it. Right
>   here, after the "---" and in the same semantic patch section as the
>   diffstat, you can put arbitrary non-patch commentary. It is
>   essentially comments for patches -- it won't be included in the commit
>   message when the patch is applied with `git am`. It is common to
>   insert something that looks like this:
>
>
> v2: moved the flake to contrib/ instead of installing it at the root of
> the repository
>
>
>
> >  .gitignore            |  1 +
> >  contrib/nix/flake.nix | 35 +++++++++++++++++++++++++++++++++++
> >  2 files changed, 36 insertions(+)
> >  create mode 100644 contrib/nix/flake.nix
> >
> > diff --git a/.gitignore b/.gitignore
> > index 93a16b0b950..801b1d1709e 100644
> > --- a/.gitignore
> > +++ b/.gitignore
>
>
>
> --
> Eli Schwartz

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [RFC PATCH 1/1] nix: add a simple flake nix shell
  2024-01-31 21:43 Vincenzo Palazzo
@ 2024-01-31 22:19 ` Eli Schwartz
  2024-02-01 21:04   ` Vincenzo Palazzo
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Schwartz @ 2024-01-31 22:19 UTC (permalink / raw)
  To: Vincenzo Palazzo, gcc-patches


[-- Attachment #1.1.1: Type: text/plain, Size: 1762 bytes --]

On 1/31/24 4:43 PM, Vincenzo Palazzo wrote:
> This commit is specifically targeting enhancements in
> Nix support for GCC development. This initiative stems
> from the recognized need within our community for a more
> streamlined and efficient development process when using Nix.
> 
> Please not that in this case the Nix tool is used to define
> what should be in the dev environment, and not as a NixOS distro
> package manager.
> 
> Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
> ---


I was originally trying to figure out what the idea behind this patch
was, as I recalled discussing the patch before. Then I double checked
the mailing list and saw:

https://inbox.sourceware.org/gcc-patches/20240131214259.142253-1-vincenzopalazzodev@gmail.com/T/#u

One thing that can potentially reduce confusion here is:

- use git send-email -v2 to mark the patch as an update to an existing
  patch.

- Use the --annotate option, and edit the patch before sending it. Right
  here, after the "---" and in the same semantic patch section as the
  diffstat, you can put arbitrary non-patch commentary. It is
  essentially comments for patches -- it won't be included in the commit
  message when the patch is applied with `git am`. It is common to
  insert something that looks like this:


v2: moved the flake to contrib/ instead of installing it at the root of
the repository



>  .gitignore            |  1 +
>  contrib/nix/flake.nix | 35 +++++++++++++++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100644 contrib/nix/flake.nix
> 
> diff --git a/.gitignore b/.gitignore
> index 93a16b0b950..801b1d1709e 100644
> --- a/.gitignore
> +++ b/.gitignore



-- 
Eli Schwartz

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 18399 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [RFC PATCH 1/1] nix: add a simple flake nix shell
@ 2024-01-31 21:43 Vincenzo Palazzo
  2024-01-31 22:19 ` Eli Schwartz
  0 siblings, 1 reply; 15+ messages in thread
From: Vincenzo Palazzo @ 2024-01-31 21:43 UTC (permalink / raw)
  To: gcc-patches, eschwartz93; +Cc: Vincenzo Palazzo

This commit is specifically targeting enhancements in
Nix support for GCC development. This initiative stems
from the recognized need within our community for a more
streamlined and efficient development process when using Nix.

Please not that in this case the Nix tool is used to define
what should be in the dev environment, and not as a NixOS distro
package manager.

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
---
 .gitignore            |  1 +
 contrib/nix/flake.nix | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 contrib/nix/flake.nix

diff --git a/.gitignore b/.gitignore
index 93a16b0b950..801b1d1709e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.patch
 *.orig
 *.rej
+*.lock
 
 *~
 .#*
diff --git a/contrib/nix/flake.nix b/contrib/nix/flake.nix
new file mode 100644
index 00000000000..b0ff1915adc
--- /dev/null
+++ b/contrib/nix/flake.nix
@@ -0,0 +1,35 @@
+{
+  description = "gcc compiler";
+
+  inputs = {
+    nixpkgs.url = "github:nixos/nixpkgs";
+    flake-utils.url = "github:numtide/flake-utils";
+  };
+
+  outputs = { self, nixpkgs, flake-utils }:
+    flake-utils.lib.eachDefaultSystem (system:
+      let pkgs = nixpkgs.legacyPackages.${system};
+      in {
+        packages = {
+          default = pkgs.gnumake;
+        };
+        formatter = pkgs.nixpkgs-fmt;
+
+        devShell = pkgs.mkShell {
+          buildInputs = [
+            pkgs.gnumake
+            pkgs.gcc13
+
+            pkgs.gmp
+            pkgs.libmpc
+            pkgs.mpfr
+            pkgs.isl
+            pkgs.pkg-config
+            pkgs.autoconf-archive
+            pkgs.autoconf
+            pkgs.automake
+          ];
+        };
+      }
+    );
+}
-- 
2.43.0


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-02-01 21:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05  0:55 [RFC PATCH 1/1] nix: add a simple flake nix shell Vincenzo Palazzo
2023-12-05  1:02 ` Andrew Pinski
2023-12-05  1:07   ` Jeff Law
2023-12-05  1:38     ` Vincenzo Palazzo
2023-12-05  1:54       ` Jeff Law
2023-12-05  2:01         ` Vincenzo Palazzo
2023-12-05  2:02           ` Vincenzo Palazzo
2023-12-05  4:25           ` Eli Schwartz
2023-12-05  8:59             ` Richard Biener
2023-12-05 10:35               ` Vincenzo Palazzo
2023-12-05 12:43                 ` Eli Schwartz
2023-12-11 16:10                   ` Vincenzo Palazzo
2024-01-31 21:43 Vincenzo Palazzo
2024-01-31 22:19 ` Eli Schwartz
2024-02-01 21:04   ` Vincenzo Palazzo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).