Repository: spack/spack

Issue:
Installation issue:  texlive
<!-- Thanks for taking the time to report this build failure. To proceed with the report please:

1. Title the issue "Installation issue: texlive".
2. Provide the information required below.

We encourage you to try, as much as possible, to reduce your problem to the minimal example that still reproduces the issue. That would help us a lot in fixing it quickly and effectively! -->

### Steps to reproduce the issue

<!-- Fill in the exact spec you are trying to build and the relevant part of the error message -->
```console
$ spack install texlive%gcc@9.2.0 arch=linux-rhel7-x86_64
==> Installing texlive                                                                                                                   [49/11295]
==> No binary for texlive found: installing from source
==> Moving resource stage
        source : /tmp/root/spack-stage/resource-texmf-n2vzzq4l7fzyycwcos3o3bxeuosu4scn/spack-src/
        destination : /tmp/root/spack-stage/spack-stage-texlive-20190410-n2vzzq4l7fzyycwcos3o3bxeuosu4scn/spack-src/texlive-20190410-texmf
==> texlive: Executing phase: 'autoreconf'
==> texlive: Executing phase: 'configure'
==> texlive: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j4'
     7448    In file included from /tmp/root/spack-stage/spack-stage-texlive-20
             190410-n2vzzq4l7fzyycwcos3o3bxeuosu4scn/spack-src/texk/web2c/xetex
             dir/XeTeX_ext.c:41:
  >> 7449    /soft/spack/opt/spack/linux-rhel7-x86_64/gcc-9.2.0/poppler-0.87.0-
             7zm6vr3c2w5zpmnv3evdn23lpygmolii/include/poppler/poppler-config.h:
             142:10: fatal error: cstdio: No such file or directory
     7450      142 | #include <cstdio> // __MINGW_PRINTF_FORMAT is defined in t
             he mingw stdio.h
     7451          |          ^~~~~~~~
     7452    compilation terminated.
  >> 7453    make[5]: *** [xetexdir/libxetex_a-XeTeX_ext.o] Error 1

```

### Information on your system

<!-- Please include the output of `spack debug report` -->
```console
$ spack debug report
* **Spack:** 0.15.4
* **Python:** 2.7.5
* **Platform:** linux-rhel7-broadwell
```
gcc@9.2.0 was also built via spack. It looks like the include directory of the gcc installation is not being passed down to the texlive build stage.

### Additional information

<!-- Please upload the following files. They should be present in the stage directory of the failing build. Also upload any config.log or similar file if one exists. -->
* [spack-build-out.txt](https://github.com/spack/spack/files/5548982/spack-build-out.txt)
* [spack-build-env.txt](https://github.com/spack/spack/files/5548983/spack-build-env.txt)



<!-- Some packages have maintainers who have volunteered to debug build failures. Run `spack maintainers <name-of-the-package>` and @mention them here if they exist. -->

### General information

<!-- These boxes can be checked by replacing [ ] with [x] or by clicking them after submitting the issue. -->
- [x] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [x] I have run `spack maintainers <name-of-the-package>` and @mentioned any maintainers
- [x] I have uploaded the build log and environment files
- [x] I have searched the issues of this repo and believe this is not a duplicate



Discussion:
@rubendibattista also reported texlive build issues in #19885, maybe there is some overlap.
I ran across this error as well.  
See also https://github.com/NixOS/nixpkgs/issues/79170
It looks like poppler upgraded header files to use the C++ cstdio instead to stdio.h, which TeX does not like because is using C not C++.

Based on NixOS report, happened in poppler@0.84





Resolving patch:
diff --git a/var/spack/repos/builtin/packages/texlive/package.py b/var/spack/repos/builtin/packages/texlive/package.py
--- a/var/spack/repos/builtin/packages/texlive/package.py
+++ b/var/spack/repos/builtin/packages/texlive/package.py
@@ -113,7 +113,7 @@ class Texlive(AutotoolsPackage):
     depends_on('mpfr', when='@2019:')
     depends_on('perl', when='@2019:')
     depends_on('pixman', when='@2019:')
-    depends_on('poppler', when='@2019:')
+    depends_on('poppler@:0.84', when='@2019:')
     depends_on('teckit', when='@2019:')
     depends_on('zlib', when='@2019:')
     depends_on('zziplib', when='@2019:')


Test patch: