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

edb: init at 1.3.0 #58962

Merged
merged 1 commit into from Feb 9, 2021
Merged

edb: init at 1.3.0 #58962

merged 1 commit into from Feb 9, 2021

Conversation

lihop
Copy link
Member

@lihop lihop commented Apr 4, 2019

While there are releases for edb the most recent release (1.0.0)
is a little bit old (May 5, 2018) and does not build easily with
the current version of cmake. Therefore, I have opted to use the
latest version from github. Recent disscussion in
eteran/edb-debugger#698 indicates that
the project might soon be moving to a quarterly release schedule
that we could follow going forwards.

Motivation for this change

Missing from nixpkgs.

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.

repo = "edb-debugger";
rev = "77e5ebf497ff489827fe1b4b5861a77688aa3729";
fetchSubmodules = true;
sha256 = "1pfz65q5p1cpr2jz8mwpdhyckk7rx21inha4a65ykpim745n18c5";
Copy link
Member

Choose a reason for hiding this comment

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

When building I got:

hash mismatch in fixed-output derivation '/nix/store/36lqk5j7zcmi05dc8rfyzhiznfzfh0q9-source':
  wanted: sha256:1pfz65q5p1cpr2jz8mwpdhyckk7rx21inha4a65ykpim745n18c5
  got:    sha256:1mmw0pgb1zgqsjzgshrpw988higzbm84wk8k6kaqahxwh131xq1y

The fetchSubmodule option is problematic because it is hard to make it deterministic. It would be nice if you find a way to build qhexview as a separate derivation, and use it as a normal dependency instead of a submodule. Then the non-determinism would disappear. Of course, depending on the build system of edb, this may or may not be feasible.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok. I will have a go at packaging qhexview as a separate derivation.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it is worth packaging qhexview seperately as it only contains a single .cpp and .h file.

