Skip to content

awesome: use makeWrapper rather than wrapProgram#61060

Merged
Mic92 merged 1 commit intoNixOS:masterfrom
stefano-m:awesome-issue60229
May 7, 2019
Merged

awesome: use makeWrapper rather than wrapProgram#61060
Mic92 merged 1 commit intoNixOS:masterfrom
stefano-m:awesome-issue60229

Conversation

@stefano-m
Copy link
Copy Markdown
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.
@ofborg ofborg bot requested review from lovek323 and rasendubi May 6, 2019 20:41
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels May 6, 2019
@Mic92 Mic92 merged commit dd2052c into NixOS:master May 7, 2019
@Mic92
Copy link
Copy Markdown
Member

Mic92 commented May 7, 2019

also backported in 49a9155


postInstall = ''
wrapProgram $out/bin/awesome \
# Don't use wrapProgram or or the wrapper will duplicate the --search
Copy link
Copy Markdown
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
Copy Markdown
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

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

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