Skip to content

Update README for dune-built CodeHawk #221

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

brk
Copy link
Contributor

@brk brk commented May 2, 2025

No description provided.

@brk brk force-pushed the standardize-on-dune branch 2 times, most recently from 0063960 to 42898b4 Compare May 3, 2025 11:57
elif self.platform == "macOS":
self.macOSdir = os.path.join(self.binariesdir, "macOS")
self.chx86_analyze = os.path.join(self.macOSdir, "chx86_analyze")
if self.codehawkdir is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

i have to concerns with this:

  • it looks like it will break existing users (me for sure, but external people could be affected too?) plus the containers we generate
  • i'm generally against code guessing things? it tends to be fragile and require gnarly code.

if your goal is to make it more straightforward then i would advocate for:

  • keep existing set up as default to avoid breaking people (it's probably okay to stop advertising it as a supported configuration though if you dislike it and henny agrees with you :-).
  • if binaries are not in the old default place, and there's no local config, assume it will be in the $PATH? I'll admit that this step is not great as there's no trivial way to check if the binaries are there, but it is a standard process for installing software (at least in linux 🤷 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm confused -- I thought, from the meeting earlier this week, that this implementation would match the way that you and Henny use CH/CHB/CHC. I must have misunderstood!

I'd be fine using a $PATH based approach. The main question there would be whether we check for the old binary names or the new ones. From my limited understanding of Dune the (only?) way to get the binaries built under the old names (public_name in Dune terminology) is to use the exes.install target for dune build, which is less flexible than the non-installation approach discussed here, because exes.install installs all the executables, whereas dune build CHB allows for more focused rebuilding, avoiding building things you know you won't use even if Dune considers them to be out of date.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused -- I thought, from the meeting earlier this week, that this implementation would match the way that you and Henny use CH/CHB/CHC. I must have misunderstood!

Sorry! Henny uses ConfigLocal.py, I copy the binaries out of the ocaml build folder into where the python frontends expect them to be #hard-customers

I'd be fine using a $PATH based approach. The main question there would be whether we check for the old binary names or the new ones

ugh, i forgot about this. I have the monday brain and thus no useful solution to propose. Let's talk about it with Henny tomorrow?

README.md Outdated
(or ConfigLocal.py) in `chb/util/` to its location. You can check the configuration
with

If this repository is placed within, or next to, the `codehawk` checkout,
Copy link
Contributor

Choose a reason for hiding this comment

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

is it really okay/wise to do a git checkout of a repo inside of another repo? #asking-for-a-friend :-P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are several downsides to doing it, yeah. But, again, I thought it was what you and Henny are doing!

Copy link
Contributor

Choose a reason for hiding this comment

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

Haha, i don't think either one of us is doing that :-P

self.chx86_analyze = os.path.join(self.codehawkdir, "CodeHawk",
"_build", "default", "CHB", "bchcmdline", "bCHXBinaryAnalyzer.exe")
else:
self.cparser = "<no codehawkdir!>"
Copy link
Contributor

Choose a reason for hiding this comment

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

is this what chkx info will print?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

$ chkx info
Analyzer configuration:
-----------------------
  analyzer : /home/ben/codehawk/CodeHawk/_build/default/CHB/bchcmdline/bCHXBinaryAnalyzer.exe (found)
  summaries: /home/ben/CodeHawk-Binary/chb/summaries/bchsummaries.jar (found)
$ mv ../codehawk ../invisiblecodehawk
$ chkx info
Analyzer configuration:
-----------------------
  analyzer : <no codehawkdir!> (not found)
  summaries: /home/ben/CodeHawk-Binary/chb/summaries/bchsummaries.jar (found)

if self.codehawkdir is not None:
# Look for non-installed binaries by default
self.cparser = os.path.join(self.codehawkdir, "CodeHawk",
"_build", "default", "CHC", "cchcil", "cCHXParseFile.exe")
Copy link
Contributor

Choose a reason for hiding this comment

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

I did not know the binary analyzer uses the c parser command. I've never copied it over!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like it's a recent addition

if viable_alts:
self.codehawkdir = viable_alts[0]

## analyzer executables
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: no need for double ##?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, good catch!

@brk brk marked this pull request as draft May 4, 2025 16:50
@brk brk force-pushed the standardize-on-dune branch from 42898b4 to 24412c4 Compare May 8, 2025 09:38
@brk brk changed the title Update README and Config.py for dune-built CodeHawk Update README for dune-built CodeHawk May 8, 2025
@brk brk marked this pull request as ready for review May 8, 2025 09:39
Copy link
Contributor

@sipma sipma left a comment

Choose a reason for hiding this comment

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

Thank you.

@sipma sipma merged commit 7954122 into static-analysis-engineering:master Jun 2, 2025
1 check passed
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