Ticket #482 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

Fix building on Windows in paths containing space characters

Reported by: Philip Owned by:
Priority: Nice to Have Milestone:
Component: Core engine Keywords: simple, review
Cc:

Description

When located in a path containing spaces, the Windows builds fail with some error message. If I remember correctly, the problem is we pass an absolute path to the cxxtestgen.exe tool but don't correctly put quotes around it. It should perhaps be fixed by modifying our patched copy of Premake, so that it emits correct .vcproj files with the necessary quotes.

Someone should verify that this is really the cause of the errors, and fix it.

Attachments

premake_relative_filepath.patch (1.0 KB) - added by Zoomastigophora 3 years ago.

Change History

comment:1 Changed 3 years ago by Zoomastigophora

  • Keywords simple, review added; simple removed

Ugh, this is mildly infuriating. It looks like cxxtestgen expects forward slashes for directories like they would be in a Unix environment and treats backslashes as escape characters EXCEPT if the input string contains all backslashes in which case it automatically converts it properly. It also tokenizes on spaces, which I guess makes sense since it can take multiple input files, but this also means it completely ignores quotes so it's not even a quoting issue.

Anywho, I've modified vs.c to build a relative file path for the test files and that fixes the problem, but that means that if the folder structure ever changes, the corresponding line needs to be adjusted.

Changed 3 years ago by Zoomastigophora

comment:2 Changed 3 years ago by Zoomastigophora

Alternatively, I guess you can also step through the path and prepend all the space characters with backslashes.

comment:3 Changed 3 years ago by Philip

Huh, that cxxtestgen behaviour does seem a bit odd - I didn't realise it would do that. Relative paths sound like the best way to avoid the problem.

I think your patch won't quite work if the game is checked out into a path containing the string "source" (less common than spaces but not impossible :-) ). But it looks like path is already of the form ../../../source/[...] so we can just use that directly with no string manipulation.

comment:4 Changed 3 years ago by philip

  • Status changed from new to closed
  • Resolution set to fixed

(In [7625]) Fix building on Windows in paths containing space characters. Fixes #482, based on patch from Zoomastigophora.

comment:5 Changed 3 years ago by anonymous

  • Milestone Unclassified deleted

Milestone Unclassified deleted

Note: See TracTickets for help on using tickets.