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

GhidraDev default module plugin fails to build out of the box #4962

Closed
sad-dev opened this issue Feb 6, 2023 · 6 comments
Closed

GhidraDev default module plugin fails to build out of the box #4962

sad-dev opened this issue Feb 6, 2023 · 6 comments
Assignees
Labels
Feature: Eclipse Status: Internal This is being tracked internally by the Ghidra team
Milestone

Comments

@sad-dev
Copy link
Contributor

sad-dev commented Feb 6, 2023

I must have missed something, but these were the steps I have taken (roughly following https://voidstarsec.com/blog/ghidra-dev-environment):

gradle -I gradle/support/fetchDependencies.gradle init
gradle prepdev
gradle eclipse -PeclipsePDE
gradle buildGhidra

install the latest versions of eclipse, CDT, PyDev, and PDE

File > Import > General > Existing Projects into Workspace
Add both EclipseGhidraDevFeature and EclipseGhidraDevPlugin
Add both _LaunchSupport and Framework Utility because Eclipse refuses to buiid without them

Eclipse complains about IPythonNature.JYTHON_VERSION_2_7 in PyDevUtilsInternal.java which I replaced with "jython 2.7"

File > Export > Plug-in Development > Deployable Features
Help > Install New Software
Install ghidraDev

GhidraDev->New Ghidra Module Project
Select just Plugin in the module templates. Link the ghidra build created by the gradle buildGhidra command run at the start.
GhidraDev->Export->Ghidra Module Extension

The build fails with errors like:
Cannot find expected stylesheet: .../MyFirstGhidraPlugin/Framework/Help/src/main/resources/help/shared/DefaultStyle.css

Copying the Framework folder from ghidra results in another error:

Exception in thread "main" ghidra.util.exception.AssertException: Errors parsing HTML file: help.html
Incorrect stylesheet defined - none match .../MyFirstGhidraPlugin/Framework/Help/src/main/resources/help/shared/DefaultStyle.css in file .../MyFirstGhidraPlugin/src/main/help/help/topics/myfirstghidraplugin/help.html
	Discovered stylesheets: [.../MyFirstGhidraPlugin/Framework/Help/src/main/resources/help/shared/Frontpage.css]

I'm inclined to believe that I must have missed something obvious in the documentation (or the template is not meant to be buildable?), so any help/advice would be most welcome - is there some command I should have run to get all the necessary files?

(For the record, deleting src/main/help skips building help and thus all these errors, so not the biggest deal)

@sad-dev sad-dev changed the title GhidraDev default module plugin fails to build GhidraDev default module plugin fails to build out of the box Feb 6, 2023
@ryanmkurtz
Copy link
Collaborator

You didn't make any alterations to the new project that the wizard created for you? It just failed to export as a new extension out of the box?

@ryanmkurtz ryanmkurtz self-assigned this Feb 6, 2023
@dragonmacher
Copy link
Collaborator

We recently changed the help page stylesheet name. I see you are still using the old style:

[.../MyFirstGhidraPlugin/Framework/Help/src/main/resources/help/shared/Frontpage.css]

The correct file should now be:

/Ghidra/Framework/Help/src/main/resources/help/shared/DefaultStyle.css

The error message implies that you your Help module is not up-to-date with the build system.

@ryanmkurtz
Copy link
Collaborator

Using a build of the current master (394c544), i was not able to reproduce this. I built a new GhidraDev Eclipse plugin the same way you described, installed it, created a new Module project linked against my built Ghidra, and then exported the module. I used a local Gradle 7.6 to do the export. I didn't have PyDev or CDT installed, but I don't those things are related to your Help error.

@sad-dev
Copy link
Contributor Author

sad-dev commented Feb 7, 2023

I updated to the current master (394c544) as well and repeated the same steps.
image

help.html still specifies Frontpage.css and appears to be a copy of https://github.com/NationalSecurityAgency/ghidra/blob/394c544/GhidraBuild/Skeleton/src/main/help/help/topics/skeleton/help.html. Updating skeleton/help.html (in Ghidra) to help/shared/Frontpage.css does result in a change in the module, but DefaultStyle.css and other required files are not yet in the module project anyway.

copying Ghidra/Framework/Help/src/main/resources/help/shared to MyFirstGhidraPlugin/Framework/Help/src/main/resources/help/shared does allow a build with a few minor errors

image

@ryanmkurtz
Copy link
Collaborator

Ok, I am reproducing it now. We'll get it fixed. Thanks!

@ryanmkurtz ryanmkurtz added Status: Internal This is being tracked internally by the Ghidra team and removed Status: Waiting on customer Waiting for customer feedback labels Feb 7, 2023
@ryanmkurtz ryanmkurtz added this to the 10.3 milestone Feb 14, 2023
@shuffle2
Copy link

shuffle2 commented Jun 3, 2024

Eclipse complains about IPythonNature.JYTHON_VERSION_2_7 in PyDevUtilsInternal.java

This problem still exists, hitting it when building GhidraDev on current master, 2a83263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Eclipse Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

No branches or pull requests

4 participants