giellalt / giella-core

Build tools and build support files as well as developer support tools for the GiellaLT repositories.
https://giellalt.uit.no
GNU General Public License v3.0
7 stars 2 forks source link

`make clean` does not remove all generated files #49

Closed snomos closed 2 months ago

snomos commented 2 months ago

Steps to reproduce:

cd lang-sma
make -j
make clean
find . -name '*.hfst'

Result: a long list of .hfst files

Expected result: no files found

I assume this is caused by outdated clean targets after the dir reorgs.

What makes this issue a blocker is that for people working with MT/Apertium, lang-sma requires weighted generators. For speed reasons weighted FST's are not default, Foma format FST's are. When reconfiguring for MT using e.g. this configuration:

./configure --enable-apertium --with-backend-format=openfst-tropical
make clean

the unremoved FST files are typically in the Foma backend format (the default), and when building anew after reconfiguration, the different FST format causes compilation errors:

libc++abi: libc++abi: libc++abi: terminating due to uncaught exception of type TransducerTypeMismatchExceptionterminating due to uncaught exception of type TransducerTypeMismatchExceptionterminating due to uncaught exception of type TransducerTypeMismatchException

Cf https://github.com/giellalt/lang-sma/issues/23

TinoDidriksen commented 2 months ago

Not trivial to remove all the old files - what's an old file and what's something the user made themselves?

I generally advise people to check git status to see if there are any files they want to keep, move those out of the folder, then git clean -f -d -x

flammie commented 2 months ago

yeah the old versions of shared automake snippets had many -rm -rf *.hfst *.txt in the clean-local targets, that caused all kinds of problems debugging and otherwise, now the temporary built files should all be in .generated/ which gets cleaned in clean targets, the missing piece is if for some reason there are temporary targets not in .generated/ that are also not final targets, i.e. installed files, they need to be declared in CLEANFILES from now on, I have fixed the ones that are visible on default ./configure