Closed Bug 1594520 Opened 1 year ago Closed 1 year ago

Cleanup VSCode tasks.json


(Firefox Build System :: General, task)

Not set


(firefox72 fixed)

Tracking Status
firefox72 --- fixed


(Reporter: tcampbell, Assigned: tcampbell)


(Blocks 1 open bug)



(5 files)

The config files for vscode seem to have bit rotted a bit. I have some patches to clean this up and make a few more things on windows work out of the box.

These options default to outer contexts so we don't need to repeat ourselves.
We were already setting the top level values anyways.

In the migration to the 2.0 format we seem to have dropped the base mach
command from a few of the defined tasks.

Depends on D52081

The ${workspaceRoot} variable was deprecated when multi-folder workspaces
were added to VSCode.

Depends on D52082

Current versions of mozilla-build ignore the current working directory so
explicitly 'cd' to workspace before running mach. Due to path mangling issues
copying from vscode -> powershell -> msys-bash, I used a PowerShell fragment
to translate the path.

Depends on D52083

I don't think anyone from the build list has much familiarity with this file. It might make more sense to get it reviewed by another vscode user. I'll volunteer jya if you don't have anyone else in mind.

Attachment #9107015 - Attachment description: Bug 1594520 - Change directory in mozilla-build within .vscode/tasks.json → Bug 1594520 - Use full path to mach in .vscode/tasks.json on Windows

As people who last touched the .vscode/tasks.json file, do either of you have objections to these changes and/or can someone rubber-stamp them? I've been testing on Win10+mozilla-build and Ubuntu linux.

The final patch should be the only one that might be controversial. It does expect that powershell is around, but that doesn't seem unreasonable for now. The change makes it work out-of-the-box with mozilla-build (which currently defaults to user home directory).

The ${relativeFile} stuff is still busted on windows platforms because the msys invocation mangles path. I won't try to tackle it now, but might be fixable with windows-specific args override using the same substitutions.

Flags: needinfo?(jyavenard)
Flags: needinfo?(gsquelart)
Flags: needinfo?(jyavenard)

Can't rubberstamp as I'm not savvy enough; thank you for doing this though.

Flags: needinfo?(gsquelart)
Pushed by
Avoid duplication in .vscode/tasks.json r=jya
Fix argument lists in .vscode/tasks.json r=jya
Use workspaceFolder in .vscode/tasks.json r=jya
Use full path to mach in .vscode/tasks.json on Windows r=jya

It seems the version of windows path mangling I landed does not quite work. Our build is breaks if I call 'C:\path\to\mach' vs 'c:\path\to\mach'. There is a very complicated dance of msys and windows binaries that get run through the build, so the simplest fix is to tweak the command to be cd C:\path\to; mach so that the path normalization works the same as if you opened prompt manually.

Resolution: FIXED → ---

The build is quite fragile if the path to mach is not precisely
formatted. Work around this by cd-ing to the appropriate directory and
then calling 'mach' with a relative path. This mimics a normal user
workflow in mozilla-build.

Pushed by
Change directory before running mach in .vscode/tasks.json on Windows. r=jya
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.