scons icon indicating copy to clipboard operation
scons copied to clipboard

[WIP] Bugfix/managan/latex scanner

Open managan opened this issue 4 years ago • 11 comments

This pull request aims to fix a case where the LatexScanner fails.

The example test is when the source includes \input{filename} and the file filename is not present. This file does not show up in --tree=all output and then we get an error from pdflatex when it can not find the file.

The scanner needs to be updated to report the file is in the source tree even when it is not present.

The source change avoids an exception being thrown when the builder tries to determine if the deck is a tex file or a latex file.

Contributor Checklist:

  • [ ] I have created a new test or updated the unit tests to cover the new/changed functionality.
  • [ ] I have updated CHANGES.txt (and read the README.rst)
  • [ ] I have updated the appropriate documentation

managan avatar Jan 04 '21 23:01 managan

This is tied to Fixes #2972

managan avatar Jan 04 '21 23:01 managan

@managan - Is this ready to go? Or still have some items outstanding?

bdbaddog avatar Mar 08 '21 23:03 bdbaddog

@managan - just a ping to see if you're still working on this?

bdbaddog avatar Jul 12 '21 20:07 bdbaddog

Hi, Still trying to free up some time for this. We are now in GA but still doing things on the new house!

managan avatar Jul 12 '21 20:07 managan

Hi, Still trying to free up some time for this. We are now in GA but still doing things on the new house!

No worries. Just wanted to touch base.

Enjoy the house process. ;)

bdbaddog avatar Jul 12 '21 20:07 bdbaddog

@managan - just a ping to see if you have time to complete this PR.

bdbaddog avatar Sep 11 '23 17:09 bdbaddog

I am retiring at the end of November. I am putting this on my list of things to look at in December!

managan avatar Sep 11 '23 18:09 managan

I am retiring at the end of November. I am putting this on my list of things to look at in December!

Congratulations! And thank you! :)

bdbaddog avatar Sep 11 '23 21:09 bdbaddog

Turning 68 in a few weeks so it is time!!

---------------------- Rob Managan WCI/DP Division LLNL P.O. Box 808, L-170 Livermore, CA 94551-0808 Email: @.*** Phone: 925-423-0903 FAX: 925-422-3389 Mobile: 925-341-9939

From: William Deegan @.> Reply-To: SCons/scons @.> Date: Monday, September 11, 2023 at 5:33 PM To: SCons/scons @.> Cc: Rob Managan @.>, Mention @.***> Subject: Re: [SCons/scons] [WIP] Bugfix/managan/latex scanner (#3854)

I am retiring at the end of November. I am putting this on my list of things to look at in December!

Congratulations! And thank you! :)

— Reply to this email directly, view it on GitHubhttps://urldefense.us/v3/__https:/github.com/SCons/scons/pull/3854*issuecomment-1714615210__;Iw!!G2kpM7uM-TzIFchu!wGIeoHASPiUqDa7DMfLHyJlzecfwsv9IfpQVc7tn4iyPN_EbL4oeIApLEPGKy4kh5dZ_qzDOvkjLLfg_to8r2q4RcA$, or unsubscribehttps://urldefense.us/v3/__https:/github.com/notifications/unsubscribe-auth/AAATRLWFVIOPPUBBGYB5ZEDXZ57THANCNFSM4VTYU2WA__;!!G2kpM7uM-TzIFchu!wGIeoHASPiUqDa7DMfLHyJlzecfwsv9IfpQVc7tn4iyPN_EbL4oeIApLEPGKy4kh5dZ_qzDOvkjLLfg_to84QvrO_A$. You are receiving this because you were mentioned.Message ID: @.***>

managan avatar Sep 11 '23 21:09 managan

Came across this again closing down old browser tabs ;-) This in concept is similar to some Fortran stuff I've been wrestling with. A lot of scanners work on the assumption that "if a scanned dependency is not found, don't add it to the dep list, and just move on, as if these were no problem" - you see the same pattern over and over, probably copied:

            node = node.rfile()
            if not node.exists():
                return []

As far as I've been able to deduce, the root of this assumption is that you don't want to generate dependencies for system headers - if /usr/include/stdio.h is missing, we don't have a way to regenerate it, so there's no point in adding it as a dep, the build will fail anyway when the header isn't found by the compiler, and the user has to install something through their package manager to resolve it. But we don't have any special way of determining that something is a system-provided file as opposed to a project-provided one. Thus - we just ignore the case of not finding a file that looks like it's required. This sort of works for C projects, actually.

The problem is, if the file could be generated, then we absolutely want a dependency on it, so SCons can force it to be built - normally before the thing that includes it, or we get build-ordering problems that manifest as missing files - there are a number of these in the issue tracker (Fortran, Java, SWIG, D off the top of my head).

Don't have a general answer for this class of problems, because we don't have enough information to make an accurate decision. In the Fortran case, it manifests with module files, so I'm trying to treat a module dependency separately and not apply the template above. That's not necessarily pretty... Can we do something similar with latex? Is this in fact a case of the same problem?

mwichmann avatar Mar 15 '24 00:03 mwichmann