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

Write a script to check for new files #121

Open
tetsuo-cpp opened this issue Aug 8, 2022 · 3 comments
Open

Write a script to check for new files #121

tetsuo-cpp opened this issue Aug 8, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@tetsuo-cpp
Copy link
Contributor

When new files are added to Sleigh, sometimes our weekly sync with Ghidra continues working fine and we don't notice. This leads us to having missing headers which we have to fix later down the track (#107).

We should write a script as part of our weekly sync that identifies new files and either adds them to the PR or fails loudly so we can manually fix it.

@tetsuo-cpp tetsuo-cpp added the enhancement New feature or request label Aug 8, 2022
@ekilmer
Copy link
Contributor

ekilmer commented Dec 15, 2022

Partial improvement made in this commit b80fefc

Hopefully, it lists the changed (including new and removed) files in the PR and commit message.

@tetsuo-cpp
Copy link
Contributor Author

@ekilmer

Had a think about this today. I don't think it's realistic for us to automatically update the CMake configuration since there's no way for us to know what sub-library (libsla, libdecomp, etc) the file belongs to. However, I'd like it to be a bit more obvious than it is now since the additions in the git diff output can easily get lost in a sea of modifications.

I want to use a regex to parse the git diff output to figure out what files are added and if there are new sources, have the PR bot leave a comment saying something like: "Manual intervention required. This update contains the following new C++ sources."

Does that seem ok to you?

@ekilmer
Copy link
Contributor

ekilmer commented May 31, 2023

@tetsuo-cpp

Had a think about this today. I don't think it's realistic for us to automatically update the CMake configuration since there's no way for us to know what sub-library (libsla, libdecomp, etc) the file belongs to. However, I'd like it to be a bit more obvious than it is now since the additions in the git diff output can easily get lost in a sea of modifications.

Very good point, and I agree with both statements

I want to use a regex to parse the git diff output to figure out what files are added and if there are new sources, have the PR bot leave a comment saying something like: "Manual intervention required. This update contains the following new C++ sources."

Does that seem ok to you?

A regex would work but there's also a native way to filter for added, modified, and deleted files that I just learned about recently: diff-filter

git diff --diff-filter=M

and we could probably run it 3 times for each of M (modified), A (added), and D (deleted), where A and D would likely require manual intervention.

Moreover, I think there are some additional improvements to be made for the sleighspec directory: We should do one (or combination) of the following (or some other equivalent)

  1. Ignore java, manifest, etc. files
  2. iterate all of the extensions for sleigh specifications
  3. Be more precise about directories we look for changes in (i.e. Ghidra/Processors/*/data/languages, but there might be other paths we want too)

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

No branches or pull requests

2 participants