Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$TEXINPUTS provided from outside are dropped #120

Closed
Natureshadow opened this issue Jan 16, 2018 · 3 comments
Closed

$TEXINPUTS provided from outside are dropped #120

Natureshadow opened this issue Jan 16, 2018 · 3 comments
Milestone

Comments

@Natureshadow
Copy link

When specifying TEXINPUTS in the environment when calling sdaps (as done in the new Debian package to run the test suite without the package being installed, and after applying a patch that stops copying the classes to the project directory - see #27), they are dropped once something starts specifying its own TEXINPUTS inside the code.

It should instead be merged (PR follows).

Natureshadow added a commit to Natureshadow/sdaps that referenced this issue Jan 16, 2018
@benzea benzea added this to the 2.0 milestone Jan 16, 2018
benzea added a commit that referenced this issue Apr 2, 2018
Note that '' and '.' is filterd out and all found paths are inserted
after the paths required by SDAPS and before the default path.

Fixes issue #120.
@benzea
Copy link
Member

benzea commented Apr 2, 2018

I pushed a similar solution filtering possible duplicate entries for local directory and default search paths.

@benzea benzea closed this as completed Apr 2, 2018
@davidmehren
Copy link

This commit broke the tests (and actually creating any new projects) for me.
In

def compile(texfile, cwd, inputs=None):

input gets set to None and is then passed to run_engine which tries to execute extend() on it:
inputs.extend(p for p in os.environ.get('TEXINPUTS', '').split(':') if p not in ['.', ''])

This fails and therefore breaks any LaTeX compilation with a error like

Error: An error occured in the setup routine. The survey directory still exists. You can for example check the questionnaire.log file for LaTeX compile errors.
Traceback (most recent call last):
  File "/home/david/Projekte/aur/sdaps-git/src/sdaps/sdaps/__init__.py", line 65, in main
    return cmdline['_func'](cmdline)
  File "/home/david/Projekte/aur/sdaps-git/src/sdaps/sdaps/cmdline/setup.py", line 45, in setup
    return setuptex.setup(cmdline['project'], cmdline['questionnaire.tex'], cmdline['additional_questions'], cmdline['add'])
  File "/home/david/Projekte/aur/sdaps-git/src/sdaps/sdaps/setuptex/__init__.py", line 104, in setup
    latex.compile('questionnaire.tex', cwd=survey.path())
  File "/home/david/Projekte/aur/sdaps-git/src/sdaps/sdaps/utils/latex.py", line 180, in compile
    run_engine(texfile, cwd, inputs)
  File "/home/david/Projekte/aur/sdaps-git/src/sdaps/sdaps/utils/latex.py", line 176, in run_engine
    preexec_fn=_preexec_fn)
  File "/usr/lib/python3.6/subprocess.py", line 267, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1345, in _execute_child
    raise child_exception_type(err_msg)
subprocess.SubprocessError: Exception occurred in preexec_fn.

Just setting the default value of inputs to [] instead of None in compile should fix that, I think.

@benzea
Copy link
Member

benzea commented Apr 5, 2018

Oh, of course, I missed that follow up change and didn't run the tests!

I pushed the fix, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants