flathub / org.ghidra_sre.Ghidra

https://flathub.org/apps/details/org.ghidra_sre.Ghidra
7 stars 8 forks source link

Update to Ghidra 10.1.3 #18

Closed mpi3d closed 2 years ago

mpi3d commented 2 years ago

After spending some time updating this Flatpak, I've managed to make it work with the latest Ghidra version.

This should solve #6, #12, #14, #15, #16, and also NationalSecurityAgency/ghidra#3726.

I changed many things: For exemple Ghidra is installed in /app/ghidra. I removed ghidra.properties options. Also I use cp instead of install. Fell free to revert those changes. I've just cleaned all those things to make it work in a first place. But now that it works...

flathubbot commented 2 years ago

Started test build 82596

hadess commented 2 years ago

But now that it works...

I can hazard a guess and say that it won't build.

If you have tested the patch locally though, I would be grateful if you could file a PR for it upstream so it gets in the next point release, which we could then pick up.

mpi3d commented 2 years ago

But now that it works...

I can hazard a guess and say that it won't build.

If you have tested the patch locally though, I would be grateful if you could file a PR for it upstream so it gets in the next point release, which we could then pick up.

I've tested that locally. And it works. Really.

mpi3d commented 2 years ago

I'll find another way to resolve this network issue.

hadess commented 2 years ago

I'll find another way to resolve this network issue.

Ideally gradle support would be added to the flatpak-builder-tools: https://github.com/flatpak/flatpak-builder-tools/issues/37 So that tarballs could be prefetched.

flathubbot commented 2 years ago

Build 82596 failed

mpi3d commented 2 years ago

Ok, so I thought that removing gradle -I gradle/support/fetchDependencies.gradle init and download them manualy as described here would work. But it seems that gradle buildGhidra also need network to download somes dependencies too.

We could download all dependences that Gradle needs and put them in the cache. But this is a very hacky method. Instead I'm proposing to fork the Ghidra repo to apply the patchs and setup an automated build bot that would release the Ghidra zip file. @hadess Maybe you have a better idea? We can also wait for Gradle to be supported by Flatpak Builder. But it doesn't seems to be supported any time soon.

flathubbot commented 2 years ago

Started test build 83473

mpi3d commented 2 years ago

I did found a more pleasant way to download dependencies using Flatpak Builder and then build with gradle offline. I also improved the patch

flathubbot commented 2 years ago

Build 83473 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/81340/org.ghidra_sre.Ghidra.flatpakref
mpi3d commented 2 years ago

Sounds like the build works fine! @hadess Is it ok for merging?

hadess commented 2 years ago

It will need reviewing. As a quick review, given the number of changes, the changes would need to be split up in as many commits as it makes sense, first adding the json files with the dependencies (and explaining how they were generated), updating the build system, adding the missing releases, etc. all in small, trivial, commits so that the review is easier.

Thanks for working on that!

mpi3d commented 2 years ago

Ok. I'll try to make that.

flathubbot commented 2 years ago

Started test build 83525

flathubbot commented 2 years ago

Build 83525 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/81390/org.ghidra_sre.Ghidra.flatpakref
mpi3d commented 2 years ago

I split this in multiples commits. Just ping me if you don't understand something. Concerning the deps, for Ghidra (f3e4088ab26929ba48bc4a1be8d53f609429f007), I just followed the Ghidra Dev Guide and also fetchDependencies.gradle. For Gradle (3639edce785ebbc2232c7c0b444755ea3474d1e6) it was more hard. I had to run Gradle offline and add deps for each network error concerning dependences downloads. It sounds hacky but I don't think that Gradle support listing the deps for a project because it just resolve them at compile time.

flathubbot commented 2 years ago

Started test build 84486

mpi3d commented 2 years ago

Forgot to mention NationalSecurityAgency/ghidra#4107

flathubbot commented 2 years ago

Build 84486 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/82347/org.ghidra_sre.Ghidra.flatpakref
flathubbot commented 2 years ago

Started test build 84488

flathubbot commented 2 years ago

Build 84488 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/82349/org.ghidra_sre.Ghidra.flatpakref
mpi3d commented 2 years ago

@hadess This has been a long time. What's happening? Do I need to do something else?

hadess commented 2 years ago

@hadess This has been a long time. What's happening? Do I need to do something else?

