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

Compilation error on Windows #9

Open
bluebear94 opened this issue Feb 5, 2015 · 8 comments · May be fixed by #32
Open

Compilation error on Windows #9

bluebear94 opened this issue Feb 5, 2015 · 8 comments · May be fixed by #32

Comments

@bluebear94
Copy link

Scalatex sources can't be compiled on Windows since path names use backslashes, which happen to be the escape character for string.

This problem can be fixed by using triple quotes around paths in generated source files or replacing backslashes with forward slashes.

edit: is it a coincidence that this is issue #9?

@lihaoyi
Copy link
Owner

lihaoyi commented Feb 5, 2015

Sure. Want to send a PR? I don't have a windows machine to repro on

@bluebear94
Copy link
Author

It should be as simple as using one of the fixes I suggested.

At scalatexSbtPlugin/src/main/scala/scalatex/SbtPlugin.scala line 36:

| def apply(): Frag = scalatex.twf("${inFile.getAbsolutePath.replaceAll("\\\\", "/")}")

uses the latter workaround.

@lihaoyi
Copy link
Owner

lihaoyi commented Feb 5, 2015

Yeah but do you want me to do it, and botch it because I didn't test it, and not fix anything? Or do you want to try it out and make sure it works? =P

@bluebear94
Copy link
Author

Sure, provided that you tell me how to test it.

Edit: the change doesn't break compilation, and file handling does take forward slashes on Windows.

@lihaoyi
Copy link
Owner

lihaoyi commented Feb 5, 2015

sbt test

Runs the unit tests. This tests both the low level parser/etc. as well as the whole compilation pipeline.

sbt readme/run

Should generate an output file in readme/target/output. See if that works and looks right on your machine

@bluebear94
Copy link
Author

Error output for testing.

There might be dependencies that assume that absolute pathnames are forward-slashed (as in Unix) as well.

@lihaoyi
Copy link
Owner

lihaoyi commented Feb 8, 2015

Hmm ok. I don't have a windows laptop handy to repro, but if you have time to debug/send a PR I'd really appreciate it!

@philwalk
Copy link
Contributor

I just created a pull request that seems to fix this issue.

@andrelfpinto andrelfpinto linked a pull request Nov 3, 2016 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants