the message for CLOBBER file should use slash for path separator when printing command
Categories
(Firefox Build System :: General, defect)
Tracking
(firefox120 fixed)
| Tracking | Status | |
|---|---|---|
| firefox120 | --- | fixed |
People
(Reporter: arai, Assigned: sergesanspaille)
Details
Attachments
(1 external file)
The message around clobber file uses os default path separator when joining the obj directory path and CLOBBER,
CLOBBER_MESSAGE = "".join(
[
TextWrapper().fill(line) + "\n"
for line in """
...
If you know this clobber doesn't apply to you or you're feeling lucky -- \
Well, are ya? -- you can ignore this clobber requirement by running:
$ touch {clobber_file}
return CLOBBER_MESSAGE.format(
clobber_reason="\n".join(lines),
no_reason=" " + reason,
clobber_file=self.obj_clobber,
self.obj_clobber = os.path.join(topobjdir, "CLOBBER")
it results in printing the following on windows, which is not right command because the backslash is treated as escape
$ touch C:/mozilla-source/mozilla-unified/obj-x86_64-pc-windows-msvc\CLOBBER
the same happens on test's case:
INSTALL_TESTS_CLOBBER = "".join(
[
TextWrapper().fill(line) + "\n"
for line in """
...
If you did not modify any test files, it is safe to ignore this message \
and proceed with running tests. To do this run:
$ touch {clobber_file}
INSTALL_TESTS_CLOBBER.format(
clobber_file=os.path.join(self.topobjdir, "CLOBBER")
| Assignee | ||
Comment 1•3 years ago
|
||
Do you mean that even on windows, using / as the path separator would be better?
| Reporter | ||
Comment 2•3 years ago
|
||
(In reply to [:sergesanspaille] from comment #1)
Do you mean that even on windows, using
/as the path separator would be better?
For regular operation, it can be either of them I think, but in the context of "printing the path as a part of command, to let people copy and paste it and run", single backslash doesn't work, because it's not treated as a path separator, but an escape for the next character.
Running touch C:/mozilla-source/mozilla-unified/obj-x86_64-pc-windows-msvc\CLOBBER touches obj-x86_64-pc-windows-msvcCLOBBER file (the escape is ignored for unknown "C" character)
Then, given the self.topobjdir uses slash, it would be easier to use slash also when joining "CLOBBER"
| Assignee | ||
Comment 3•3 years ago
|
||
This brings in more consistency and as a side effect should make the
clobber message copy-pastable.
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
Comment 5•3 years ago
|
||
| bugherder | ||
Description
•