I've been waiting for your updates on my review comments since the beginning of April, in particular, this one: https://github.com/flathub/org.ghidra_sre.Ghidra/pull/18#discussion_r836394197 which I can't merge your changes without, because it would then be impossible for me to update the dependencies.

Once you've reviewed all the comments, and as you fix them, please make sure to mark the threads as "resolved" along with a comment explaining how you fixed it (eg. whether you modified an existing commit, dropped a patch, or something else).

mpi3d commented 2 years ago

@hadess Oh, ok. I did forget to mark them as resolved. Sorry, I'm not an expert in Git.

I did resolve them all. https://github.com/flathub/org.ghidra_sre.Ghidra/pull/18#discussion_r836394197 is solved too.

Also, you should know that I will still be there after this merge. So in case of any future problem with dependencies I can help. You just need to contact me.

Tell me if there is something else to do.

hadess commented 2 years ago

I'll look at this on Monday, but I'm still not happy with the way gradle-dependencies.json is generated. We need a better way to do this.

mpi3d commented 2 years ago

I don't think there is any better way to generate this. No one is providing such script:

flathubbot commented 2 years ago

Started test build 90463

flathubbot commented 2 years ago

Build 90463 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/88248/org.ghidra_sre.Ghidra.flatpakref
hadess commented 2 years ago

I don't think there is any better way to generate this. No one is providing such script:

* https://github.com/flathub/com.tonikelope.MegaBasterd/blob/master/maven-dependencies.yaml

* https://github.com/flathub/es.estoes.wallpaperDownloader/blob/master/maven-dependencies.yaml

I made some notes at https://github.com/flatpak/flatpak-builder-tools/issues/37#issuecomment-1121368390

hadess commented 2 years ago

Can you please check whether this works? https://github.com/flatpak/flatpak-builder-tools/pull/276

You might need to declare the .exe downloads separately.

mpi3d commented 2 years ago

Can you please check whether this works? flatpak/flatpak-builder-tools#276

You might need to declare the .exe downloads separately.

I'm on it

mpi3d commented 2 years ago

I made a script to generate gradle deps:

#!/usr/bin/env bash

git clone https://github.com/NationalSecurityAgency/ghidra.git -b Ghidra_10.1.2_build deps-build
cd deps-build
echo "source /usr/lib/sdk/openjdk11/enable.sh && gradle -g gradle-cache -I gradle/support/fetchDependencies.gradle init && rm -rf gradle-cache && gradle -g gradle-cache --info --console plain buildGhidra > gradle-log.txt" | flatpak run --share=network --filesystem=`pwd` --devel org.freedesktop.Sdk//21.08 < /dev/stdin
# wget {gradle script}
./flatpak-gradle-generator.py gradle-log.txt ../gradle-dependencies.json --destdir dependencies/flatRepo --arches linux-x86_64 linux-aarch_64
cd ..
rm -rf deps-build

I'm waiting for flatpak/flatpak-builder-tools#276 to be merged.

flathubbot commented 2 years ago

Started test build 90865

flathubbot commented 2 years ago

Build 90865 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/88647/org.ghidra_sre.Ghidra.flatpakref
flathubbot commented 2 years ago

Started test build 90870

flathubbot commented 2 years ago

Build 90870 failed

mpi3d commented 2 years ago

@hadess Sounds like the build failed because of an internal error.

mpi3d commented 2 years ago

bot, build

flathubbot commented 2 years ago

Queued test build for org.ghidra_sre.Ghidra.

flathubbot commented 2 years ago

Started test build 90872

flathubbot commented 2 years ago

Build 90872 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/88654/org.ghidra_sre.Ghidra.flatpakref
mpi3d commented 2 years ago

Better

mpi3d commented 2 years ago

bot, build

flathubbot commented 2 years ago

Queued test build for org.ghidra_sre.Ghidra.

mpi3d commented 2 years ago

I hope this is ok for the merge.

flathubbot commented 2 years ago

Started test build 90953

flathubbot commented 2 years ago

Build 90953 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/88732/org.ghidra_sre.Ghidra.flatpakref
flathubbot commented 2 years ago

Started test build 90981

flathubbot commented 2 years ago

Started test build 90983

hadess commented 2 years ago

I've reworked the commit messages and contents to my liking. I'll wait for the last 10.1.3 build to finish and will run a quick test. If all that passes, I'll push all this. Thanks very much for your help in getting all this updated.