You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
crux-mir only regenerates the MIR dump produced by mir-json when it thinks it's out of date. The list of sources it uses for this does not include the mir-json executable. One consequence of this is that after changing mir-json one needs to manually clean the test suite (and if one forgets it's easy to chase down a rathole trying to figure out why your changes aren't changing anything, etc.) but since the code involved is apparently not used only in the test suite it presumably has other consequences as well, possibly more embarrassing.
The mtime of an executable isn't a great proxy for whether it's changed, but under normal circumstances it's a conservative approximation, and since there are already mtime checks happening, checking the executable that generated the output is a good plan.
The reason this is not completely trivial is that we run crux-mir off $PATH so we don't have the a readily accessible path to the executable. Unless there's a function to search for things on $PATH in the Haskell stdlib somewhere (I can't find one, but that doesn't prove anything) this probably should be done by fetching $PATH from the environment, splitting it, and looking for the program in each entry dir in order. Which is not actually a big deal.
The code in question appears in crux-mir/src/Mir/Generate.hs; there are two places to apply a test (one in maybeCompileMirJson for mir-json, one in maybeLinkJson for mir-json-dce).
The text was updated successfully, but these errors were encountered:
ah hoogle failed to find me findExecutable, apparently because if you ask it for Foo -> Bar it will cheerfully return all sorts of probably-not-useful Foo -> a, but not Foo -> IO Bar. :-| oh well
crux-mir only regenerates the MIR dump produced by mir-json when it thinks it's out of date. The list of sources it uses for this does not include the mir-json executable. One consequence of this is that after changing mir-json one needs to manually clean the test suite (and if one forgets it's easy to chase down a rathole trying to figure out why your changes aren't changing anything, etc.) but since the code involved is apparently not used only in the test suite it presumably has other consequences as well, possibly more embarrassing.
The mtime of an executable isn't a great proxy for whether it's changed, but under normal circumstances it's a conservative approximation, and since there are already mtime checks happening, checking the executable that generated the output is a good plan.
The reason this is not completely trivial is that we run crux-mir off $PATH so we don't have the a readily accessible path to the executable. Unless there's a function to search for things on $PATH in the Haskell stdlib somewhere (I can't find one, but that doesn't prove anything) this probably should be done by fetching $PATH from the environment, splitting it, and looking for the program in each entry dir in order. Which is not actually a big deal.
The code in question appears in crux-mir/src/Mir/Generate.hs; there are two places to apply a test (one in
maybeCompileMirJson
for mir-json, one inmaybeLinkJson
for mir-json-dce).The text was updated successfully, but these errors were encountered: