giellalt / lang-fkv

Finite state and Constraint Grammar based analysers and proofing tools, and language resources for the Kven Finnish language
https://giellalt.uit.no
GNU Lesser General Public License v3.0
2 stars 0 forks source link

vislcg3 fails on korp.cg3 #2

Closed snomos closed 9 months ago

snomos commented 3 years ago
"/usr/bin/cg-comp" korp.cg3 korp.bin
korp.cg3: Error: Cannot stat functions.cg3 due to error -1 - bailing out!
Makefile:851: recipe for target 'korp.bin' failed

This breaks the build.

snomos commented 3 years ago

Cf https://github.com/giellalt/lang-fkv/runs/1230124465

albbas commented 3 years ago

This works on my machine, at least with the minimal ./autogen.sh && ./configure && make

…
16 rules cannot be skipped by index.
  CP       korp.cg3
  CG3COMP  korp.bin
…
bbqsrc commented 3 years ago

That doesn't mean the bug is fixed, as it doesn't work in this environment as early as 8 hours ago.

snomos commented 3 years ago

Ok, found the bug. The issue is that korp.cg3 contains the following:

INCLUDE functions.cg3 ;

Now, as long as functions.cg3 is also copied from giella-shared, this works fine - the file functions.cg3 is found in the build directory, and gets included as it should.

But when functions.cg3 is found locally AND you build out of source (VPATH builds), THEN functions.cg3 is NOT found - only the compiled functions.bin. VPATH / out-of-source builds are what is used by most CI systems, including both Tino's and ours, thus you get fails.

The easiest solution is to change the include statement to the following:

INCLUDE functions.bin ;

But that would then require a rebuild every time korp.cg3 or functions.cg3 are changed. This does not go well with the cg3 developers, who are used to be able to run their grammars without make-ing things, as vislcg3 parses the source files on the fly.

I would still opt for this solution - these files are rarely changed, so the annoynce level should not be very high.

Comments, @Trondtr ?

Trondtr commented 3 years ago

There are two issues here:

  1. the double setup korp.cg3 vs. functions.cg3. For some languages there is a difference, for others there is not. The have your cake and eat it here is with the INCLUDE command, and having korp.cg3 as an otherwise empty file. This work for other languages today. The argument in favour of it is that the same pipeline may always be used for analysis to Korp, for all languages.
  2. Whether the language should use its own functions.cg3 or import functions.cg3 from giella-shared. The core Saami languages share their functions file, but as soon as different languages start getting serious work on functions and dependencies, they want more of their rules and above all less of the Saami rules. At the moment functions.cg3 is listed in the common .gitignore file, what we should do is remove it there and rather have a local .gitignore solution for the languages that ise giella-shared (or eventually make a smi-functions.cg3).
snomos commented 9 months ago

Fixed in https://github.com/giellalt/lang-fkv/commit/eb37e2dbba327f4286f33814196cd3da43e36718 by adding korp.cg3 to the source tree in git, instead of copying from shared-smi at build time.