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
This build failed with ./lib1521.c:1:1: error: Missing copyright statement (COPYRIGHT) despite the mk-lib1521.pl script being designed to write a copyright statement at the beginning of the file.
I expected the following
There should be no such false error.
I suspect what's happening is that the mk-lib1521.pl and checksrc targets are running at the same time and in parallel, and since the former creates the lib1521.c file using shell redirection, an empty lib1521.c is created immediately, before the script even starts to run. Meanwhile, checksrc sees the .c file, doesn't find a copyright line inside and raises an error. If it checked a few milliseconds later, it would have been fine.
I'm not sure the best way to fix this. Some possibilities that came to mind:
Making checksrc wait until the test target is done would work, unless tests are not being built at all. That would also make the checksrc test happen at the end, after everything else is built.
Adding an explicit make dependency on lib1521.c would work, but it will spuriously break again the next time a new generated file is added and adding the new dependency is forgotten.
Giving checksrc an explicit ignore list would work, but has the same problem.
Changing mk-lib1521.pl to create the lib1521.c file internally would reduce the window where there is a problem, but not eliminate it.
Making checksrc ignore empty files would probably usually work, but it's possible on some platforms a buffer's worth of data could be flushed into the file before checksrc checks it, which makes the file non-empty but contains the start of the copyright header only and not the whole thing, which would still cause it to fail.
Creating lib1521.c in two stages, writing it first to a temporary file (not ending in .c) then renaming it to the final name after it's written. This makes the run jobs inconsistent (because checksrc will sometimes check lib1521.c and sometimes not) but with reproduceable results (because the checksrc check, if run, will always succeed).
Despite the slight imperfection of the latter solution, I see it as being the cleanest.
curl/libcurl version
curl 8.11.0-DEV
operating system
Ubuntu 22.04
The text was updated successfully, but these errors were encountered:
I think those files won't be skipped because the -W pathnames are relative but
the ones being processed (which are compared to the -W paths) are absolute. The
$wlist comparison in checksrc.pl probably needs to use basename($file) instead
of $file. But otherwise, this seems like a straightforward fix.
I did this
This build failed with
./lib1521.c:1:1: error: Missing copyright statement (COPYRIGHT)
despite the mk-lib1521.pl script being designed to write a copyright statement at the beginning of the file.I expected the following
There should be no such false error.
I suspect what's happening is that the mk-lib1521.pl and checksrc targets are running at the same time and in parallel, and since the former creates the lib1521.c file using shell redirection, an empty lib1521.c is created immediately, before the script even starts to run. Meanwhile, checksrc sees the .c file, doesn't find a copyright line inside and raises an error. If it checked a few milliseconds later, it would have been fine.
I'm not sure the best way to fix this. Some possibilities that came to mind:
Despite the slight imperfection of the latter solution, I see it as being the cleanest.
curl/libcurl version
curl 8.11.0-DEV
operating system
Ubuntu 22.04
The text was updated successfully, but these errors were encountered: