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

electrum: 2.9.3 -> 3.0.2 #31470

Closed
wants to merge 3 commits into from
Closed

Conversation

Moredread
Copy link
Contributor

@Moredread Moredread commented Nov 10, 2017

Motivation for this change

Upgrading electrum to the latest version. As it doesn't support Python 2 anymore, it is now built against Python 3. For this, jsonrpclib-pelix is needed, a fork of jsonrpclib, that works with Python 3. See the first of the commit in the PR. If this is acceptable, would you, @joachifm, also be the maintainer of the new package?

I couldn't test it built against master, as I get an error message when I run the binary. I think it's an incompatibility of the QT5 runtime library. See the comment below for details. I backported it to 17.09 (only needs a later version of protobuf, e.g. protobuf3_2), and there it works fine.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Moredread
Copy link
Contributor Author

I couldn't test it built against master, as I get an error message when I run the binary on a 17.09 system:

> QT_DEBUG_PLUGINS=1 ./result/bin/electrum

(... skipped ...)

Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/nix/var/nix/profiles/default/lib/qt-5.9/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "/run/current-system/sw/lib/qt-5.9/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/run/current-system/sw/lib/qt-5.9/plugins/platforms/libqminimal.so"
Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/run/current-system/sw/lib/qt-5.9/plugins/platforms/libqoffscreen.so"
Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/run/current-system/sw/lib/qt-5.9/plugins/platforms/libqvnc.so"
Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/run/current-system/sw/lib/qt-5.9/plugins/platforms/libqxcb.so"
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/nix/store/166s7l3yjqfc8dj5hfqjb09dbfvp1850-python3-3.6.3/bin/platforms" ...
Cannot load library /nix/store/i1mgik5x2f8akjwhjcd0r62259s89592-qtbase-5.9.1-bin/lib/qt-5.9/plugins/platforms/libqxcb.so: (/nix/store/h1a1ncbkkhapzm0509plqjlfrgxw22f3-glibc-2.25-49/lib/libresolv.so.2: symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference)
QLibraryPrivate::loadPlugin failed on "/nix/store/i1mgik5x2f8akjwhjcd0r62259s89592-qtbase-5.9.1-bin/lib/qt-5.9/plugins/platforms/libqxcb.so" : "Cannot load library /nix/store/i1mgik5x2f8akjwhjcd0r62259s89592-qtbase-5.9.1-bin/lib/qt-5.9/plugins/platforms/libqxcb.so: (/nix/store/h1a1ncbkkhapzm0509plqjlfrgxw22f3-glibc-2.25-49/lib/libresolv.so.2: symbol __res_maybe_init, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference)"
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Available platform plugins are: minimal, offscreen, vnc, xcb.

Reinstalling the application may fix this problem.
[1]    22886 abort      QT_DEBUG_PLUGINS=1 ./result/bin/electrum

# Recording the creation timestamps introduces indeterminism to the build
sed -i '/Created: .*/d' gui/qt/icons_rc.py
'';

postInstall = ''
# Despite setting usr_share above, these files are installed under
# $out/nix ...
mv $out/lib/python2.7/site-packages/nix/store"/"*/share $out
rm -rf $out/lib/python2.7/site-packages/nix
mv $out/lib/python3.6/site-packages/nix/store"/"*/share $out
Copy link
Member

Choose a reason for hiding this comment

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

${python.sitePackages}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed it

description = "JSON RPC client library - Pelix compatible fork";
homepage = https://pypi.python.org/pypi/jsonrpclib-pelix/;
license = lib.licenses.asl20;
maintainers = [ lib.maintainers.joachifm ];
Copy link
Member

Choose a reason for hiding this comment

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

Is @joachifm maintaining this expression?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They haven't replied yet. What's the procedure for finding a maintainer for necessary new dependencies?

Copy link
Member

Choose a reason for hiding this comment

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

You can make yourself the maintainer or leave it empty (preference on the former).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed the maintainer line for now, I'm not sure I can provide the level of attention needed atm.

Copy link
Contributor

