13 Commits

Author SHA1 Message Date
Eric Kilmer 86f39ba60f Detect new files requiring manual intervention in Ghidra HEAD updates (#390)
Add functionality to the weekly sync workflow to detect newly added or
deleted C++ source files and spec files that may require manual CMake
configuration updates. When such files are detected, the PR body will
include a warning section listing the files and instructions for
maintainers.

This addresses issue #121 where new files added to Sleigh in Ghidra
weren't being noticed, leading to missing headers that required manual
fixes later.

Changes:
- Add CategorizedChanges dataclass to track added/deleted cpp/spec files
- Add helper methods to parse git status and categorize files
- Expand IGNORED_EXTENSIONS to filter more non-relevant file types
- Set new GitHub Actions outputs: needs_manual_intervention and
  intervention_details
- Update workflow to conditionally add warning section to PR body

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 09:44:50 -05:00
Eric Kilmer a0a8aa27c0 Minor text output formatting changes, docs, mypy 2025-04-24 14:04:24 -04:00
Eric Kilmer 3efc7415f8 Reduce code duplication
Used Cursor v0.46.11 with claude-3.7-sonnet-thinking Agent mode with context
files:
- scripts/update_ghidra_head.py

and the following prompt (in the same chat as the parent commit):

---------------------

Please reduce code duplication when appropriate
2025-04-24 14:04:24 -04:00
Eric Kilmer 45dc2a0dbb Python Ghidra update script can compare arbitrary commits
Used Cursor v0.46.11 with claude-3.7-sonnet-thinking Agent mode with context
files:
- scripts/update_ghidra_head.py

and the following prompt:

---------------------

Please add an option to allow the user to specify begin and end commits, such
that the script does not read from or update the CMake file and requires
specifying an existing Ghidra git repository. For instance, it would look
something like the following, where `Ghidra_11.3_build` and `Ghidra_11.3.1_build`
are starting and ending commit, respectively.

```
python3 ./scripts/update_ghidra_head.py --ghidra-repo ./src/ghidra-HEAD Ghidra_11.3_build Ghidra_11.3.1_build
```

I also want it to support where only a starting commit is provided, and it shows
the commits from start to the current commit specified by `--ghidra-repo` path.
This also shouldn't update anything

```
python3 ./scripts/update_ghidra_head.py --ghidra-repo ./src/ghidra-HEAD Ghidra_11.3_build
```
2025-04-24 14:04:24 -04:00
Eric Kilmer b9eef57dee Refactor Python Ghidra update script for organization and clarity
Used Cursor v0.46.11 with claude-3.7-sonnet-thinking Agent mode with context
files:
- scripts/update_ghidra_head.py
- .github/workflows/main.yml

and the following prompt:

---------------------

Please refine the Python script to be more succinct, easier to understand, and
extendable. Use professional Python 3 constructs, syntax, and design. Do not
overcomplicate it. This script is standalone and won't be integrated into a
larger project.
2025-04-24 14:04:14 -04:00
Eric Kilmer b871c4a6b8 Fix bug with Python Ghidra update scripts
It wasn't splitting the commits correctly and added text to the commit
body when there wasn't one

Also put the commit body starting on a new line
2025-03-12 13:11:21 -04:00
Eric Kilmer 58f4812a02 Improve Ghidra update process with commit details and dry run mode (#325)
Add detailed commit information to the Ghidra HEAD update process:
- Display information about each commit affecting sleigh files
- Include these commit details in GitHub Action PR descriptions
- Add --dry-run flag to preview changes without modifying files
- Improve output formatting and error handling

Also reformat the Python script with ruff
2025-03-12 14:41:09 +00:00
Eric Kilmer aeea2f6d2e ci: Ignore java file in file update listing 2025-02-09 17:09:58 -05:00
Eric Kilmer 2c197599aa Fix update_ghidra_head script git output parsing
Python string split behaves differently than I assumed:

>>> "".split("\n")
['']

returns a list of size 1 but

>>> "".split()
[]

returns size 0 and

>>> "".splitlines()
[]

also returns size 0
2022-12-19 11:05:48 -05:00
Eric Kilmer b80fefc001 Update auto-updater script
Should now show changed files on each update.

Only updates if files that affect this project have changed
2022-12-15 13:15:44 -05:00
Eric Kilmer 74838a39ba CMake refactor (#105)
* Major CMake refactor

* CI fixes

* Fix CMake errors

* Install graphviz on Windows

* More consistent CMake build types

* Fix compiler defines for Windows

* Fix more bugs

* Add standalone tool building support

* Fix typo

* Update README

* Install sleighLift before trying to smoketest it

* Test coverage preset

The compiler option '-fkeep-inline-functions' originally included with
the coverage build type causes errors with the message "undefined
reference to 'vtable for OpAction*'" for all OpAction subclasses.

This StackOverflow answer might help in resolving this?
https://stackoverflow.com/a/57504289

* Build documentation by default with CI presets

* Use COMPONENT for install commands

This allows for someone to specify which components they want to install
if they only want or need a subset

* Support cross compiling with host system sleigh compiler

* Various fixes found during review

* Move "_WINDOWS" define to CMakeLists.txt file

* Rename ToB 'tools' directory to 'extra-tools'

* Separate projects for sleigh tools

Library is still top-level CMakeLists.txt

More options

* CMake find_package(Git)

* Fix bad merge for patch paths

* Fix missing libconfig.h header install

* Fix issues with installation of headers

* More refactoring

* Refactor sleighexample into its own project/directory

* Refactor specfiles building into separate project/directory

* Check for termios.h header and set define if found

* Update READMEs

* Better consistency with install rules

* Build sleighLift as a standalone project with added source

* More changes to CMake subprojects

* Also add "Specs" component to sleigh installation config

* Try to be better at bootstrapping subprojects (hopefully this doesn't
  bite us, but if it does, I'm happy to remove it and say "not
  supported")

* Address some code review

* Add project sleigh_tool for tool subdirectory

Could make it easier to build just the tools

* Add help text to name the tool executable name

* Add license notice to CMake files

* Fix/Remove too specific CPack packaging configuration

* Consistent capitalization of Sleigh

Co-authored-by: Alex Cameron <asc@tetsuo.sh>
2022-08-22 15:41:53 +10:00
Eric Kilmer bb74c97f10 Integrate Ghidra update script into CI cron job (#25)
Runs once a week or manually

Requires a GitHub App to provide keys that will allow further GitHub
Actions to run on the newly create pull request.
2021-12-05 16:38:03 -05:00
Eric Kilmer 71ad7eca43 Script to update Ghidra HEAD changes (#22)
* Change ghidra commit head line for easier automation

* Python script to update CMake files with latest Ghidra commits
2021-12-03 15:14:32 -05:00