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

syncthing-gtk: explicitly depend on gobjectIntrospection #34277

Conversation

cumber
Copy link
Contributor

@cumber cumber commented Jan 26, 2018

Motivation for this change

After a recent update I found syncthing-gtk can no longer start up. The error message it displayed was:

Traceback (most recent call last):
  File "/nix/store/6lagyfbkijzwxfpbc8c2lsjr3gh25fql-python2.7-syncthing-gtk-0.9.2.3/bin/..syncthing-gtk-wrapped-wrapped", line 24, in <module>
    gi.require_version('Gtk', '3.0')
  File "/nix/store/fhw737zss63iyrf2vmwdwy7wjvlcqx5b-python2.7-pygobject-3.26.1/lib/python2.7/site-packages/gi/__init__.py", line 130, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available

I diffed the store output of the most recent working version I had, and the main difference seemed to be that the new version didn't have a reference to gobjectIntrospection in its wrappers. Searching around led me to believe the cause may be a recent change to stop atk propagating gobjectIntrospection (see #32296).

Although I'm not familiar with all of the packages/issues involved, I did come up with a patch to fix it so that syncthing-gtk seems to work again.

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.

@cumber cumber requested a review from FRidh as a code owner January 26, 2018 01:55
@cumber
Copy link
Contributor Author

cumber commented Jan 26, 2018

Should I also file an issue for the bug this fixes?

Copy link
Contributor

@jtojnar jtojnar left a comment

Choose a reason for hiding this comment

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

This looks great, thanks.

@jtojnar
Copy link
Contributor

jtojnar commented Jan 26, 2018

Could you please also take a look at #32016?

@@ -17343,7 +17343,8 @@ in {

propagatedBuildInputs = with self; [ pkgs.syncthing dateutil pyinotify
pkgs.libnotify
(pkgs.librsvg.override { withGTK = true; })
(pkgs.librsvg.override { withGTK = true; enableIntrospection = true; })
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, withGtk implies enableIntrospection. But in this case , the latter should be enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, right, it no longer does since #32296. But enabling introspection should be still enough.

Previously atk had gobjectIntrospection as a propagated build input,
which was making its way into librsvg (even without enableIntrospection
set to true) and then to syncthing-gtk.
@cumber cumber force-pushed the fix/syncthing-gtk_namespace-gtk-not-available branch from 681e68d to cdb42d6 Compare January 26, 2018 05:46
@cumber
Copy link
Contributor Author

cumber commented Jan 26, 2018

Yeah, I wouldn't have found enableIntrospection if it didn't break after I'd just added the gobjectIntrospection dep to syncthing-gtk itself.

I've taken out withGTK = true, and syncthing-gtk did build and run fine. But it's not clear to me why that's redundant with enableIntrospection turned on; it seems that gtk3 is added to propagatedBuildInputs if withGTK is true, and isn't if withGTK is false even if gtk3 still ends up being a transitive buildInput via gobjectIntrospection. Would it be possible for gtk3 not being propagated to make a difference?

@grahamc
Copy link
Member

grahamc commented Jan 27, 2018

@GrahamcOfBorg build syncthing-gtk

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-linux

error: attribute ‘syncthing-gtk’ in selection path ‘syncthing-gtk’ not found

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: aarch64-linux

error: attribute 'syncthing-gtk' in selection path 'syncthing-gtk' not found

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure for system: x86_64-darwin

error: attribute 'syncthing-gtk' in selection path 'syncthing-gtk' not found

@cumber
Copy link
Contributor Author

cumber commented Jan 27, 2018

Oh, it's actually pythonPackages.syncthing-gtk, I think

@fpletz
Copy link
Member

fpletz commented Jan 28, 2018

@GrahamcOfBorg build pythonPackages.syncthing-gtk

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure on x86_64-darwin (full log)

Partial log (click to expand)

Package ‘python2.7-pyinotify-0.9.6’ in /Users/graham/nix-borg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/grahamc-ndnd/pkgs/top-level/python-packages.nix:13995 is not supported on ‘x86_64-darwin’, refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowBroken = true; }
to ~/.config/nixpkgs/config.nix.

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success on x86_64-linux (full log)

Partial log (click to expand)

writing top-level names to syncthing_gtk.egg-info/top_level.txt
writing dependency_links to syncthing_gtk.egg-info/dependency_links.txt
reading manifest file 'syncthing_gtk.egg-info/SOURCES.txt'
writing manifest file 'syncthing_gtk.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success on aarch64-linux (full log)

Partial log (click to expand)

writing dependency_links to syncthing_gtk.egg-info/dependency_links.txt
reading manifest file 'syncthing_gtk.egg-info/SOURCES.txt'
writing manifest file 'syncthing_gtk.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/d60170k0pk7xrf5hw288r5cyrz9n3hw4-python2.7-syncthing-gtk-0.9.2.3

@fpletz
Copy link
Member

fpletz commented Jan 29, 2018

@GrahamcOfBorg build syncthing-gtk

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Failure on x86_64-darwin (full log)

Partial log (click to expand)

error: while evaluating the attribute 'propagatedBuildInputs' of the derivation 'syncthing-gtk-0.9.2.3' at /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating 'getOutput' at /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/attrsets.nix:450:23, called from undefined position:
while evaluating anonymous function at /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/stdenv/generic/make-derivation.nix:111:17, called from undefined position:
while evaluating 'callPackageWith' at /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:113:35, called from /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/top-level/all-packages.nix:4227:12:
while evaluating 'makeOverridable' at /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:72:24, called from /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:117:8:
while evaluating anonymous function at /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/psmisc/default.nix:1:1, called from /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/lib/customisation.nix:74:12:
assertion failed at /tmp/nix-ofborg/repo/38dca4e3aa6bca43ea96d2fcc04e8229/builder/lnl7-mac/pkgs/os-specific/linux/psmisc/default.nix:3:1

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success on aarch64-linux (full log)

Partial log (click to expand)

writing dependency_links to syncthing_gtk.egg-info/dependency_links.txt
reading manifest file 'syncthing_gtk.egg-info/SOURCES.txt'
writing manifest file 'syncthing_gtk.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/ki9kgnb197zm7lan4yvd8iai4ln2ln9j-syncthing-gtk-0.9.2.3

@jtojnar
Copy link
Contributor

jtojnar commented Jan 29, 2018

@fpletz see #32016 which also moves the derivation.

@jtojnar
Copy link
Contributor

jtojnar commented Jan 29, 2018

Also both of these pull requests are runtime fixes so we need someone to test them locally. (I cannot do it because syncthing hates me.)

Copy link

@GrahamcOfBorg GrahamcOfBorg left a comment

Choose a reason for hiding this comment

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

Success on x86_64-linux (full log)

Partial log (click to expand)

writing dependency_links to syncthing_gtk.egg-info/dependency_links.txt
reading manifest file 'syncthing_gtk.egg-info/SOURCES.txt'
writing manifest file 'syncthing_gtk.egg-info/SOURCES.txt'
running build_ext

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
/nix/store/sjgr9sgl7pvp6xx8m2mlf966xr5bfzgv-syncthing-gtk-0.9.2.3

@fpletz fpletz mentioned this pull request Jan 29, 2018
8 tasks
@jtojnar
Copy link
Contributor

jtojnar commented Jan 29, 2018

Merged as part of #32016.

@jtojnar jtojnar closed this Jan 29, 2018
@cumber cumber deleted the fix/syncthing-gtk_namespace-gtk-not-available branch January 29, 2018 02:07
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