Opened 11 years ago

Closed 4 months ago

#961 closed defect (worksforme)

option quoting in csc is a complete mess

Reported by: felix winkelmann Owned by:
Priority: major Milestone: someday
Component: core tools Version: 4.8.x
Keywords: Cc:
Estimated difficulty: hard

Description (last modified by felix winkelmann)

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.

Change History (8)

comment:1 Changed 11 years ago by felix winkelmann

Description: modified (diff)

comment:2 Changed 11 years ago by sjamaan

Does the qs patch (58684f69572453acc6fed7326fa9df39be98760e) fix any of this?

comment:3 Changed 8 years ago by sjamaan

Estimated difficulty: hard

comment:4 Changed 7 years ago by sjamaan

It doesn't, see #1334

comment:5 Changed 7 years ago by sjamaan

Milestone: someday5.0

You know, this would be a great one to tackle for CHICKEN 5, since the breakage won't matter.

comment:6 Changed 6 years ago by felix winkelmann

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.

comment:7 Changed 6 years ago by felix winkelmann

Milestone: 5.0someday

comment:8 Changed 4 months ago by felix winkelmann

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.