Bug 1783635 Comment 14 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Okay I was finally able to reproduce after working on a different issue.

For my case to get this issue to show up, I installed Python `3.10` via `brew` and did `brew link python@3.10`. After that `python3 --version` showed Python `3.10.6`. When running `./mach try auto` I got the same error as you did, and but it was still coming from the `site-packages` dir for Python `3.8`. It looks like what's happening is `mach` is starting with Python `3.10`, then when it starts doing things with `mercurial` it's going to the `3.8` version of `mercurial` (or whatever version it was originally installed under during the [MacOS Build Setup](https://firefox-source-docs.mozilla.org/setup/macos_build.html).

I fixed it by installing `mercurial` for my new version of `python` (`3.10.6`) eg:
```
python3 -m pip install --user mercurial==6.1.2
```
Specifying `mercurial==6.1.2` was necessary. Without it I grabbed `6.2.1` and there's a [recent regression](https://groups.google.com/g/linux.debian.bugs.dist/c/TctblRH9jvI?pli=1) with `fsmonitor` if you're on `6.2`.

I think everything makes sense. When switching to a new version of Python, `mercurial` must be re-installed. Though, `mercurial` from a different Python installation being used does seem kind of wrong, but I'm not too sure why that's happening. It'd be great if we could stop that and/or add a check to see if `mercurial` is installed for the running version of Python so that there's a helpful error message instead of what we saw here.
Okay I was finally able to reproduce after working on a different issue.

For my case to get this issue to show up, I installed Python `3.10` via `brew` and did `brew link python@3.10`. After that `python3 --version` showed Python `3.10.6`. When running `./mach try auto` I got the same error as you did, and but it was still coming from the `site-packages` dir for Python `3.8`. It looks like what's happening is `mach` is starting with Python `3.10`, then when it starts doing things with `mercurial` it's going to the `3.8` version of `mercurial` (or whatever version it was originally installed under during the [MacOS Build Setup](https://firefox-source-docs.mozilla.org/setup/macos_build.html) and there's some incompatibility there (which isn't surprising).

I fixed it by installing `mercurial` for my new version of `python` (`3.10.6`) eg:
```
python3 -m pip install --user mercurial==6.1.2
```
Specifying `mercurial==6.1.2` was necessary. Without it I grabbed `6.2.1` and there's a [recent regression](https://groups.google.com/g/linux.debian.bugs.dist/c/TctblRH9jvI?pli=1) with `fsmonitor` if you're on `6.2`.

I think everything makes sense. When switching to a new version of Python, `mercurial` must be re-installed. Though, `mercurial` from a different Python installation being used does seem kind of wrong, but I'm not too sure why that's happening. It'd be great if we could stop that and/or add a check to see if `mercurial` is installed for the running version of Python so that there's a helpful error message instead of what we saw here.

Back to Bug 1783635 Comment 14