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

awesome: use makeWrapper rather than wrapProgram #61060

Merged
merged 1 commit into from May 7, 2019
Merged

awesome: use makeWrapper rather than wrapProgram #61060

merged 1 commit into from May 7, 2019

Conversation

stefano-m
Copy link
Contributor

Motivation for this change

Using wrapProgram makes so that the generated "awesome" wrapper duplicates its
command line options at every restart. This fixes #60229.

As @psychon puts it:

AwesomeWM restarts via execvp(argv[0], argv). In NixOS, wrapProgram is used
to generate a wrapper around the real binary. wrapProgram calls makeWrapper
with --argv0 '$0'. I guess this is what makes awesomeWM run the wrapper again
on restart. Without this --argv0 awesomeWM would directly restart itself
instead of the wrapper, I think.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option 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 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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Using wrapProgram makes so that the generated "awesome" wrapper duplicates its
command line options at every restart.

As @psychon puts it:

> AwesomeWM restarts via execvp(argv[0], argv). In NixOS, wrapProgram is used
> to generate a wrapper around the real binary. wrapProgram calls makeWrapper
> with --argv0 '$0'. I guess this is what makes awesomeWM run the wrapper again
> on restart. Without this --argv0 awesomeWM would directly restart itself
> instead of the wrapper, I think.
@Mic92
Copy link
Member

Mic92 commented May 7, 2019

also backported in 49a9155

@@ -48,7 +48,10 @@ with luaPackages; stdenv.mkDerivation rec {
LUA_PATH = "${lgi}/share/lua/${lua.luaversion}/?.lua;;";

postInstall = ''
wrapProgram $out/bin/awesome \
# Don't use wrapProgram or or the wrapper will duplicate the --search
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: or or -> or

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seen this too late, sorry. But I fixed it with the changes in #61161

@stefano-m stefano-m deleted the awesome-issue60229 branch May 8, 2019 19:56
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.

Awesome Window Manager appends same options to command line upon restarts
3 participants