gittup/tup

Unflagging `transient` in `delete_name_file`

elegios opened this issue · 0 comments

I've been debugging a strange error including transient files for quite a while now, and while I can't seem to produce a minimal example that triggers the error (see the fold for a not-at-all-minimal example if desired) I think I've found how to fix it.

The issue appears to be that .tup/db can end up in a state where a particular node id exists in transient_list but not node. I suspect that a call to tup_db_unflag_variant should be added in delete_name_file in src/tup/delete_name_file.c. Testing this locally seems to work thus far, so I figured I'd report it here.

Large example that *seems* consistent
  1. Clone https://github.com/miking-lang/miking. The actual project needs a bunch of dependencies to build, but to trigger the error it should be enough to just have tup.
  2. Edit tup.config to the following:
    CONFIG_USE_INSTALLED_MI=y
    CONFIG_USE_BUILT_MI=n
    CONFIG_USE_CHEATED_MI=n
    
  3. Run tup build/mi-cheat. This should fail and build nothing (we removed the output with tup.config), but will cause tup to build the database.
  4. Update tup.config to the following:
    CONFIG_USE_INSTALLED_MI=n
    CONFIG_USE_BUILT_MI=n
    CONFIG_USE_CHEATED_MI=y
    
  5. Run tup build/mi-cheat. This should trigger the bug and print something like tup error: Unable to find node entry for tupid: 935 . Expected behavior is to start building the specified target.