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

Can't subst \$( in Textfile #4021

Closed
datalogics-robb opened this issue Sep 17, 2021 · 1 comment · Fixed by #4023
Closed

Can't subst \$( in Textfile #4021

datalogics-robb opened this issue Sep 17, 2021 · 1 comment · Fixed by #4023
Labels
subst Problems with quoting, substitution
Milestone

Comments

@datalogics-robb
Copy link
Contributor

datalogics-robb commented Sep 17, 2021

Describe the bug
Generating .NET Core csproj files I needed to insert this string literal into the output
NETCore\bin\$(Platform)\$(Configuration)\

But there does not seem to be any way to output the sequence \$(

To reproduce clone this:
https://github.com/datalogics-robb/quote-test-scons

run scons to generate GenFile.csproj and observe this string in the output:
NETCore\bin\$Platform)\$Configuration)\

SCons version 4.2.0
CPython 3.9.[67] tested on Mac/Linux

@bdbaddog bdbaddog added the subst Problems with quoting, substitution label Sep 17, 2021
@mwichmann
Copy link
Collaborator

Just capturing what was noted on Discord, although I got some details wrong there - the code uses some different conventions and it tripped me up. The textfile tool (which also implements substfile) sets up an action function which does substitution on the values in the SUBST_DICT, using env.subst(value). With no keyword args, this defaults to raw=0 which will end up calling scons_subst with SUBST_CMD. But the intended usage here is just a plain textual substitution, not either the fancy "for command line" or the alternative "for signature", so this is probably not what's wanted in this context. Suggest adding raw=1 (not raw=True as I said in the Discord thread).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subst Problems with quoting, substitution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants