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
Contributor

@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

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;
@Kiwi Kiwi force-pushed the Kiwi:fix-librecad branch from e0408c4 to e558749 Jan 9, 2020
Copy link
Member

@worldofpeace worldofpeace left a comment

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 Kiwi:fix-librecad branch 2 times, most recently from 24c1f2f to ee43000 Jan 9, 2020
@worldofpeace
Copy link
Member

@worldofpeace worldofpeace commented Jan 9, 2020

@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
@Kiwi Kiwi force-pushed the Kiwi:fix-librecad branch from ee43000 to e0f6da5 Jan 9, 2020
@worldofpeace worldofpeace merged commit ed165ad into NixOS:master Jan 9, 2020
14 of 15 checks passed
14 of 15 checks passed
librecad on x86_64-linux
Details
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A darwin-tested
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release-combined.nix -A tested
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
librecad on aarch64-linux Success
Details
@worldofpeace
Copy link
Member

@worldofpeace worldofpeace commented Jan 9, 2020

Cool thanks @Kiwi

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

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.