From 26f198430a2d58c0fb518542f38045ea94bb2094 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 20:49:51 -0300 Subject: [PATCH 1/9] tinycc: add onemoresuza as maintainer --- pkgs/development/compilers/tinycc/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index a58af0c526fab..46944eeda2e2f 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -133,6 +133,7 @@ stdenv.mkDerivation (finalAttrs: { maintainers = with lib.maintainers; [ joachifm AndersonTorres + onemoresuza ]; platforms = lib.platforms.unix; # https://www.mail-archive.com/tinycc-devel@nongnu.org/msg10199.html From b738cb16187c5c2b619692a720ba4278b1b72762 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 19:49:50 -0300 Subject: [PATCH 2/9] tinycc: 0.9.27-unstable-2022-07-15 -> 0.9.27-unstable-2025-01-06 Fix checkPhase by making it instalCheckPhase, since tcc depends on libtcc1.a, which is build together with it, for its tests. Create dev, doc and lib outpus. Now the binaries, i. e., tcc and the cross compilers are what the user gets with tinycc.out. Make the recipe compliant with nixpkgs-hammer. Enable parallel building. --- pkgs/development/compilers/tinycc/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index 46944eeda2e2f..8ed0ff3ecdfba 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -11,12 +11,12 @@ stdenv.mkDerivation (finalAttrs: { pname = "tcc"; - version = "0.9.27-unstable-2022-07-15"; + version = "0.9.27-unstable-2025-01-06"; src = fetchFromRepoOrCz { repo = "tinycc"; - rev = "af1abf1f45d45b34f0b02437f559f4dfdba7d23c"; - hash = "sha256-jY0P2GErmo//YBaz6u4/jj/voOE3C2JaIDRmo0orXN8="; + rev = "f6385c05308f715bdd2c06336801193a21d69b50"; + hash = "sha256-tO3N+NplYy8QUOC2N3x0CO5Ui75j9bQzLSZQF1HQyhY="; }; outputs = [ @@ -96,7 +96,8 @@ stdenv.mkDerivation (finalAttrs: { ]; # Test segfault for static build - doCheck = !stdenv.hostPlatform.isStatic; + # doCheck = !stdenv.hostPlatform.isStatic; + doCheck = false; checkTarget = "test"; # https://www.mail-archive.com/tinycc-devel@nongnu.org/msg10142.html From aea636bd916b829b1a42103fc1be750d80493d37 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 20:06:16 -0300 Subject: [PATCH 3/9] fixup disable building of cross compilers --- pkgs/development/compilers/tinycc/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index 8ed0ff3ecdfba..4acbe69f684be 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -68,8 +68,6 @@ stdenv.mkDerivation (finalAttrs: { "--crtprefix=${lib.getLib stdenv.cc.libc}/lib" "--sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include" "--libpaths=${lib.getLib stdenv.cc.libc}/lib" - # build cross compilers - "--enable-cross" ] ++ lib.optionals stdenv.hostPlatform.isMusl [ "--config-musl" From 193455f72ded0bfc8c116b241693349f433462be Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 20:29:44 -0300 Subject: [PATCH 4/9] fixup add tcc static and dynamic libraries to --libpaths Without them, it is not possible to run tcc's tests, which, because of them, must be a installCheck phase. --- pkgs/development/compilers/tinycc/default.nix | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index 4acbe69f684be..6a02eacdcd156 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -8,7 +8,9 @@ texinfo, which, }: - +let + inherit (stdenv) buildPlatform hostPlatform; +in stdenv.mkDerivation (finalAttrs: { pname = "tcc"; version = "0.9.27-unstable-2025-01-06"; @@ -67,7 +69,9 @@ stdenv.mkDerivation (finalAttrs: { "--ar=$AR" "--crtprefix=${lib.getLib stdenv.cc.libc}/lib" "--sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include" - "--libpaths=${lib.getLib stdenv.cc.libc}/lib" + # The first libpath will be the one in which tcc will look for libtcc1.a, + # which is need for its tests. + "--libpaths=$out/lib/tcc:$out/lib:${lib.getLib stdenv.cc.libc}/lib" ] ++ lib.optionals stdenv.hostPlatform.isMusl [ "--config-musl" @@ -94,14 +98,14 @@ stdenv.mkDerivation (finalAttrs: { ]; # Test segfault for static build - # doCheck = !stdenv.hostPlatform.isStatic; - doCheck = false; - - checkTarget = "test"; + doInstallCheck = !hostPlatform.isStatic && buildPlatform.canExecute hostPlatform; + installCheckTarget = "test"; # https://www.mail-archive.com/tinycc-devel@nongnu.org/msg10142.html - preCheck = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' - rm tests/tests2/{108,114}* - ''; + preInstallCheck = + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) + '' + rm tests/tests2/{108,114}* + ''; meta = { homepage = "https://repo.or.cz/tinycc.git"; From 29fa360b7be9dee55eabc2f6d7f7a6bc54ea071b Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 20:42:04 -0300 Subject: [PATCH 5/9] fixup create dev, doc and lib outputs Now `out` provides only the tcc binary. --- pkgs/development/compilers/tinycc/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index 6a02eacdcd156..669aa5f74619f 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -22,9 +22,12 @@ stdenv.mkDerivation (finalAttrs: { }; outputs = [ - "out" + "dev" + "doc" "info" + "lib" "man" + "out" ]; nativeBuildInputs = [ @@ -71,7 +74,7 @@ stdenv.mkDerivation (finalAttrs: { "--sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include" # The first libpath will be the one in which tcc will look for libtcc1.a, # which is need for its tests. - "--libpaths=$out/lib/tcc:$out/lib:${lib.getLib stdenv.cc.libc}/lib" + "--libpaths=$lib/lib/tcc:$lib/lib:${lib.getLib stdenv.cc.libc}/lib" ] ++ lib.optionals stdenv.hostPlatform.isMusl [ "--config-musl" @@ -143,5 +146,4 @@ stdenv.mkDerivation (finalAttrs: { broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64; }; }) -# TODO: more multiple outputs # TODO: self-compilation From 125aa825d9f6ff04e9f8cdd768ee5092bfa35a08 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 20:58:50 -0300 Subject: [PATCH 6/9] fixup reenable building of cross compilers --- pkgs/development/compilers/tinycc/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index 669aa5f74619f..278e72a7349f5 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -75,6 +75,8 @@ stdenv.mkDerivation (finalAttrs: { # The first libpath will be the one in which tcc will look for libtcc1.a, # which is need for its tests. "--libpaths=$lib/lib/tcc:$lib/lib:${lib.getLib stdenv.cc.libc}/lib" + # build cross compilers + "--enable-cross" ] ++ lib.optionals stdenv.hostPlatform.isMusl [ "--config-musl" From 630f5bbf88342e7f196612c55f79a7f07db37fa6 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 20:47:41 -0300 Subject: [PATCH 7/9] fixup make recipe nixpkgs-hammer compliant --- pkgs/development/compilers/tinycc/default.nix | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index 278e72a7349f5..5546df9cfa099 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -8,19 +8,10 @@ texinfo, which, }: -let - inherit (stdenv) buildPlatform hostPlatform; -in stdenv.mkDerivation (finalAttrs: { pname = "tcc"; version = "0.9.27-unstable-2025-01-06"; - src = fetchFromRepoOrCz { - repo = "tinycc"; - rev = "f6385c05308f715bdd2c06336801193a21d69b50"; - hash = "sha256-tO3N+NplYy8QUOC2N3x0CO5Ui75j9bQzLSZQF1HQyhY="; - }; - outputs = [ "dev" "doc" @@ -30,6 +21,12 @@ stdenv.mkDerivation (finalAttrs: { "out" ]; + src = fetchFromRepoOrCz { + repo = "tinycc"; + rev = "f6385c05308f715bdd2c06336801193a21d69b50"; + hash = "sha256-tO3N+NplYy8QUOC2N3x0CO5Ui75j9bQzLSZQF1HQyhY="; + }; + nativeBuildInputs = [ copyPkgconfigItems perl @@ -62,10 +59,6 @@ stdenv.mkDerivation (finalAttrs: { (makePkgconfigItem libtcc-pcitem) ]; - postPatch = '' - patchShebangs texi2pod.pl - ''; - configureFlags = [ "--cc=$CC" @@ -82,6 +75,19 @@ stdenv.mkDerivation (finalAttrs: { "--config-musl" ]; + env.NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=implicit-int" + "-Wno-error=int-conversion" + ]; + + # Test segfault for static build + doInstallCheck = + !stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + postPatch = '' + patchShebangs texi2pod.pl + ''; + preConfigure = let # To avoid "malformed 32-bit x.y.z" error on mac when using clang @@ -97,14 +103,8 @@ stdenv.mkDerivation (finalAttrs: { configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)") ''; - env.NIX_CFLAGS_COMPILE = toString [ - "-Wno-error=implicit-int" - "-Wno-error=int-conversion" - ]; - - # Test segfault for static build - doInstallCheck = !hostPlatform.isStatic && buildPlatform.canExecute hostPlatform; installCheckTarget = "test"; + # https://www.mail-archive.com/tinycc-devel@nongnu.org/msg10142.html preInstallCheck = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) From f137aebea231ad93c5ad3ac6c179c160ddf4e3fe Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 21:01:32 -0300 Subject: [PATCH 8/9] fixup enable parallel building --- pkgs/development/compilers/tinycc/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index 5546df9cfa099..0afe5e6e0a5a3 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -75,6 +75,8 @@ stdenv.mkDerivation (finalAttrs: { "--config-musl" ]; + enableParallelBuilding = true; + env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=implicit-int" "-Wno-error=int-conversion" From 22c6e0f5300f4d3ff8a8793a24b4c4e1e9d80718 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 21:31:02 -0300 Subject: [PATCH 9/9] fixup add release note for new outputs --- doc/release-notes/rl-2505.section.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 956d9fb754e9c..ed68560d37fc4 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -18,6 +18,9 @@ - [`lib.types.enum`](https://nixos.org/manual/nixos/unstable/#sec-option-types-basic): Previously the `functor.payload` was the list of enum values directly. Now it is an attribute set containing the values in the `values` attribute. - [`lib.types.separatedString`](https://nixos.org/manual/nixos/unstable/#sec-option-types-string): Previously the `functor.payload` was the seperator directly. Now it is an attribute set containing the seperator in the `sep` attribute. +- The `tinycc` package now has the `dev`, `doc` and `lib` outputs, thus, +`tinycc.out` may now only provide the tcc and cross compilers binaries. + - The `virtualisation.hypervGuest.videoMode` option has been removed. Standard tooling can now be used to configure display modes for Hyper-V VMs. ### Deprecations {#sec-nixpkgs-release-25.05-lib-deprecations}