UniFormal / MMT

The MMT Language and System
https://uniformal.github.io/
Other
68 stars 23 forks source link

spurious cyclic dependencies reported in mmt make alltex #514

Closed kohlhase closed 4 years ago

kohlhase commented 4 years ago

When we run mmt make alltex in MathHub/MiKoProblems/AI/source/prolog/en then I get

error: cyclic deps: Map(
FileBuildDependency(sms,archive
    /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/entailment.tex) ->
        Set(FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/entailment.tex),
            FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/semantics-base.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,pl0/en/pl0-semantics.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/logical-system.tex)),
    FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/logical-system.tex) ->
    Set(FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/logical-system.tex),
            FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/entailment.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/semantics-base.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,pl0/en/pl0-semantics.tex)),
    FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/semantics-base.tex) ->
    Set(FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/semantics-base.tex),
            FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,pl0/en/pl0-semantics.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/logical-system.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/entailment.tex)),
    FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,pl0/en/pl0-semantics.tex) ->
    Set(FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,pl0/en/pl0-semantics.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/logical-system.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/entailment.tex),
        FileBuildDependency(sms,archive /Users/kohlhase/localmh/MathHub/MiKoMH/GenCS,logic/en/semantics-base.tex))
    )

even though there does not seem to be a cyclic dependency that involves these files. But I have to say I find it difficult to read what this error message wants to tell me. This happens in other places as well but the cycles are much bigger.

Apparently though this error message does not affenct what mmt make alltex is supposed to do: just generate a file all.tex (and all.<lang>.tex for SMGloM) that simply inputs the relevant pre.tex, all the *.tex files in the directory, and then post.tex (pre/post.tex are in ../../lib/ and ../../../meta-inf/lib).

kohlhase commented 4 years ago

I am not sure why mmt make alltex checks dependencies at all, it really shounldn't.

Jazzpirate commented 4 years ago

It seems that alltex depends on sms as a build target, and the latter checks dependencies.

Calling mmt make sms on MiKoMH/GenCS/logic/en does not lead to a cycle for me though (even though the above error message seems to clearly occur in the sms generation). Can you try doing mmt make sms MiKoMH/GenCS/logic/en/logical-system.tex directly? I could imagine that possibly your sms for that file is outdated and contains a spurious dependency to entailment...?

kohlhase commented 4 years ago

It seems that alltex depends on sms as a build target, and the latter checks dependencies.

I do not think that it should. alltex is a pure convenience target that should be purely syntactic.

kohlhase commented 4 years ago

Can you try doing mmt make sms MiKoMH/GenCS/logic/en/logical-system.tex directly?

I tried that, and no error.

I could imagine that possibly your sms for that file is outdated and contains a spurious dependency to entailment...?

No, I checked manually.

kohlhase commented 4 years ago

Wow, I just re-checked mmt make alltex in prolog/en, and the problem went away. I have no idea why. And I promise I did not change the inclusions.

kohlhase commented 4 years ago

But I still maintain that alltex should not depend on sms.

lambdaTotoro commented 4 years ago

Okay, these spurious dependency cycles should be gone now. Here's the visualisation of (the remaining cyclic part of) the dependency tree from MiKoCourses/IWGS/souse/SS20.

dependency graph

What fixed the issue was to focus only on the tex dependencies and forget about sms dependencies. As you can see above, only the sms parts have cycles.

Another problem was that it wasn't the cyclic part that was being reported, but some sort of closure of that, which lead to the impression like in the OP that there were things depending in themselves. That wasn't actually the case, but confusing.

I'll close this for now. Please reopen/let me know if this crops up again.