-
Notifications
You must be signed in to change notification settings - Fork 238
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
mcconfig/mcmanifest escaping of '#' on Windows #1356
mcconfig/mcmanifest escaping of '#' on Windows #1356
Conversation
Thanks for the Windows-only correction and for setting this up as a PR. We'll get it merged. |
I found another place where the |
Thanks. That looks good too. |
Oops. This patch breaks
It fails on a file with a
It works correctly without the patch. With the patch the makefile contains:
Without the patch:
The patch bypasses the escaping of for (var result of tool.jsFiles) {
var source = result.source;
var sourceParts = tool.splitPath(source);
var target = result.target;
const escapedHash = tool.windows ? "^#" : "\\#";
target = target.replaceAll('#', escapedHash);
var targetParts = tool.splitPath(target);
this.line("$(MODULES_DIR)", tool.slash, target, ": ", source.replaceAll("#", escapedHash)); The |
That was what I originally did, and while the Starting with the line that you provided that works:
The operational difference seems to be the
What seems odd to me is that the So while using just I ran this updated PR on While looking at the code, I also noticed that the following line seems unnecessary: var sourceParts = tool.splitPath(source); (in Unless I misunderstand |
I found another use case that wasn't being handled correctly. TypeScript and Windows only. |
Agreed.
This has me baffled too. I wonder if the make escape rules are different for makefile rules and recipes, and/or quoted strings. I looked for some explanation, but failed. This page of the GNU Make docs has a section on
Yes, the call to From a purely style perspective, maybe there should be a I will test your changes out on macOS in the next day or so. I'd like to get this landed to be able to move on to the other topic. |
This is working well for me. The generated makefile output also matches what I would expect. So, two possible changes to finish this up:
|
I've found at least two more cases where it's not being handled correctly. Both are caused by attempting to preload a file with The first error was fairly easy to find. It's in However, even with that fixed, it fails to link. I'm getting closer to figuring that out, but will need more time. P.S. I'm heading out on vacation for about 10 days starting early tomorrow. I'll get some time in most days, but substantially less than normal. |
Just updated the PR as suggested, along with the new change for preload. The link time error I reported had nothing to do with escaping hashes. I'm debugging multiple problems at once (module resolution work) and the error was preload not resolving my module and not due to a Edit: Can you test that preload is working on Mac? The change adds the escape on all platforms. |
Just did a quick test of preload on macOS. It works with your change and fails without it. Good catch. Enjoy your vacation. We'll continue making progress as time allows. |
Two small changes to
mcconfig.js
andmcmanifest
:For Windows only, change the escaping of
#
(used for private scope modules) to use^
symbol instead of\
.Adjust to escape
#
only on build rules and not execution commands. Previously it adjusted the target (and not the source) on the rule and execution command lines. This change escapes both source and target, and only on rules. I believe this is correct for all make systems, but I'm only able to test on Windows.See #1354