Choose a reason for hiding this comment

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

I only care to the extent that it affects electrum, so wouldn't be maintaining it per se. It used to be internal to the electrum expression for that reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added myself as maintainer afterall.

@Moredread Moredread force-pushed the electrum-3.0.1 branch 2 times, most recently from cf4255c to 14e0589 Compare November 15, 2017 16:35
This fork of jsonrpclib supports Python 3 and is necessary for electrum
from version 3.0.0 onwards.

Adding myself - moredread - as maintainer.
@Moredread Moredread changed the title electrum: 2.9.3 -> 3.0.1 electrum: 2.9.3 -> 3.0.12 Nov 18, 2017
@Moredread Moredread changed the title electrum: 2.9.3 -> 3.0.12 electrum: 2.9.3 -> 3.0.2 Nov 18, 2017
@Moredread
Copy link
Contributor Author

Have added myself as maintainer, and updated the package to 3.0.2, which was released in the meantime.

@nonsequitur
Copy link
Contributor

nonsequitur commented Nov 19, 2017

For those who want to run Electrum 3.0.2 now, here's a quick derivation with pinned dependencies:
https://gist.github.com/nonsequitur/1782996516bdf39b16e647842b1ae4cf
(The patch proposed in this PR still doesn't run on master: xcb not found)

Edit: Explicitly reference this PR.

@Moredread
Copy link
Contributor Author

@nonsequitur do you mean my PR or your gist that isn't working with master? Are you running NixOS 17.09 or master on your system?

@nonsequitur
Copy link
Contributor

nonsequitur commented Nov 20, 2017

@Moredread I'm running NixOS revision eafd703 which is in the 17.09 channel.
The electrum build from my gist is working on that system.
When changing the nixpkgs version in the gist to master, I'm getting the xdg error.
I haven't tried running your PR (or the master gist) with NixOS master installed, because that shouldn't make a difference. The dependencies in my gist are completely fixed.
(I've clarified my original post.)

@joachifm
Copy link
Contributor

joachifm commented Dec 1, 2017

Any way to move this ahead?

@Moredread
Copy link
Contributor Author

Moredread commented Dec 2, 2017

Someone needs to find out why the xcb plugin loading doesn't work when build against master. I've tested it with a system running master, and the xcb error happens there too. :/

@joachifm
Copy link
Contributor

joachifm commented Dec 3, 2017

Similar libc errors reported in #32273 and #32065

@joachifm
Copy link
Contributor

Basically, the problem is a runtime impurity, which can be "fixed" on non-NixOS by setting QT_PLUGIN_PATH and LD_LIBRARY_PATH appropriately. I've merged this in the interim. Thank you

@joachifm joachifm closed this Dec 12, 2017
@joachifm
Copy link
Contributor

(The above worked for me, anyways)

@Moredread Moredread deleted the electrum-3.0.1 branch December 13, 2017 21:43
@Moredread
Copy link
Contributor Author

@joachifm Thanks :)

I think it might be a good idea to backport it to the 17.09 channel, as pre-3.0 has problems with SegWit addresses? As the issue with QT/xcb didn't happen on the older channel, that shouldn't be a blocker.

@joachifm
Copy link
Contributor

If there are problems with the version on stable, a bump makes sense to me.

@joachifm
Copy link
Contributor

Hm, OTOH I see that SegWit support was added in 3.0, so under a strict interpretation that'd count as a new feature not a bug fix, or is there a specific issue with the 2.9 series? (I'm not really clued into SegWit or electrum's support for it).

@Moredread
Copy link
Contributor Author

@joachifm I had crashes with watching wallets, that had SegWit transactions, but I have to check whether it was the latestst 2.X release

@joachifm
Copy link
Contributor

@Moredread I see. If you can ascertain whether there are issues with 2.9, please open a cherry-pick PR if you have the time, or let me know and I'll pick it when I can.

@joachifm
Copy link
Contributor

joachifm commented Jan 7, 2018

Meanwhile, electrum 3.x has been backported to fix a security issue.

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

7 participants