AFAICT the non-determinism is caused by leaveDotGit not fetchSubmodules (see #8567).
Therefore, I have removed the leaveDotGit option and instead create the .git directory in postPatch. This is the same approach taken in the hotspot package:

# hotspot checks for the presence of third party libraries'
# git directory to give a nice warning when you forgot to clone
# submodules; but Nix clones them and removes .git (for reproducibility).
# So we need to fake their existence here.
postPatch = ''
mkdir -p 3rdparty/perfparser/.git
'';

Copy link
Member

Choose a reason for hiding this comment

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

Ah sorry for having misled you about fetchSubmodules. I stand corrected. It is nice that you found a way out.

@symphorien
Copy link
Member

When trying edb, I got the following error message:

Could not launch the desired terminal ["/usr/bin/xterm"], please check that it exists and you have proper permissions.

(the window still opens normally, though).
It might be nice to patch the path in the source before compiling.

@lihop lihop changed the title edb: init at 2019-04-04 [WIP] edb: init at 2019-04-04 Apr 4, 2019
@lihop
Copy link
Member Author

lihop commented Apr 10, 2019

It might be nice to patch the path in the source before compiling.

I am not sure about patching the path xterm. Wouldn't this make xterm a dependency when it isn't? From the CHANGELOG:

* Command window program is now configurable in the debugging options dialog.
  You can enable/disable it, and you can use the terminal program of your 
  choice. The default is /usr/bin/xterm, as this should be fairly ubiquitous.

However, I have a bigger problem in that the absolute path to the terminal program and plugin directory is stored in ~/.config/codef00.com/edb.conf:

Screenshot_2019-04-10 Build software better, together(2)
Screenshot_2019-04-10 Build software better, together

If edb.conf doesn't exist, the file will be created and the patched values copied to it. otherwise they will be read directly from config file. This means that when the user updates packages and the path to the edb changes, it will continue to load plugins from the old path and will break after garbage collection:

2019-04-10-102407_498x74_scrot

The only workaround I can think of is to wrap the program with a command that checks ~/.config/codef00.com/edb.conf for an absolute nix store path and then updates it to the correct nix store path.

@symphorien
Copy link
Member

For the terminal: It looks like a non-absolute path is accepted. So you can replace /usr/bin/xterm with just xterm. xterm is a rather safe bet because it is installed by the xserver NixOS module.

For the plugin path: no obvious solution comes to my mind. Maybe patching the parsing of the configuration file to hardcode $out/lib/.... ?

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@maxxk
Copy link
Contributor

maxxk commented Aug 23, 2020

@lihop Plugin directory blocker was now fixed in edb-unstable. Are you interested in updating the package?

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 23, 2020
@lihop
Copy link
Member Author

lihop commented Aug 24, 2020

Thanks @maxxk. I've updated the package to use the latest version of edb and to work with the way qt packages are built now.

@lihop lihop changed the title [WIP] edb: init at 2019-04-04 edb: init at 2020-08-21 Aug 24, 2020
@lihop lihop requested a review from symphorien August 24, 2020 08:03
@maxxk
Copy link
Contributor

maxxk commented Aug 24, 2020

Works for me starting from empty config when switching between this branch and this derivation on top of NixOS 20.03 branch.

@symphorien
Copy link
Member

I tried it with nix-review and this issue #58962 (comment) makes it nearly unusable...

@maxxk
Copy link
Contributor

maxxk commented Aug 27, 2020

I tried it with nix-review and this issue #58962 (comment) makes it nearly unusable...

You mean plugin path? Probably you have a local config file with plugin path from previous version? If you remove plugin path entry from config file (or remove/rename config file itself) it should work. If it doesn't, there is probably a problem with my code.

@symphorien
Copy link
Member

Indeed removing the file works.

Now I get this error message:

Could not launch the desired terminal ["/usr/bin/xterm"], please check that it exists and you have proper permissions.

Also CTRL+B import breakpoints opens a window which is never drawn.

@lihop
Copy link
Member Author

lihop commented Aug 28, 2020

For the "/usr/bin/xterm" error, this is the default config value for the terminal program that can be changed in Preferences. I'm not sure how or if we should patch the program to use a different default value.

As for the CTRL+B import it appears to be drawing all windows for me, but I haven't tested it beyond that:
2020-08-28-081810_868x367_scrot

I haven't tried to use this program (or one like it) in a long time and am not currently using it, so I don't think I am the best person to add/maintain it. @maxxk Are you interested in becoming maintainer of this package and getting it added?

@symphorien
Copy link
Member

/usr/bin/xterm is always wrong on NixOS. It should be replaced to xterm (or /usr/bin/env xterm or something along these lines, but it looks like xterm just works), with a patch or with substituteInPlace.

@lihop lihop force-pushed the add-edb branch 2 times, most recently from 8dedf15 to ac3279e Compare August 29, 2020 06:13
@lihop
Copy link
Member Author

lihop commented Aug 29, 2020

@symphorien I've added these lines for xterm:
https://github.com/NixOS/nixpkgs/blob/ac3279e8979d4a954ac83866913f8e5c6e46c5e0/pkgs/development/tools/misc/edb/default.nix#L31-L32
I didn't want to use ${xterm}/bin/xterm because that would make xterm a dependency of this package but the terminal program is optional and any terminal can be used, not just xterm.

@maxxk
Copy link
Contributor

maxxk commented Aug 29, 2020

Are you interested in becoming maintainer of this package and getting it added?

@lihop Yes. You can add me as co- or a sole maintainer. However, you made a great job with this package (I used your definition for about a year in an override), so I don't think any further changes to the package are required to add it.

@lihop
Copy link
Member Author

lihop commented Aug 29, 2020

Ok @maxxk, I've added you as co-maintainer. Thank you and symphorien for your help with this package.

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.

stdenv.lib and pkgconfig got recently depracated.

pkgs/development/tools/misc/edb/default.nix Outdated Show resolved Hide resolved
pkgs/development/tools/misc/edb/default.nix Outdated Show resolved Hide resolved
pkgs/development/tools/misc/edb/default.nix Outdated Show resolved Hide resolved
pkgs/development/tools/misc/edb/default.nix Outdated Show resolved Hide resolved
@lihop lihop changed the title edb: init at 2020-08-21 edb: init at 1.3.0 Feb 9, 2021
@lihop
Copy link
Member Author

lihop commented Feb 9, 2021

Thanks @SuperSandro2000, I've added those changes. I also noticed version 1.3.0 has been released so upgraded to that version.
cc @maxxk

@ofborg ofborg bot requested a review from maxxk February 9, 2021 01:38
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Feb 9, 2021

Can you set the platform to x86-64 linux only? aarch fails to build with unsupported platform.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
@lihop
Copy link
Member Author

lihop commented Feb 9, 2021

Can you set the platform to x86-64 linux only? aarch fails to build with unsupported platform.

Done.

@SuperSandro2000 SuperSandro2000 merged commit 07848f0 into NixOS:master Feb 9, 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

6 participants