Open Bug 1737042 Opened 4 years ago Updated 4 years ago

Instruction for adding git-cinnabar to PATH includes both slash and backslash in the path on windows

Categories

(Firefox Build System :: Bootstrap Configuration, enhancement, P5)

enhancement

Tracking

(Not tracked)

People

(Reporter: arai, Unassigned)

References

Details

On windows, running bootstrap with git repository shows the following at the end.
there the path to git-cinnabar contains both slash and backslash.

To add git-cinnabar to the PATH, edit your shell initialization script, which
may be called ~/.bashrc or ~/.bash_profile or ~/.profile, and add the following
lines:
​
    export PATH="c:/Users/USER/.mozbuild\git-cinnabar:$PATH"
​
Then restart your shell.

it's because we use os.path.join to create the path, that uses backslash on windows.

https://searchfox.org/mozilla-central/rev/489e82dcc1e5afbe691ff3b1c982382914637e38/python/mozboot/mozboot/bootstrap.py#566

def update_git_tools(git, root_state_dir):
    """Update git tools, hooks and extensions"""
    # Ensure git-cinnabar is up to date.
    cinnabar_dir = os.path.join(root_state_dir, "git-cinnabar")
Component: Mach Core → Bootstrap Configuration

This will be resolved when we migrate to pathlib for consistently handling paths.
Though, I'm curious: msys is pretty intelligent at handling Windowsy-Linux-isms - does it behave properly with a PATH with both front- and back-slashes?

Priority: -- → P3
See Also: → 1737112

Yeah, the backslash seems to work there (to be clear, after addressing bug 1737112).
so this isn't blocking bug.

Type: defect → enhancement
Priority: P3 → P5

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #1)

This will be resolved when we migrate to pathlib for consistently handling paths.

It that particular case, that's probably not true, because pathlib would consistently use backslashes, which aren't appropriate in that specific context.

It that particular case, that's probably not true, because pathlib would consistently use backslashes, which aren't appropriate in that specific context.

Pathlib will at least ensure path separator consistency. We will still have to ensure that displayed/exported paths used by msys follow msys's rules - which is essentially represented in part by bug 1737112.

The inconsistency in paths will be resolved by pathlib.

You need to log in before you can comment on or make changes to this bug.