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

Update to Ghidra 10.1.3 #18

Merged
merged 10 commits into from
May 12, 2022
Merged

Update to Ghidra 10.1.3 #18

merged 10 commits into from
May 12, 2022

Conversation

mpi3d
Copy link
Contributor

@mpi3d mpi3d commented Mar 21, 2022

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
Copy link
Contributor

Started test build 82596

org.ghidra_sre.Ghidra.json Outdated Show resolved Hide resolved
@hadess
Copy link
Collaborator

hadess commented Mar 21, 2022

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.

org.ghidra_sre.Ghidra.json Outdated Show resolved Hide resolved
@mpi3d
Copy link
Contributor Author

mpi3d commented Mar 21, 2022

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
Copy link
Contributor Author

mpi3d commented Mar 21, 2022

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

@hadess
Copy link
Collaborator

hadess commented Mar 21, 2022

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

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

@flathubbot
Copy link
Contributor

Build 82596 failed

@mpi3d
Copy link
Contributor Author

mpi3d commented Mar 22, 2022

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
Copy link
Contributor

Started test build 83473

@mpi3d
Copy link
Contributor Author

mpi3d commented Mar 26, 2022

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
Copy link
Contributor

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
Copy link
Contributor Author

mpi3d commented Mar 26, 2022

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

@hadess
Copy link
Collaborator

hadess commented Mar 26, 2022

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
Copy link
Contributor Author

mpi3d commented Mar 26, 2022

Ok. I'll try to make that.

@flathubbot
Copy link
Contributor

Started test build 83525

@flathubbot
Copy link
Contributor

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
Copy link
Contributor Author

mpi3d commented Mar 26, 2022

I split this in multiples commits. Just ping me if you don't understand something.
Concerning the deps, for Ghidra (f3e4088), I just followed the Ghidra Dev Guide and also fetchDependencies.gradle.
For Gradle (3639edc) 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.

Copy link
Collaborator

@hadess hadess left a comment

Choose a reason for hiding this comment

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

Quite a few nits to fix before this can be merged, but apart from "how to generate the gradle deps", it's just git surgery. Good job.

org.ghidra_sre.Ghidra.json Outdated Show resolved Hide resolved
org.ghidra_sre.Ghidra.json Show resolved Hide resolved
org.ghidra_sre.Ghidra.json Outdated Show resolved Hide resolved
TODO Outdated Show resolved Hide resolved
org.ghidra_sre.Ghidra.json Show resolved Hide resolved
org.ghidra_sre.Ghidra.json Outdated Show resolved Hide resolved
org.ghidra_sre.Ghidra.json Outdated Show resolved Hide resolved
org.ghidra_sre.Ghidra.json Show resolved Hide resolved
org.ghidra_sre.Ghidra.json Show resolved Hide resolved
last_modified.patch Show resolved Hide resolved
@flathubbot
Copy link
Contributor

Started test build 84486

@mpi3d
Copy link
Contributor Author

mpi3d commented Apr 2, 2022

Forgot to mention NationalSecurityAgency/ghidra#4107

@flathubbot
Copy link
Contributor

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
Copy link
Contributor

Started test build 84488

@mpi3d mpi3d requested a review from hadess April 2, 2022 10:17
@flathubbot
Copy link
Contributor

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
Copy link
Contributor Author

mpi3d commented May 3, 2022

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

@hadess
Copy link
Collaborator

hadess commented May 3, 2022

@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:
#18 (comment)
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
Copy link
Contributor Author

mpi3d commented May 5, 2022

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

I did resolve them all.
#18 (comment) 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
Copy link
Collaborator

hadess commented May 6, 2022

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
Copy link
Contributor Author

mpi3d commented May 6, 2022

@flathubbot
Copy link
Contributor

Started test build 90953

@flathubbot
Copy link
Contributor

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

mpi3d added 8 commits May 12, 2022 15:00
Those are dependencies that wouldn't be automatically downloaded by
running Gradle.

They're listed at:
https://github.com/NationalSecurityAgency/ghidra/blob/master/DevGuide.md#manual-download-instructions
File was generated by using flatpak-gradle-generator.py in:
flatpak/flatpak-builder-tools#276
And generate-deps.sh
Instead of repackaging binaries. This will allow us to add patches as
necessary.

Build instructions are listed at:
https://github.com/NationalSecurityAgency/ghidra/blob/master/DevGuide.md#building-ghidra
Use cp instead of install. Since we are building Ghidra from source, only
Linux platform files are generated, so we can copy the entire directory.
@flathubbot
Copy link
Contributor

Started test build 90981

@hadess hadess changed the title Update to Ghidra 10.1.2 Update to Ghidra 10.1.3 May 12, 2022
@flathubbot
Copy link
Contributor

Started test build 90983

@hadess
Copy link
Collaborator

hadess commented May 12, 2022

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.

@flathubbot
Copy link
Contributor

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

flatpak install --user https://dl.flathub.org/build-repo/88760/org.ghidra_sre.Ghidra.flatpakref

@flathubbot
Copy link
Contributor

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

flatpak install --user https://dl.flathub.org/build-repo/88762/org.ghidra_sre.Ghidra.flatpakref

Stops it from clobbering the stable release if installed.
@flathubbot
Copy link
Contributor

Started test build 90988

@flathubbot
Copy link
Contributor

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

flatpak install --user https://dl.flathub.org/build-repo/88767/org.ghidra_sre.Ghidra.flatpakref

@mpi3d
Copy link
Contributor Author

mpi3d commented May 12, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants