tup icon indicating copy to clipboard operation
tup copied to clipboard

Changed error on unspecified output to warning

Open evur opened this issue 2 years ago • 2 comments

This changes "tup error: File '%s' was written to, but is not in .tup/db. You probably should specify it as an output" into a warning and adds a configuration option to disable it "display.unspecified_output_warnings".

Why?

  • Visual Studio and the mingw-w64 gcc compiler v10.3.0 (MSYS2) produce temporary files with unpredictable names. (see #182)
  • The rustc compiler produces output with unpredictable names (see #113)

Fixes #113 and fixes #182

evur avatar Jan 04 '22 16:01 evur

Thanks for taking a look at this. However, I think your approach would disable a very valuable safety check in tup that prevents subprocesses from writing to files that aren't intended to be written to. It would be too easy to miss the warning message in a long build log, and then potentially have issues with incremental updates with the unspecified file.

For issues like #182, you can tell a rule to ignore specific files with the ^ marker in the outputs section of a rule (which matches on a pattern). See the "outputs" section under the ":" rule in the TUPFILES section of the man page for more information. This can be used to ignore writes to cache directories, compiler licenses, etc. This is a more targeted and explicit approach to tell tup to ignore specific files, rather than ignoring a whole class of potential errors.

Does that make sense? What program are you using that you're having an issue with?

gittup avatar Jan 29 '22 19:01 gittup

I'm not the issuer, but like to ask. I would like to generate pngs out of a pdf file in the first step; later using this files in subsequent calls. The generated files will have a strict naming schema file{n}.png. As far as I understand, my use case is not realizable with tup, correct?

1.) pdf => some png files 2.) compile some file that uses all those png files

Beiri22 avatar Jul 30 '23 18:07 Beiri22