RFR: 1236: Add jcheck option to check for large binary files [v3]

Erik Joelsson erikj at openjdk.java.net
Fri Dec 3 14:47:10 UTC 2021


On Fri, 3 Dec 2021 13:17:28 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> > let this apply to any binary file,
> 
> Fixed.
> 
> I have a small problem. Can the following code get the file size actually? The `path` seems a local relative path.
> 
> ```
> try {
>     fileSize = Files.size(path);
> } catch (IOException e) {
>     log.warning("The file '" + path + "' doesn't exist.");
> }
> ```

The path you get from a patch should be local to the repository. Assuming the file is in the workspace, it should be resolvable against the repository root, but I don't think a jcheck check can make such an assumption. AFAIK it's expected to just interact with the commit data. It's never updating the workspace to each inspected commit to perform the checks. I think you need to figure out the size by inspecting the binary patch. I'm not sure exactly how, but it looks like all the binary data is encoded in the patch hunks.

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

PR: https://git.openjdk.java.net/skara/pull/1247


More information about the skara-dev mailing list