OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version All
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by johnbeckettn2e - 24.09.2020

FS#3360 - make with source files in package does not always rebuild

Whilst working on a custom build it has been observed that if I have an openwrt package that includes a build/Prepare step which copies sourcecode from the packagedir to the build dir this does not always happen if the sourcecode has been modified.

I’ve tracked it down to the find_mds step which uses the find command to make a list of all the files in the package directory.

This list is passed to the mkhash utility on stdin, which produces the hash part of the .prepared file.

If the contents of the list change then the build/Prepare step is re-ran, which copies the source code from package dir to build dir.

However if the contents of the list have not changed then the build/Prepare step is not run leaving the old stale files in the build dir.

There are a few issues with the list method

The order of files is undefined, the list can change order resulting in a different hash causing false rebuild
If a file is modified it may not go to the end of the list, resulting in same list with same hash so no build when required.

By adding modified time after the filename, then sorting the list both the above two issues can be resolved.

I’ve made a potential fix here :

I’ve tested my fix locally and I can see rebuilds only when I modify source.

Supply the following if possible:
- Device problem occurs on
- Software versions of OpenWrt/LEDE release, packages, etc.
- Steps to reproduce



Available keyboard shortcuts


Task Details

Task Editing