Skip to content

Commit

Permalink
checksrc: exclude generated bundle files to avoid race condition
Browse files Browse the repository at this point in the history
Necessary to catch rare cases when `checksrc` hits these files when they
are not populated yet:
```
./curltool_unity.c:1:1: error: Missing copyright statement (COPYRIGHT)
 ^
```
https://github.com/curl/curl/actions/runs/12995546740/job/36242556713?pr=16094#step:37:123

Follow-up to 71cf0d1 curl#14772
Closes curl#16102
  • Loading branch information
vszakats committed Jan 27, 2025
1 parent 23b4122 commit 81e271f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,10 @@ CS_1 =
CS_ = $(CS_0)

checksrc:
$(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
-W$(srcdir)/curl_config.h $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] \
$(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch])
$(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
-W$(srcdir)/libcurl_unity.c -W$(srcdir)/curl_config.h $(srcdir)/*.[ch] \
$(srcdir)/vauth/*.[ch] $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] \
$(srcdir)/vssh/*.[ch])

if DEBUGBUILD
# for debug builds, we scan the sources on all regular make invokes
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ checksrc:
$(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
-W$(srcdir)/$(HUGE) \
-W$(srcdir)/$(CA_EMBED_CSOURCE) \
-W$(srcdir)/curltool_unity.c \
-W$(srcdir)/libcurltool_unity.c \
$(srcdir)/*.[ch])

if DEBUGBUILD
Expand Down
5 changes: 4 additions & 1 deletion tests/libtest/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,11 @@ CS_0 = @echo " RUN " $@;
CS_1 =
CS_ = $(CS_0)

# ignore generated C files since they play by slightly different rules!
checksrc:
$(CHECKSRC)@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) $(srcdir)/*.[ch]
$(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
-W$(srcdir)/libtest_bundle.c \
$(srcdir)/*.[ch])

if DEBUGBUILD
# for debug builds, we scan the sources on all regular make invokes
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,8 @@ CS_0 = @echo " RUN " $@;
CS_1 =
CS_ = $(CS_0)

# ignore generated C files since they play by slightly different rules!
checksrc:
$(CHECKSRC)@PERL@ $(top_srcdir)/scripts/checksrc.pl $(srcdir)/*.[ch]
$(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
-W$(srcdir)/unit_bundle.c \
$(srcdir)/*.[ch])

0 comments on commit 81e271f

Please sign in to comment.