RTEMS | waf: Track cpuopts.h as compilation dependency (!1093)

SHIVAM DEOLANKAR (@D3athSkulll) gitlab at rtems.org
Mon Apr 13 17:56:56 UTC 2026




SHIVAM DEOLANKAR commented on a discussion on wscript: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1093#note_148493

 >      def cc(self, bld, bic, source, target=None, deps=[], cppflags=[]):
 >          if target is None:
 >              target = os.path.splitext(source)[0] + ".o"
 > +
 > +        cpuopts = bld.bldnode.make_node("cpukit/include/rtems/score/cpuopts.h")

I have used Chatgpt for this analysis, after I tried the above solutions.

I suspected the issue might be related to how Waf handles dependency invalidation, so I analyzed `.waf3-2.1.4-72787ce48f227ac42c4b0da24e780694/waflib/Task.py` and `.waf3-2.1.4-72787ce48f227ac42c4b0da24e780694/waflib/Node.py`.

Task.py correctly includes cpuopts.h via implicit dependencies. However, Node.py caches file hashes in `ctx.cache_sig` using `get_bld_sig()`. When RTEMS_SMP changes, cpuopts.h is regenerated, but its cached hash is reused, so task signatures don’t change. As a result, Waf skips rebuilding and reuses stale objects. This suggests a cache invalidation issue rather than missing dependency tracking.

>From my understanding this change is related to waf internals, whats our best course of action here then?

@sebhub

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1093#note_148493
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260413/8f6ae0b7/attachment-0001.htm>


More information about the bugs mailing list