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

snippetpixie: init at 1.2.2 #75472

Merged
merged 2 commits into from Dec 12, 2019
Merged

snippetpixie: init at 1.2.2 #75472

merged 2 commits into from Dec 12, 2019

Conversation

ianmjones
Copy link
Member

@ianmjones ianmjones commented Dec 11, 2019

Motivation for this change

Add Snippet Pixie as a Nix package.

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 nix-review --run "nix-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.
Notes
  • Requires services.gnome3.at-spi2-core.enable = true; on NixOS if not already up and running in WM/DE.
  • I'm the author of Snippet Pixie.
  • My first PR for anything Nix/NixPkgs/NixOS! 🎉

@ianmjones ianmjones changed the title [WIP] snippetpixie: init at 1.2.2 snippetpixie: init at 1.2.2 Dec 11, 2019
@ianmjones ianmjones marked this pull request as ready for review December 11, 2019 10:15
@ianmjones
Copy link
Member Author

@worldofpeace I'm not clear on the etiquette, hope you don't mind me pinging you here, but just thought this PR might be one you'd be best equipped to review if you get a chance as I see you've worked on a lot of pantheon/elementary PRs?

Apologies if this note is bad form, couldn't find any documentation on how to find a good reviewer for a new package.

@worldofpeace
Copy link
Contributor

@worldofpeace I'm not clear on the etiquette, hope you don't mind me pinging you here, but just thought this PR might be one you'd be best equipped to review if you get a chance as I see you've worked on a lot of pantheon/elementary PRs?

Apologies if this note is bad form, couldn't find any documentation on how to find a good reviewer for a new package.

Oh it's not in bad form in all. Actually, you've found the perfect person because I maintain pantheon in nixpkgs, and also can co-maintain any elementary appcenter application.
Ref https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/pantheon/default.nix#L59.

In the future I hope we add maintainer teams

so people can discover who to request reviews on a certain domain.

@worldofpeace
Copy link
Contributor

It also seems you've by in large authored this
https://github.com/bytepixie/snippetpixie/graphs/contributors

That's pretty cool, thanks for submitting it to nixpkgs 👍

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

Everything seems good, left some comments on style and few adjustments.

I ran this locally and I did notice a warning immediately

(com.github.bytepixie.snippetpixie:18392): dbind-WARNING **: 05:47:48.982: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1000/at-spi2-RGR4C0/socket: No such file or directory

(com.github.bytepixie.snippetpixie:18392): dbind-WARNING **: 05:47:48.985: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1000/at-spi2-HDX3C0/socket: No such file or directory

(com.github.bytepixie.snippetpixie:18392): dbind-WARNING **: 05:47:48.985: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1000/at-spi2-UGB4C0/socket: No such file or directory

(com.github.bytepixie.snippetpixie:18392): dbind-WARNING **: 05:47:48.985: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1000/at-spi2-DL03C0/socket: No such file or directory

(com.github.bytepixie.snippetpixie:18392): dbind-WARNING **: 05:47:48.986: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1000/at-spi2-HCZ3C0/socket: No such file or directory

(com.github.bytepixie.snippetpixie:18392): dbind-WARNING **: 05:47:48.986: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1000/at-spi2-V033C0/socket: No such file or directory

(com.github.bytepixie.snippetpixie:18392): dbind-WARNING **: 05:47:48.986: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1000/at-spi2-WIZ3C0/socket: No such file or directory

(com.github.bytepixie.snippetpixie:18392): dbind-WARNING **: 05:47:48.987: AT-SPI: Unable to open bus connection: Failed to connect to socket /run/user/1000/at-spi2-DE53C0/socket: No such file or directory

and this does appear to have scattered several at-spi2-* temporary directories.

I do have at-spi-bus-launcher running.

Another warning was

** (com.github.bytepixie.snippetpixie:19326): WARNING **: 05:53:30.036: Application.vala:821: Could not find desktop file with name: com.github.bytepixie.snippetpixie.desktop

This is weird because DesktopAppInfo should work because the docs state

https://valadoc.org/gio-unix-2.0/GLib.DesktopAppInfo.DesktopAppInfo.html
GIO is looking for a desktop file with this name in the applications subdirectories of the XDG data directories (i.e. the directories specified in the XDG_DATA_HOME and XDG_DATA_DIRS environment variables).

and to support running applications uninstalled, for purity, our wrapper scripts set

export XDG_DATA_DIRS='/nix/store/fyajylfficz2kd1lnbbrg4yk4xyl2lw2-snippetpixie-1.2.2/share'${XDG_DATA_DIRS:+':'}$XDG_DATA_DIRS

maintainers/maintainer-list.nix Show resolved Hide resolved
pkgs/tools/text/snippetpixie/default.nix Outdated Show resolved Hide resolved
pkgs/tools/text/snippetpixie/default.nix Outdated Show resolved Hide resolved
pkgs/tools/text/snippetpixie/default.nix Outdated Show resolved Hide resolved
pkgs/tools/text/snippetpixie/default.nix Outdated Show resolved Hide resolved
pkgs/tools/text/snippetpixie/default.nix Outdated Show resolved Hide resolved
pkgs/tools/text/snippetpixie/default.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot requested a review from worldofpeace December 11, 2019 20:54
@ianmjones
Copy link
Member Author

