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

picom: add withDebug option #85490

Merged
merged 2 commits into from Jan 25, 2021
Merged

Conversation

jluttine
Copy link
Member

Motivation for this change

This makes it easy to build picom in such a way that it supports debugging. Just install picom.override {debug=true;}. (The first commit applies nixpkgs-fmt.)

I asked on IRC if it's ok to add this kind of debug ? false options to packages if someone just bothers to do it and I was told by one person that it sounds reasonable. I can see this kind of convention in a few packages but there seems to be inconsistency whether to use debug, withDebug or enableDebug as the option name. I'm more than happy to pick any of those if there's some consensus.

cc maintainers @ertes @Enzime @Twey

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 nixpkgs-review --run "nixpkgs-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.

@jluttine
Copy link
Member Author

Maintainers @ertes @Enzime @Twey and the author of the latest update @thiagokokada, I've now updated this PR. What do you think?

@thiagokokada
Copy link
Contributor

Result of nixpkgs-review pr 85490 1

1 package built:
  • picom

Copy link
Contributor

@thiagokokada thiagokokada left a comment

Choose a reason for hiding this comment

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

Tested building with debug set to false and true.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/312

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

Please revert the nix-fmt changes.

pkgs/applications/window-managers/picom/default.nix Outdated Show resolved Hide resolved
@jluttine
Copy link
Member Author

Please revert the nix-fmt changes.

@SuperSandro2000 Ok, I can do that. Is there a particular reason why? Is the formatting by nixpkgs-fmt bad in general (or in this case particular) and shouldn't be used?

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Jan 1, 2021

@SuperSandro2000 Ok, I can do that. Is there a particular reason why? Is the formatting by nixpkgs-fmt bad in general (or in this case particular) and shouldn't be used?

Reformatting a file while changing inputs makes it really hard to review because I cannot spot the difference easily. For new packages it is great as long as you do not have to many inputs.

@jluttine
Copy link
Member Author

jluttine commented Jan 1, 2021

@SuperSandro2000 Ok, I can do that. Is there a particular reason why? Is the formatting by nixpkgs-fmt bad in general (or in this case particular) and shouldn't be used?

Reformatting a file while changing inputs makes it really hard to review because I cannot spot the difference easily. For new packages it is great as long as you do not have to many inputs.

@SuperSandro2000 But they are already two separate commits exactly for that reason so that you can check the commits separately. Isn't that sufficient? Would you rather have two separate PRs?

@thiagokokada thiagokokada mentioned this pull request Jan 5, 2021
10 tasks
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Jan 10, 2021

Upsi. didn't check the commit history.

@jluttine can you fix the merge conflict?

@jluttine
Copy link
Member Author

@SuperSandro2000 Alright, solved!

Not sure if the new maintainer @thiagokokada wants to review too?

Also, I'm still not quite sure if debug is the right/best argument name or if it should be withDebug or enableDebug. I'm happy to change it, but I would like it to follow some generic guideline if there exists one for this kind of arguments..

Copy link
Contributor

@thiagokokada thiagokokada left a comment

Choose a reason for hiding this comment

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

Diff wise LGTM.

Also, I'm still not quite sure if debug is the right/best argument name or if it should be withDebug or enableDebug. I'm happy to change it, but I would like it to follow some generic guideline if there exists one for this kind of arguments..

I think withDebug is better, but I also don't know if there is a guideline for it.

@ofborg ofborg bot requested a review from thiagokokada January 17, 2021 16:54
@jluttine jluttine changed the title picom: add debug option picom: add withDebug option Jan 24, 2021
@jluttine
Copy link
Member Author

Thanks! I renamed the option to withDebug. This PR is now ready I suppose.

@thiagokokada
Copy link
Contributor

Result of nixpkgs-review pr 85490 run on x86_64-linux 1

1 package built:
  • picom

Copy link
Contributor

@thiagokokada thiagokokada left a comment

Choose a reason for hiding this comment

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

Tested both with withDebug = true; and withDebug = false;. Got gdb to work with it:

GNU gdb (GDB) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from picom...
(gdb)

Sadly don't know too much about gdb, so I will just believe it works as it should.

@SuperSandro2000 SuperSandro2000 merged commit ff83114 into NixOS:master Jan 25, 2021
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

5 participants