Summary
option quoting in csc is a complete mess
Metadata
- Id: 30767f0ca4a81f28fb9b43f34bf1f5a2b232fb39
- Trac id: 961
- Type: defect
- Reporter: felix
- Owner:
- Cc:
- Status: closed
- Component: core tools
- Estimated difficulty: hard
- Resolution: worksforme
- Priority: major
- Milestone: someday
- Version: 4.8.x
- Changetime: 2023-11-06 23:43:03 UTC
- Created: 2012-12-27 00:14:15 UTC
- Keywords:
Description
Using things like `csc -cflags` in shell scripts is mostly unusable, as the quoted include path (`-I" ... "`) is taken verbatim and not recognized by gcc due to the quotes.
Even though this is fundamentally based on the completely useless and insane shell quoting rules of sh and it's bastards, the code in `csc` doesn't make it any better, by using various ways of quoting ("qs", "quotewrap", "quote-option") and a tangled labyrinth of variables and thoughtlessly written crap code.
`csc` needs a complete rewrite. Ideally with lots of stuff removed to makes it less complex (like deployment) and a single point where options are prepared shell and shell-quoted as necessary.
This will necessarily break lots of stuff. It doesn't matter. It has to be.
Changes and comments
[2012-12-27 00:14:32 UTC] felix changed description
[2013-05-25 15:00:53 UTC] sjamaan wrote:
Does the qs patch (58684f69572453acc6fed7326fa9df39be98760e) fix any of this?
[2016-08-25 21:07:57 UTC] sjamaan set difficulty to hard
[2016-10-14 16:46:27 UTC] sjamaan wrote:
It doesn't, see #1334
[2016-10-14 16:46:58 UTC] sjamaan changed milestone from someday to 5.0
[2016-10-14 16:46:58 UTC] sjamaan wrote:
You know, this would be a great one to tackle for CHICKEN 5, since the breakage won't matter.
[2017-10-26 23:42:47 UTC] felix wrote:
I don't know what to do here. To avoid quoting hell, one should probably use `execve` and friends in this case, but the appropriate device for Windows does not exist. The quoting rules with `cmd.exe` are even more insane than under UNIX and make up a large part of the messy code that is used in `csc` to somehow pass the correct arguments to subprocesses.
A rewrite is certainly desirable, but not required for C5. We should identify specific functionality that is either broken or *must* be changed in an incompatible manner.