Thanks for the review @worldofpeace, hopefully I've addressed most of your feedback.

and this does appear to have scattered several at-spi2-* temporary directories.

I do have at-spi-bus-launcher running.

Hmm, I don't see all the warnings you see, but I suspect I'm running the build differently...

Another warning was

** (com.github.bytepixie.snippetpixie:19326): WARNING **: 05:53:30.036: Application.vala:821: Could not find desktop file with name: com.github.bytepixie.snippetpixie.desktop

This is weird because DesktopAppInfo should work because the docs state...[snip]

I don't get this warning either, the desktop file is created dynamically if missing, for me that's in ~/.config/autostart/.

So I think that's because I've just tested it as per the quick start guide after a nix-env -f . -iA snippetpixie, which means it's a local nix profile install rather than read-only system level install?

How do you build/install/test so that I can try and reproduce?

@worldofpeace
Copy link
Contributor

worldofpeace commented Dec 11, 2019

@ianmjones You can run it like

nix-build -A snippetpixie
./result/bin/$binary
$binary

and I think it should be reproduced in nix-shell too

nix-build -A snippetpixie
nix-shell -p ./result
$binary

Oh, I didn't emphasize enough that it's run uninstalled. That's why I mentioned that application is wrapped to have the nix store path with its XDG_DATA_DIR.

Edit: Completely forgot I've disabled at-spi in Pantheon due to defunct bugs. Ignore that warning.

@worldofpeace
Copy link
Contributor

I tested it installed and the

** (com.github.bytepixie.snippetpixie:4421): WARNING **: 18:08:44.607: Application.vala:821: Could not find desktop file with name: com.github.bytepixie.snippetpixie.desktop

error goes away. Though for the reason at

This is weird because DesktopAppInfo should work because the docs state

https://valadoc.org/gio-unix-2.0/GLib.DesktopAppInfo.DesktopAppInfo.html
GIO is looking for a desktop file with this name in the applications subdirectories of the XDG data directories (i.e. the directories specified in the XDG_DATA_HOME and XDG_DATA_DIRS environment variables).

and to support running applications uninstalled, for purity, our wrapper scripts set

export XDG_DATA_DIRS='/nix/store/fyajylfficz2kd1lnbbrg

the child process (the actual program) will inherit adding the share dir of the package to XDG_DATA_DIRS via the wrapGAppsHook script. Meaning, for reasons documented in glib, this shouldn't be an issue.

@ianmjones
Copy link
Member Author

@worldofpeace Thanks for the steps to reproduce the error, I can reproduce, but I also have no idea why it doesn't find the default desktop file that's right there in ./result/share/applications/com.github.bytepixie.snippetpixie.desktop when running ./result/bin/com.github.bytepixie.snippetpixie.

When running the installed version all seems to be fine, I get a properly generated ~/.config/autostart/com.github.bytepixie.snippetpixie.desktop file based on the original. ¯\(ツ)

For example, I got that shrug above with my shrug` abbreviation while writing this in Quilter, running in SwayWM, on NixOS 19.09!

@worldofpeace
Copy link
Contributor

@worldofpeace Thanks for the steps to reproduce the error, I can reproduce, but I also have no idea why it doesn't find the default desktop file that's right there in ./result/share/applications/com.github.bytepixie.snippetpixie.desktop when running ./result/bin/com.github.bytepixie.snippetpixie.

When running the installed version all seems to be fine, I get a properly generated ~/.config/autostart/com.github.bytepixie.snippetpixie.desktop file based on the original. ¯_(ツ)_/¯

For example, I got that shrug above with my shrug` abbreviation while writing this in Quilter, running in SwayWM, on NixOS 19.09!

Yeah, it has me confused also, should just work.

I think we can add the issue to your tracker and merge, since it does function as expected installed.
cc @jtojnar, am I confusing how works https://valadoc.org/gio-unix-2.0/GLib.DesktopAppInfo.DesktopAppInfo.html?

@ianmjones Could you rewrite your history to #75472 (comment)?

@jtojnar
Copy link
Contributor

jtojnar commented Dec 12, 2019

@worldofpeace If I recall correctly from my experiments with the interface, it also does some validation. Most notably whether the command referenced in Exec is in PATH.

@worldofpeace
Copy link
Contributor

Found the code in question for glib

Guess this will be an issue for glib and nixos, so I guess that's out of scope per this PR.

@ianmjones
Copy link
Member Author

@ianmjones Could you rewrite your history to #75472 (comment)?

@worldofpeace Had a go, first time I've ever done that, so hopefully it's ok? I applied the maintainer list change first in the pick list, but it's date puts it second, hopefully that's not an issue.

@worldofpeace
Copy link
Contributor

@ianmjones Could you rewrite your history to #75472 (comment)?

@worldofpeace Had a go, first time I've ever done that, so hopefully it's ok? I applied the maintainer list change first in the pick list, but it's date puts it second, hopefully that's not an issue.

Yeah, that's just github being silly. It as actually ordered before the init.

@worldofpeace worldofpeace merged commit cf5c943 into NixOS:master Dec 12, 2019
@ianmjones ianmjones deleted the snippetpixie branch December 12, 2019 23:36
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

4 participants