Closed Bug 1760873 Opened 2 years ago Closed 2 years ago

"hg" (non-exe) script shebang pointing to build directory, not installation directory

Categories

(Firefox Build System :: MozillaBuild, task)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mhentges, Assigned: mhentges)

References

Details

Attachments

(1 file)

../update-all: /c/mozilla-build/python3/Scripts/hg: c:\mozillabuild-stage\mozilla-build\python3\python.exe^M: bad interpreter: No such file or directory

As mentioned by RyanVM in a direct message, it looks like the "Scripts" shebangs that point to <build-dir>\python3\python3.exe aren't being correctly fixed by distutils_shebang_fix().

Assignee: nobody → mhentges
Status: NEW → ASSIGNED

As of "bug 1743185", some packages were now installed in Python 3 using
python.exe instead of python3.exe. However, the "shebang fix" was
only operating on python.exe-installed packages.

Since there's now only one Python version shipped with MozillaBuild,
let's only install packages with python.exe, just do a shebang fix
for that one "oldString", and always replace it with the version-less
python.exe.

Blocks: 1761015

Pushed by mhentges@mozilla.com:
https://hg.mozilla.org/mozilla-build/rev/77395cce3330
Fix broken shebang of Scripts\hg r=ahochheiden

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

If you need to execute hg scripts directly, and you're encountering errors here:

Workaround:

  1. Open $MOZILLABUILD\python3\Scripts\hg in a text editor
  2. Replace the first line (#!c:\mozillabuild-stage\mozilla-build\python3\python.exe) with #!python.exe

Before 4.0, I used to be able to set the VS code mercurial extension's path setting like this:

"hg.path": "C:\\mozilla-build\\python\\Scripts\\hg",

But setting the equivalent path in 4.0 results in a "not found" error at startup, prompting me to download mercurial. Maybe there's something I can edit to resolve this?

Oop, sorry Shane, I missed this message.
Did you get that "not found" error, even after trying the workaround described above?
Another tweak to try is to adjust the "hg.path" setting to include a .exe on the end:

"hg.path": "C:\\mozilla-build\\python\\Scripts\\hg.exe"
Flags: needinfo?(shmediaproductions)

No worries, thanks for the update. Yeah I had done the #!python.exe trick. What I ultimately needed to do is fix my OS PATH var. It still had .../python instead of .../python3 so that was preventing some stuff from working.

My previous post didn't make it clear that the path I linked would no longer work either way, because it needs to say python3 not python now. But I had already changed that in my VS Code setting so that wasn't really the issue. I think it was locating the hg script fine but then something was failing from there due to my PATH. So anyway if anyone else encounters this, make sure you look for anything that might be referencing the mozilla-build/python folder.

Anyway, after revising and refreshing the PATH, my whole environment is back to working perfectly so it's all good now.

Flags: needinfo?(shmediaproductions)
Product: mozilla.org → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: