-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
prusa-slicer: 2.8.0 -> 2.8.1 #358215
base: master
Are you sure you want to change the base?
prusa-slicer: 2.8.0 -> 2.8.1 #358215
Conversation
Result of 4 packages failed to build:
4 packages built:
|
The 4 packages that fail to build with nixpkgs-review also seem to fail to build on |
Would I be able to get some advice on this PR please? This is my first nix PR, be gentle :) |
Hi, I made a PR upstream to fix all these build issues. I expect it to be merged with the next alpha of 2.9.0, but it might be the case that it's backported to 2.8.*. Note that it replaces the patches used in the current derivation for 2.8.0, and sidesteps some of the more hacky solutions used elsewhere. See the issue for extensive discussions on what the problems were and why this is the right approach. In any case, here is my overlay that incorporates all the fixes. final: prev:
(prev.prusa-slicer.override {
opencascade-occt_7_6 = prev.opencascade-occt_7_6.overrideAttrs {
version = "7.6.1";
src = prev.fetchurl {
name = "occt-V7_6_1.tar.gz";
url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=V7_6_1;sf=tgz";
hash = "sha256-PZVrLSbR7nWsArIeg47YtHMdnpFAHK5K80VbVrAA9W0=";
};
};
}).overrideAttrs (final: old: rec {
version = "2.8.1";
src = prev.fetchFromGitHub {
owner = "prusa3d";
repo = "PrusaSlicer";
hash = "sha256-nMLZvvZLIOChCLn8A9sOph1lqWsHb00eTG8z98/l0C8=";
rev = "version_${version}";
};
buildInputs = old.buildInputs ++ [ prev.webkitgtk_4_0 ];
prePatch = old.prePatch + ''
rm cmake/modules/FindEigen3.cmake
rm cmake/modules/FindDBus.cmake
'';
patches = [
(prev.writeText "linker-fixes.patch" ''
--- a/src/libslic3r/CMakeLists.txt
+++ b/src/libslic3r/CMakeLists.txt
@@ -596,6 +596,7 @@ target_link_libraries(libslic3r PUBLIC
libigl
agg
ankerl
+ boost_headeronly
)
if (APPLE)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -246,7 +246,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
- find_package(DBus REQUIRED)
+ find_package(DBus1 REQUIRED)
endif()
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
--- a/src/slic3r/CMakeLists.txt
+++ b/src/slic3r/CMakeLists.txt
@@ -383,6 +383,7 @@ set(SLIC3R_GUI_SOURCES
)
find_package(NanoSVG REQUIRED)
+find_package(OpenSSL REQUIRED)
if (APPLE)
list(APPEND SLIC3R_GUI_SOURCES
@@ -438,6 +439,9 @@ target_link_libraries(
NanoSVG::nanosvgrast
stb_dxt
fastfloat
+ OpenSSL::SSL
+ OpenSSL::Crypto
+ boost_headeronly
)
if (MSVC))
@@ -443,7 +443,7 @@ target_link_libraries(
if (MSVC)
target_link_libraries(libslic3r_gui PUBLIC Setupapi.lib)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
- target_link_libraries(libslic3r_gui PUBLIC ''${DBUS_LIBRARIES})
+ target_link_libraries(libslic3r_gui PUBLIC ''${DBus1_LIBRARIES})
elseif (APPLE)
target_link_libraries(libslic3r_gui PUBLIC ''${DISKARBITRATION_LIBRARY} ''${COREWLAN_LIBRARY})
endif()
'')
];
}) (For reference, the only additional patch needed for 2.9.0-alpha1 is this (prev.writeText "boost-filesystem.patch" ''
--- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp
+++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
@@ -120,7 +120,7 @@ BackgroundSlicingProcess::~BackgroundSlicingProcess()
std::string prefix = boost::filesystem::path(m_temp_output_path).filename().string();
prefix = prefix.substr(0, prefix.find('_'));
for (const auto& entry : boost::filesystem::directory_iterator(temp_dir)) {
- if (entry.is_regular_file()) {
+ if (boost::filesystem::is_regular_file(entry.path())) {
const std::string filename = entry.path().filename().string();
if (boost::starts_with(filename, prefix) && boost::ends_with(filename, ".gcode"))
boost::filesystem::remove(entry);
'') ) One nitpick for discussion, should a derivation for |
Reading through your patch, it seems you arrived at pretty much the same conclusions, although we solved them differently: Disabling the broken For the
I also suggest we turn off building of tests:
This is what the derivation for e.g. |
@jmickelin Wow, thank you for such an in-depth comment! I'm a fairly new NixOS user, and haven't really worked with C++ build processes before, so attempting to hack together this update really felt like I was biting off more than I could chew. But anyway, lots of frantic Googling later, I seem to stumbled into a combination of things that have sort-of worked. I appreciate your pick-up of the fact that I've just overridden the OCCT version inline. I've basically just copied over what I had in a local overlay into the nix-pkgs repo, so that's my bad. I'll work through my patch file and the overlay that you've provided to come up with a bit of a better fix over the next day or so. Thanks once again :) |
Thanks to you too! I was deliberating on creating a PR for nixpkgs, since I've never done it before. Actually I am kind of relieved that you beat me to it :D |
Tested it and works! |
Nitpick: Note that these lines in the patch don't do anything (whether we use the diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31cb4c0ff..42c38102c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -371,10 +373,13 @@ endif()
# boost::process was introduced first in version 1.64.0,
# boost::beast::detail::base64 was introduced first in version 1.66.0
set(MINIMUM_BOOST_VERSION "1.66.0")
-set(_boost_components "system;filesystem;thread;log;locale;regex;chrono;atomic;date_time;iostreams;nowide")
+# set(Boost_USE_STATIC_LIBS ON)
+find_package(Boost REQUIRED COMPONENTS log)
+set(_boost_components "system;filesystem;thread;log;log_setup;locale;regex;chrono;atomic;date_time;iostreams;nowide")
find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS ${_boost_components})
+include_directories(${BOOST_INCLUDE_DIRS}) and diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt
index 78369233d..1f9c40aaf 100644
--- a/src/slic3r/CMakeLists.txt
+++ b/src/slic3r/CMakeLists.txt
@@ -438,6 +439,7 @@ target_link_libraries(
NanoSVG::nanosvgrast
stb_dxt
fastfloat
+ Boost::log
)
if (MSVC) That aside, it might be a good idea to add a comment above the list of patches about removing all of this in the next version, by which point the fix should have been merged. The patches, as written, won't cause any merge conflicts indicating the upstream fix, so it's best to call it out explicitly so people don't keep unnecessary old patches around just in case :) |
A couple of days ago, I did test if this PR can be easily updated to build the |
Sounds good to me. Better to get it working than to let perfect be the enemy of the good. My nitpick is just a nitpick, and I figure all the patches we add here will be removed once 2.9.0 comes out anyway. @cbat98: The checks say that this can be merged without waiting for approvals, so should we do that? Otherwise, I believe there is a thread on the NixOS discourse for requesting reviews. If you want to get final: prev: {
# - Explicit dependency on OCCT 7.6.1, since 7.6.2 and above introduced a bug with chamfers:
# https://github.com/prusa3d/PrusaSlicer/commit/c6a02106fd1d3caa9a48a6b7c2bdd04546b24485#diff-54d1bb7ea7d9b83fb3c587bc042046732a50bb843a067cd86c445bafbb6ba1eeR7
prusa-slicer = (prev.prusa-slicer.override {
opencascade-occt_7_6 = prev.opencascade-occt_7_6.overrideAttrs {
version = "7.6.1";
src = prev.fetchurl {
name = "occt-V7_6_1.tar.gz";
url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=V7_6_1;sf=tgz";
hash = "sha256-PZVrLSbR7nWsArIeg47YtHMdnpFAHK5K80VbVrAA9W0=";
};
};
}).overrideAttrs (old: rec {
version = "2.9.1-alpha1";
src = prev.fetchFromGitHub {
owner = "jmickelin";
repo = "PrusaSlicer";
hash = "sha256-LMMsQgtF/qKqbREMpNBtEePEXiF4JBKHRFawIA/8zlo=";
# Named in reference to 2.8.1, but actually rebased onto
# 2.9.1-alpha1, awaiting upstream merge.
rev = "fix-2.8.1-build-errors";
};
buildInputs = old.buildInputs ++ [ prev.webkitgtk_4_0 ];
# Remove old patches, since every change necessary is
# committed to the branch.
patches = [ ];
# Upstream will likely go with the route of deleting the
# Find-module for Eigen3 rather than using the updated one
# from my branch. Let's do the same here for 1-1 parity with
# what upstream is expected to look like in the next alpha.
prePatch = old.prePatch + ''
rm cmake/modules/FindEigen3.cmake
'';
cmakeFlags = old.cmakeFlags ++ [
"-DSLIC3R_BUILD_TESTS=0"
];
});
} |
Just as a side note, unfortunately cURL 8 seems to be a bit incompatable with prusa-slicer: #246261 I think ideally this derivation would built all vendored libraries and link them statically. I know this kind of sucks, but prusa-slicer already seems to be kind of a mess, so linking statically might make things easier to handle in the future. |
this is all i needed to get prusa-slicer working with printables curl stuff working on the latest release. mog_prusa-slicer = (pkgs.prusa-slicer.overrideAttrs (old: rec {
version = "2.9.0-beta1";
src = pkgs.fetchFromGitHub {
owner = "prusa3d";
repo = "PrusaSlicer";
# hash = lib.fakeHash;
hash = "sha256-2QbSeOHBQDrfsNOq1SjhmhyMSRyhPTMew7MNC1P1cRk=";
rev = "version_${version}";
};
buildInputs = old.buildInputs ++ [ pkgs.webkitgtk_4_0 ];
patches = [
(pkgs.writeText "boost-filesystem.patch" ''
--- a/src/slic3r/GUI/BackgroundSlicingProcess.cpp
+++ b/src/slic3r/GUI/BackgroundSlicingProcess.cpp
@@ -120,7 +120,7 @@ BackgroundSlicingProcess::~BackgroundSlicingProcess()
std::string prefix = boost::filesystem::path(m_temp_output_path).filename().string();
prefix = prefix.substr(0, prefix.find('_'));
for (const auto& entry : boost::filesystem::directory_iterator(temp_dir)) {
- if (entry.is_regular_file()) {
+ if (boost::filesystem::is_regular_file(entry.path())) {
const std::string filename = entry.path().filename().string();
if (boost::starts_with(filename, prefix) && boost::ends_with(filename, ".gcode"))
boost::filesystem::remove(entry);
'')
];
})).override{
boost = pkgs.boost183;
curl = pkgs.curl.overrideAttrs {
version = "7.88.1";
src = pkgs.fetchurl {
url = "https://curl.se/download/curl-7.88.1.tar.xz";
hash = "sha256-Ha4xsqfB/iad6ZwMMbtIg0aqs0WbX/ypCdaTgkmuQV8=";
# lib.fakeHash;
};
patches = [];
};
opencascade-occt_7_6 = pkgs.opencascade-occt_7_6.overrideAttrs {
version = "7.6.1";
src = pkgs.fetchurl {
name = "occt-V7_6_1.tar.gz";
url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=V7_6_1;sf=tgz";
hash = "sha256-PZVrLSbR7nWsArIeg47YtHMdnpFAHK5K80VbVrAA9W0=";
};
};
}; |
@mogorman Nice! I believe the patch to change It's been a while since I tested this, but could you confirm that it works with just overriding boost to @maxammann Good catch about the Curl version! I noticed the downloaded files being truncated to 0 bytes, but was actually not sure if it was caused by the same curl bug that delayed nixpkgs EDIT: Confirmed that it works with just setting the version to |
I don't think it is a bug in curl 8, as it was already broken on 24.05. I believe the curl issue is related to a bug in prusa-slicer actually. Curl 7 tolerated that bug but 8 no longer does. But that is only a guess. For prusa-slicer I think the best would be to build curl from the cmake files in the prusa-slicer repository. The approach above works but maybe still uses different compilation flags than the cmake build scripts. prusa-slicer seems to be a mess so being as close as possible to the flatpak build is very advantageous in the future. |
Hi again guys, I've been away for a couple of weeks, so I'll take some time to catch up on these messages and see what I can do to update this PR with suggestions. |
@jmickelin yup can confirm it works without. so now even simpler mog_prusa-slicer = (pkgs.prusa-slicer.overrideAttrs (old: rec {
version = "2.9.0-beta1";
src = pkgs.fetchFromGitHub {
owner = "prusa3d";
repo = "PrusaSlicer";
hash = "sha256-2QbSeOHBQDrfsNOq1SjhmhyMSRyhPTMew7MNC1P1cRk=";
rev = "version_${version}";
};
buildInputs = old.buildInputs ++ [ pkgs.webkitgtk_4_0 ];
# needed to override the current patches.
patches = [];
})).override{
boost = pkgs.boost183;
curl = pkgs.curl.overrideAttrs {
version = "7.88.1";
src = pkgs.fetchurl {
url = "https://curl.se/download/curl-7.88.1.tar.xz";
hash = "sha256-Ha4xsqfB/iad6ZwMMbtIg0aqs0WbX/ypCdaTgkmuQV8=";
};
patches = [];
};
opencascade-occt_7_6 = pkgs.opencascade-occt_7_6.overrideAttrs {
version = "7.6.1";
src = pkgs.fetchurl {
name = "occt-V7_6_1.tar.gz";
url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=V7_6_1;sf=tgz";
hash = "sha256-PZVrLSbR7nWsArIeg47YtHMdnpFAHK5K80VbVrAA9W0=";
};
};
}; |
This PR brings PrusaSlicer in line with the latest public release 2.8.1. Several new features such as UI improvements and a new infill type were added in this version. A full changelog can be found here:
I've also provided a patch file to fix some of the build issues I experienced whilst upgrading this package, however I'm still new to NixOS so any feedback is very welcome.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.