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

cura: 4.7.1 -> 4.8.0 #103941

Merged
merged 6 commits into from Dec 6, 2020
Merged

cura: 4.7.1 -> 4.8.0 #103941

merged 6 commits into from Dec 6, 2020

Conversation

poita66
Copy link
Contributor

@poita66 poita66 commented Nov 15, 2020

I've added the new dependencies (pynest2d & libnest2d) but pynest2d won't build because its build target also installs it into python's site_packages folder and I have no idea how to handle that.

However, I also wanted to discuss whether switching to an AppImage wrapper might be more appropriate, as that's what Ultimaker's official release is. Ultimaker seem to be a bit lax in their release tagging convention, too, which makes maintaining the package a bit more painful (libnest2d doesn't even have a release tag on the latest version, which is used by pynest2d).
Currently I use appimage-run to run Cura 4.8.0 and it runs flawlessly.

Motivation for this change

Ultimaker released a new version of Cura

Closes #103657

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.

@poita66
Copy link
Contributor Author

poita66 commented Nov 15, 2020

@gebner Turns out updating Cura to 4.8.0 wasn't as easy as I thought it'd be. What are your thoughts on switching to an AppImage wrapper?

Copy link
Contributor

@lopsided98 lopsided98 left a comment

Choose a reason for hiding this comment

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

I'd strongly prefer continuing to build from source.

Looking at the previous update PR, it looks like you need to upgrade liburanium, libsavitar, libarcus and curaengine as well.

stdenv.mkDerivation rec {
version = "4.8.0";
pname = "libnest2d";
format = "other";
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't belong here, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I'm not sure what you mean. Should this file be in another folder?

Copy link
Contributor

Choose a reason for hiding this comment

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

format = "other" is only for buildPythonPackage as far as I know.

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
format = "other";

Please just remove the format = "other" line.

pkgs/development/libraries/libnest2d/default.nix Outdated Show resolved Hide resolved
@poita66
Copy link
Contributor Author

poita66 commented Nov 16, 2020

I'd strongly prefer continuing to build from source.

Haha I thought that might be the case

Looking at the previous update PR, it looks like you need to upgrade liburanium, libsavitar, libarcus and curaengine as well.

Once I got the pynest2d bit sorted, I was going to move on to those, but thanks for pointing them out (now I have a clear list to work off haha)

Thanks for your help @lopsided98 ! I'll continue on this after work.

Copy link
Contributor

@nh2 nh2 left a comment

Choose a reason for hiding this comment

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

I get now:

hash mismatch in fixed-output derivation '/nix/store/6xjdlcbfv2wckgmv8jy0vnwrpfiwwx3l-source':
  wanted: sha256:0hi9w1fsnazlr0vvxdr3alsdb8m1vjjfp5zhmlz4kyyxhsy3bc33
  got:    sha256:1wyzx4fxbyd0mvf3x4p7crcnp38hgfr4zd3cc40nk9c0c51awplv
cannot build derivation '/nix/store/hn1f0rnw3fgvd583nkqawpwprpzsk6z3-cura-4.8.0.drv': 1 dependencies couldn't be built

pkgs/applications/misc/cura/default.nix Show resolved Hide resolved
@nh2
Copy link
Contributor

nh2 commented Nov 16, 2020

Beyond the 2 issues mentioned above, this upgrade works for me and slices my test file fine.

@poita66
Copy link
Contributor Author

poita66 commented Nov 16, 2020

I get now:

hash mismatch in fixed-output derivation '/nix/store/6xjdlcbfv2wckgmv8jy0vnwrpfiwwx3l-source':
  wanted: sha256:0hi9w1fsnazlr0vvxdr3alsdb8m1vjjfp5zhmlz4kyyxhsy3bc33
  got:    sha256:1wyzx4fxbyd0mvf3x4p7crcnp38hgfr4zd3cc40nk9c0c51awplv
cannot build derivation '/nix/store/hn1f0rnw3fgvd583nkqawpwprpzsk6z3-cura-4.8.0.drv': 1 dependencies couldn't be built

That's odd, I wonder why I didn't get the same error. I've updated the SHA. Thanks for testing!

@nh2
Copy link
Contributor

nh2 commented Nov 16, 2020

That's odd, I wonder why I didn't get the same error. I've updated the SHA. Thanks for testing!

Perhaps you did the update, putting in that SHA and it was right at the time, and then changed the URL/version again but forgot to update the SHA, and it didn't re-download it to re-hash it because fetchFromGitHub produces a fixed-output derivation that downloads only when you don't already have that SHA.

I didn't have the SHA, so for me it downloaded. This is a common pitfall.

`cura: Fix SHA for fdm_materials

Please fix up the wrong commit using git rebase --interactive (e.g. here or here) and force-pushing, so that the wrong one doesn't make it into the history.

@poita66
Copy link
Contributor Author

poita66 commented Nov 16, 2020

Perhaps you did the update, putting in that SHA and it was right at the time, and then changed the URL/version again but forgot to update the SHA, and it didn't re-download it to re-hash it because fetchFromGitHub produces a fixed-output derivation that downloads only when you don't already have that SHA.

I didn't have the SHA, so for me it downloaded. This is a common pitfall.

Ah that makes sense. I'll keep that in mind.

Please fix up the wrong commit using git rebase --interactive (e.g. here or here) and force-pushing, so that the wrong one doesn't make it into the history.

Sure, will do after work.

@nh2
Copy link
Contributor

nh2 commented Nov 17, 2020

Hmm, did you change anything else in the last push?

Now nixpkgs-review pr --checkout commit 103941 gets me a segfault on NixOS:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f1cba3e1f00 in ?? ()
   from /nix/store/kp6123kw78q7x8g5gbv6215sh7j0hs0k-python3.7-sip-4.19.24/lib/python3.7/site-packages/sip.so
warning: File "/nix/store/xbwr3krv4kkyv5h8ici7vkpnsx5w3cv3-gcc-9.3.0-lib/lib/libstdc++.so.6.0.28-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load:/nix/store/vran8acwir59772hj4vscr7zribvp7l5-gcc-9.3.0-lib".
(gdb) bt
#0  0x00007f1cba3e1f00 in ?? () from /nix/store/kp6123kw78q7x8g5gbv6215sh7j0hs0k-python3.7-sip-4.19.24/lib/python3.7/site-packages/sip.so
#1  0x00007f1cba3e2c1c in ?? () from /nix/store/kp6123kw78q7x8g5gbv6215sh7j0hs0k-python3.7-sip-4.19.24/lib/python3.7/site-packages/sip.so
#2  0x00007f1cbaeaaa7d in PyInit_Arcus () from /nix/store/2y1gfczpqz1yjgwsx5hwbp1mnvjyj1js-python3.7-libarcus-4.8.0/lib/python3.7/site-packages/Arcus.so
#3  0x00007f1cc8790c3f in _PyImport_LoadDynamicModuleWithSpec () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#4  0x00007f1cc87904e5 in _imp_create_dynamic () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#5  0x00007f1cc86d0f47 in cfunction_vectorcall_FASTCALL () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#6  0x00007f1cc86ab1b0 in PyVectorcall_Call () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#7  0x00007f1cc8718504 in _PyEval_EvalFrameDefault () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#8  0x00007f1cc8711e81 in _PyEval_EvalCodeWithName () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#9  0x00007f1cc86aa5de in _PyFunction_Vectorcall () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#10 0x00007f1cc8717383 in _PyEval_EvalFrameDefault () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#11 0x00007f1cc86aa54a in _PyFunction_Vectorcall () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#12 0x00007f1cc8713228 in _PyEval_EvalFrameDefault () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#13 0x00007f1cc86aa54a in _PyFunction_Vectorcall () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#14 0x00007f1cc8712e33 in _PyEval_EvalFrameDefault () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#15 0x00007f1cc86aa54a in _PyFunction_Vectorcall () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#16 0x00007f1cc8712e33 in _PyEval_EvalFrameDefault () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#17 0x00007f1cc86aa54a in _PyFunction_Vectorcall () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#18 0x00007f1cc8712e33 in _PyEval_EvalFrameDefault () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#19 0x00007f1cc86aa54a in _PyFunction_Vectorcall () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#20 0x00007f1cc86aa178 in object_vacall () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#21 0x00007f1cc86ab3e1 in _PyObject_CallMethodIdObjArgs () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#22 0x00007f1cc872b7c4 in PyImport_ImportModuleLevelObject () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#23 0x00007f1cc87168ac in _PyEval_EvalFrameDefault () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#24 0x00007f1cc8711e81 in _PyEval_EvalCodeWithName () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#25 0x00007f1cc8711b83 in PyEval_EvalCodeEx () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#26 0x00007f1cc87886ab in PyEval_EvalCode () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#27 0x00007f1cc87994b8 in run_eval_code_obj () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#28 0x00007f1cc8799453 in run_mod () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#29 0x00007f1cc8665140 in PyRun_FileExFlags () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#30 0x00007f1cc8664f13 in PyRun_SimpleFileExFlags () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#31 0x00007f1cc87a1386 in Py_RunMain () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#32 0x00007f1cc87a0cf9 in Py_BytesMain () from /nix/store/cqh3nsk4z8lc960g8yqvz5nf2f6qx9v0-python3-3.8.6/lib/libpython3.8.so.1.0
#33 0x00007f1cc81a8dbd in __libc_start_main () from /nix/store/2wrfwfdpklhaqhjxgq6yd257cagdxgph-glibc-2.32/lib/libc.so.6
#34 0x000000000040107a in _start ()

@poita66
Copy link
Contributor Author

poita66 commented Nov 25, 2020

Hmm, did you change anything else in the last push?

I've looked through the commits and the only change I can see is the fdm_materials, but I'll do a diff against the old branch to be sure.

Now nixpkgs-review pr --checkout commit 103941 gets me a segfault on NixOS:

Last weekend I was able to run Cura by just building it with nix-build and running the result. I'll have a closer look when I have time (hopefully tonight).


disabled = pythonOlder "3.5.0";

buildInputs = [ python3 ];
Copy link
Member

Choose a reason for hiding this comment

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

not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed, thanks!

@FRidh
Copy link
Member

FRidh commented Nov 26, 2020

Please prefix Python packages with python3Packages..

@poita66
Copy link
Contributor Author

poita66 commented Nov 26, 2020

Please prefix Python packages with python3Packages..

Done

I attempted to figure out what was causing the seg fault, but I'm really out of my depth with this issue.
If I use nix-build and run the result, it works fine. However running it in the nix-review shell causes a seg fault as @nh2 showed.
I'm very confused.

@nh2
Copy link
Contributor

nh2 commented Nov 27, 2020

@poita66 If you can show that the previous (current master) version also segfaults in nix-review, then at least it's not a regression, so we could merge it irrespective of that (and if you find that, it'd be great to add a comment in the code because I'll definitely forget it for the next upgrade :) ).

Copy link
Member

@gebner gebner left a comment

Choose a reason for hiding this comment

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

From my point of view, the only thing missing here is removing the two lines in the libnest2d package.

I can also reproduce the segfaults with cura 4.7.0 (it segfaults after exiting). This should be fixed at some point, but not in this PR.

stdenv.mkDerivation rec {
version = "4.8.0";
pname = "libnest2d";
format = "other";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
format = "other";

Please just remove the format = "other" line.

sha256 = "1hzqi4z55x76rss3xk7hfqhy9hcaq2jaav5jqxa1aqmbvarr2gla";
};

buildInputs = [ python3 ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
buildInputs = [ python3 ];

Python is not required to build libnest2d.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for picking those up @gebner! I've applied those changes.

@gebner
Copy link
Member

gebner commented Dec 6, 2020

Thanks!

@gebner gebner merged commit a6dabb2 into NixOS:master Dec 6, 2020
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

6 participants