cspogil
cspogil copied to clipboard
build.py Not Working on Windows
build.py won't run on windows. It's possibly a problem with MikTex compatibility or it is a problem with the backslashes on line 26-27.
I ran into this, too. (Although I can compile, say, CS1/Act01 just fine by doing a 'cd' into that directory, then running pdflatex Act01-Introduction.tex
)
Would it be possible to pre-compile the .PDF files, and leave those somewhere?
I would rather fix this issue than include PDFs in the repository, because they change every time you compile (due to time stamps embedded in the PDF) regardless whether the source has changed. It's just that I don't have a Windows machine handy to figure out the syntax, and it's pretty low on my to-do list.
I'm on Mac so can't directly test and debug this. Can someone give the contents of _TEMP_1.run and _TEMP_2.run after the failure? They'll be in the directory of the activity being built. (E.g., CS0\Act01_TEMP_1.run).
FYI, I suspect the single quotes. The commands being generated on 26-27 look like this:
pdflatex -interaction=nonstopmode '\def\Student{}\input{TEMP.tex}' > _TEMP_1.run
Those backslashes are latex commands. The goal is to get them passed into pdflatex. I wonder if the single quotes are the right way to prevent DOS from processing its contents and pass it through raw?
You might try changing these to single quotes. So in build.py
cmd = LATEX + " \"\\def\\" + suff + "{}\\input{_TEMP_.tex}\""
With that insight, I'm tempted to spin up a Windows VM and finally knock out this issue. :)
I just re-ran the build.py, and here are my _TEMP_1/2.run files (I tacked '.txt' onto the name because GitHub didn't like the .run files)
_TEMP_1.run.txt _TEMP_2.run.txt
THANK YOU for looking at this!! :)
@MikeTheGreat Thanks for posting those files.
They appear to confirm my suspicion. In particular, this line:
! I can't find file `''.
I think this is saying that LaTeX cannot find a file by the name of ' (single quote). I think my previous suggestion would work under Windows.
Further, I don't think any of the characters in the LaTeX command are special to CMD.exe (c.f., this article). So we probably don't need to quote or escape them at all. So this might work.
cmd = LATEX + " \\def\\" + suff + "{}\\input{_TEMP_.tex}"
@MikeTheGreat Care to try to make the change and let us know if it works or not and what output you get if it fails?
If either of the above solutions work, then build.py will need to check which OS it's running on (c.f. this article) and build the right string.
That's much better! It now appears to be running (at least until it hits another error)
The next error is from pdflatex. The output on the console is:
CS0\Act04\interactions.tex
Teacher...OK
Student...
Sorry, but pdflatex did not succeed.
The log file hopefully contains the information to get MiKTeX going again:
C:/Users/mike/AppData/Local/MiKTeX/2.9/miktex/log/pdflatex.log
You may want to visit the MiKTeX project page, if you need help.
ERROR
Looking at the log file I see (at the very end):
2018-02-15 14:41:14,605-0800 FATAL pdflatex - Invalid argument: path="_TEMP_.out"
2018-02-15 14:41:14,621-0800 FATAL pdflatex - Info: path="_TEMP_.out"
2018-02-15 14:41:14,621-0800 FATAL pdflatex - Source: Libraries\MiKTeX\Core\File\win\winFile.cpp
2018-02-15 14:41:14,621-0800 FATAL pdflatex - Line: 488
I'd like to dig into this. I also got a phone call and a meeting soon, so we'll see how far I get :)
Huh. So I tweaked build.py so that it wouldn't remove the TEMP.out files (so I could compare the TEMP.out file of working directories to the CS0\Act04 directory) and then I re-ran it and now everything works fine.
Months ago I built a couple of these things activity-by-activity, and it looks like the temporary files that I didn't delete were causing problems.
@MikeTheGreat I'm glad that worked for you 👍. But I'm not sure why it worked for you 😕 .
So, I suggest closing this issue for now. If you can't, then maybe poke @ChrisMayfield (OK, I just did).
Nuts - how do I close this? @ChrisMayfield - can I do this on my own or should I bug you? :)
It's on my TODO list for this summer. I just need (hopefully only) an hour to mess around with a Windows VM.
On Tue, May 8, 2018 at 9:40 PM, MikeTheGreat [email protected] wrote:
Nuts - how do I close this? @ChrisMayfield https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ChrisMayfield&d=DwMFaQ&c=eLbWYnpnzycBCgmb7vCI4uqNEB9RSjOdn_5nBEmmeq0&r=MKJGe2g09glI2YyAL1RhKQ&m=rMGULjscPrQZ0NH4Z4r5Ahd1QOwAHhJitW3yKvsd-jk&s=oEchP0cXMzdw5sMsoj65g5ISWNoeGKTIcrqLh6_8E3g&e=
- can I do this on my own or should I bug you? :)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ChrisMayfield_cspogil_issues_7-23issuecomment-2D387593516&d=DwMFaQ&c=eLbWYnpnzycBCgmb7vCI4uqNEB9RSjOdn_5nBEmmeq0&r=MKJGe2g09glI2YyAL1RhKQ&m=rMGULjscPrQZ0NH4Z4r5Ahd1QOwAHhJitW3yKvsd-jk&s=impO15BW1dIavIoqOnRiXDETtCbfFyCgf3OKDTFkVEA&e=, or mute the thread https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AMbnS57WjvbUH01mMKHFOnM3bHjRMS-2Dhks5twkjwgaJpZM4MzDEv&d=DwMFaQ&c=eLbWYnpnzycBCgmb7vCI4uqNEB9RSjOdn_5nBEmmeq0&r=MKJGe2g09glI2YyAL1RhKQ&m=rMGULjscPrQZ0NH4Z4r5Ahd1QOwAHhJitW3yKvsd-jk&s=xN8ZlLYCchxl0_plPPtwTRxo4UAswefJkwN8Zka_77s&e= .