Skip to content

ghidra, ghidra-bin: 11.3.2 -> 11.4.1 #427883

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SuperSamus
Copy link
Contributor

Things done

Only did light testing.

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. labels Jul 23, 2025
@nix-owners nix-owners bot requested review from ck3d, GovanifY, Mic92 and vringar July 23, 2025 22:02
@jys1670
Copy link

jys1670 commented Jul 25, 2025

I can confirm this builds and runs fine on x86_64-linux.

While at it, can you please extend the postFixup phase with the following fix for #393241:

pypkg_paths=()
for dir in $out/lib/ghidra/Ghidra/Debug/*/; do
  if [ -d "$dir/pypkg/src" ]; then
    pypkg_paths+=("''${dir%/}/pypkg/src")
  fi
done

if [ ''${#pypkg_paths[@]} -gt 0 ]; then
  pypkg_string=$(IFS=:; echo "''${pypkg_paths[*]}")
  
  find $out/lib/ghidra/Ghidra/Debug/*/ -type f -name "*.sh" -exec \
    sed -i "s|^\(export PYTHONPATH=.*\):\(\\\$PYTHONPATH\)$|\1:$pypkg_string:\2|" {} \;
fi

The idea is to append ghidra python packages to $PYTHONPATH so it works even with symlinked environments created by withExtensions.

For example, the file
$out/lib/ghidra/Ghidra/Debug/Debugger-agent-gdb/data/debugger-launchers/local-gdb.sh
contains the line
export PYTHONPATH=$pypathGdb:$pypathTrace:$PYTHONPATH
which will be replaced with something like:

export PYTHONPATH=$pypathGdb:$pypathTrace:/nix/store/y7mbw90hjcsawl1d60l8nb26jfx6m2cb-ghidra-11.4/lib/ghidra/Ghidra/Debug/Debugger-agent-dbgeng/pypkg/src:/nix/store/y7mbw90hjcsawl1d60l8nb26jfx6m2cb-ghidra-11.4/lib/ghidra/Ghidra/Debug/Debugger-agent-drgn/pypkg/src:/nix/store/y7mbw90hjcsawl1d60l8nb26jfx6m2cb-ghidra-11.4/lib/ghidra/Ghidra/Debug/Debugger-agent-gdb/pypkg/src:/nix/store/y7mbw90hjcsawl1d60l8nb26jfx6m2cb-ghidra-11.4/lib/ghidra/Ghidra/Debug/Debugger-agent-lldb/pypkg/src:/nix/store/y7mbw90hjcsawl1d60l8nb26jfx6m2cb-ghidra-11.4/lib/ghidra/Ghidra/Debug/Debugger-rmi-trace/pypkg/src:$PYTHONPATH

With these changes gdb in ghidra.withExtensions starts normally for me (if programs.ghidra.gdb = true)

@SuperSamus
Copy link
Contributor Author

Wouldn't it be better to do this in a separate PR?
(BTW, there already is an open PR for that: #398970)

@jys1670
Copy link

jys1670 commented Jul 25, 2025

Wouldn't it be better to do this in a separate PR? (BTW, there already is an open PR for that: #398970)

This is basically abandoned #408548 (comment)

As for a separate pr - these kinds of small changes usually take forever to review and merge into master, mainly due to limited availability of maintainers; when it gets reviewed, a new ghidra version might come out already.

That's why I suggest including small changes (affecting the ghidra build process) in the version update pr.

@MisileLab
Copy link
Contributor

@SuperSamus SuperSamus changed the title ghidra, ghidra-bin: 11.3.2 -> 11.4 ghidra, ghidra-bin: 11.3.2 -> 11.4.1 Aug 1, 2025
@jys1670 jys1670 mentioned this pull request Aug 13, 2025
13 tasks
Copy link
Contributor

@roblabla roblabla left a comment

Choose a reason for hiding this comment

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

As far as pkgs.ghidra goes (I don't use ghidra-bin, can't test it), LGTM.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Aug 13, 2025
@Sigmanificient
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 427883

Logs: https://github.com/Sigmanificient/nixpkgs-review-gha/actions/runs/17025498407


x86_64-linux

✅ 14 packages built:
  • ghidra
  • ghidra-bin
  • ghidra-extensions.findcrypt
  • ghidra-extensions.ghidra-delinker-extension
  • ghidra-extensions.ghidra-firmware-utils
  • ghidra-extensions.ghidra-golanganalyzerextension
  • ghidra-extensions.ghidraninja-ghidra-scripts
  • ghidra-extensions.gnudisassembler
  • ghidra-extensions.kaiju
  • ghidra-extensions.lightkeeper
  • ghidra-extensions.machinelearning
  • ghidra-extensions.ret-sync
  • ghidra-extensions.sleighdevtools
  • ghidra-extensions.wasm

aarch64-linux

✅ 14 packages built:
  • ghidra
  • ghidra-bin
  • ghidra-extensions.findcrypt
  • ghidra-extensions.ghidra-delinker-extension
  • ghidra-extensions.ghidra-firmware-utils
  • ghidra-extensions.ghidra-golanganalyzerextension
  • ghidra-extensions.ghidraninja-ghidra-scripts
  • ghidra-extensions.gnudisassembler
  • ghidra-extensions.kaiju
  • ghidra-extensions.lightkeeper
  • ghidra-extensions.machinelearning
  • ghidra-extensions.ret-sync
  • ghidra-extensions.sleighdevtools
  • ghidra-extensions.wasm

x86_64-darwin (sandbox = true)

✅ 2 packages built:
  • ghidra-bin
  • ghidra-extensions.ghidraninja-ghidra-scripts

aarch64-darwin (sandbox = true)

❌ 12 packages failed to build:
  • ghidra
  • ghidra-extensions.findcrypt
  • ghidra-extensions.ghidra-delinker-extension
  • ghidra-extensions.ghidra-firmware-utils
  • ghidra-extensions.ghidra-golanganalyzerextension
  • ghidra-extensions.gnudisassembler
  • ghidra-extensions.kaiju
  • ghidra-extensions.lightkeeper
  • ghidra-extensions.machinelearning
  • ghidra-extensions.ret-sync
  • ghidra-extensions.sleighdevtools
  • ghidra-extensions.wasm
✅ 2 packages built:
  • ghidra-bin
  • ghidra-extensions.ghidraninja-ghidra-scripts

Error logs: `aarch64-darwin`
ghidra
2025-08-17T20:31:10.445+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=be635028-4770-4c9f-ba0a-171cc3fce855,javaHome=/nix/store/rd89a3gnapg7wzs7w3h6vv3b4ha7md5x-zulu-ca-jdk-21.0.4/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home,javaVersion=21,javaVendor=Azul Systems, Inc.,daemonRegistryDir=/nix/build/nix-build-ghidra-11.4.1.drv-5744-2349914155/tmp.zMOp0Z51us/daemon,pid=7958,idleTimeout=120000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=-Xmx2G,-Dfile.encoding=UTF-8,-Djavax.net.ssl.trustStore=/nix/build/nix-build-ghidra-11.4.1.drv-5744-2349914155/tmp.tXQWvmFvHp/keystore,-Djavax.net.ssl.trustStorePassword=4CT7YS6ZCVNGZOM4,-Duser.country=US,-Duser.language=en,-Duser.variant]
2025-08-17T20:31:10.445+0000 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [9f00391c-4cbb-44c7-83d7-8ad05dff7258 port:49212, addresses:[localhost/127.0.0.1]], context: DefaultDaemonContext[uid=be635028-4770-4c9f-ba0a-171cc3fce855,javaHome=/nix/store/rd89a3gnapg7wzs7w3h6vv3b4ha7md5x-zulu-ca-jdk-21.0.4/Library/Java/JavaVirtualMachines/zulu-21.jdk/Contents/Home,javaVersion=21,javaVendor=Azul Systems, Inc.,daemonRegistryDir=/nix/build/nix-build-ghidra-11.4.1.drv-5744-2349914155/tmp.zMOp0Z51us/daemon,pid=7958,idleTimeout=120000,priority=NORMAL,applyInstrumentationAgent=true,nativeServicesMode=ENABLED,daemonOpts=-Xmx2G,-Dfile.encoding=UTF-8,-Djavax.net.ssl.trustStore=/nix/build/nix-build-ghidra-11.4.1.drv-5744-2349914155/tmp.tXQWvmFvHp/keystore,-Djavax.net.ssl.trustStorePassword=4CT7YS6ZCVNGZOM4,-Duser.country=US,-Duser.language=en,-Duser.variant]
2025-08-17T20:31:10.450+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2025-08-17T20:31:10.451+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2025-08-17T20:31:10.452+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2025-08-17T20:31:10.453+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2025-08-17T20:31:10.453+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2025-08-17T20:31:10.454+0000 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2025-08-17T20:31:10.454+0000 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
2025-08-17T20:31:10.455+0000 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
2025-08-17T20:31:10.460+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
2025-08-17T20:31:10.461+0000 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
2025-08-17T20:31:10.461+0000 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.----- End of the daemon log -----
  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants