Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

librecad: fix build #77348

Merged
merged 1 commit into from Jan 9, 2020
Merged

librecad: fix build #77348

merged 1 commit into from Jan 9, 2020

Conversation

Kiwi
Copy link
Member

@Kiwi Kiwi commented Jan 8, 2020

recently this stopped building on nixos-unstable

a git bisect of nixpkgs revealed;

# first bad commit: [8f729c0070ec3f78edadeaebcbd110257fe4577e] gcc: switch default to gcc9

this switches the build to use gcc8Stdenv

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

Copy link
Contributor

@marsam marsam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you set gcc8Stdenv in all-packages.nix? i.e.

diff --git i/pkgs/top-level/all-packages.nix w/pkgs/top-level/all-packages.nix
index b331ee663be..7ef368f8517 100644
--- i/pkgs/top-level/all-packages.nix
+++ w/pkgs/top-level/all-packages.nix
@@ -19880,7 +19880,9 @@ in
 
   libowfat = callPackage ../development/libraries/libowfat { };
 
-  librecad = libsForQt5.callPackage ../applications/misc/librecad { };
+  librecad = libsForQt5.callPackage ../applications/misc/librecad {
+    stdenv = gcc8Stdenv;
+  };
 
   libreoffice = hiPrio libreoffice-still;
   libreoffice-unwrapped = libreoffice.libreoffice;

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use the qt5 namespace for its packages, and restore how it was before.
It's actually specifically in the documentation to do this, because libsForQt5.callPackage ensures the correct versions of the packages are in scope. This should also use mkDerivation and not stdenv.mkDerivation. (it's the qt5 specific one in scope).

@Kiwi Kiwi force-pushed the fix-librecad branch 2 times, most recently from 24c1f2f to ee43000 Compare January 9, 2020 19:30
@worldofpeace
Copy link
Contributor

@Kiwi Okay, so this is what should be done according to the docs. It's possible qt's mkDerivation will be deprecated eventually, let's not get ahead of ourselves.

diff --git a/pkgs/applications/misc/librecad/default.nix b/pkgs/applications/misc/librecad/default.nix
index 84db89fe38c..0df0f86ef45 100644
--- a/pkgs/applications/misc/librecad/default.nix
+++ b/pkgs/applications/misc/librecad/default.nix
@@ -1,7 +1,7 @@
 { boost
 , fetchFromGitHub
 , installShellFiles
-, mkDerivation
+, mkDerivationWith
 , muparser
 , pkgconfig
 , qmake
@@ -9,11 +9,15 @@
 , qtsvg
 , qttools
 , runtimeShell
-, stdenv
-, wrapQtAppsHook
+, gcc8Stdenv
 }:
 
-stdenv.mkDerivation rec {
+let
+  stdenv = gcc8Stdenv;
+in
+
+# Doesn't build with gcc9
+mkDerivationWith stdenv.mkDerivation rec {
   pname = "librecad";
   version = "2.2.0-rc1";
 
@@ -73,7 +77,6 @@ stdenv.mkDerivation rec {
     pkgconfig
     qmake
     qttools
-    wrapQtAppsHook
   ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 579c741be47..f6656969a19 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -19878,9 +19878,7 @@ in
 
   libowfat = callPackage ../development/libraries/libowfat { };
 
-  librecad = libsForQt5.callPackage ../applications/misc/librecad {
-    stdenv = gcc8Stdenv;
-  };
+  librecad = libsForQt5.callPackage ../applications/misc/librecad { };
 
   libreoffice = hiPrio libreoffice-still;
   libreoffice-unwrapped = libreoffice.libreoffice;
@@ -23699,8 +23697,8 @@ in
 
   bftools = callPackage ../applications/science/biology/bftools { };
 
-  blast = callPackage ../applications/science/biology/blast { 
-    inherit (darwin.apple_sdk.frameworks) ApplicationServices; 
+  blast = callPackage ../applications/science/biology/blast {
+    inherit (darwin.apple_sdk.frameworks) ApplicationServices;
   };
 
   cd-hit = callPackage ../applications/science/biology/cd-hit { };

recently this stopped building on nixos-unstable

a git bisect of nixpkgs revealed;

`# first bad commit: [8f729c0] gcc: switch default to gcc9`

this switches the build to use gcc8Stdenv
@worldofpeace worldofpeace merged commit ed165ad into NixOS:master Jan 9, 2020
@worldofpeace
Copy link
Contributor

Cool thanks @Kiwi

@Kiwi Kiwi deleted the fix-librecad branch January 10, 2020 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants