Closed Bug 1594520 Opened 4 months ago Closed 4 months ago

Cleanup VSCode tasks.json

Categories

(Firefox Build System :: General, task)

task
Not set

Tracking

(firefox72 fixed)

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

Details

Attachments

(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 tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/530c4ab772a6
Avoid duplication in .vscode/tasks.json r=jya
https://hg.mozilla.org/integration/autoland/rev/57a4794a87f2
Fix argument lists in .vscode/tasks.json r=jya
https://hg.mozilla.org/integration/autoland/rev/27ab68adb7d0
Use workspaceFolder in .vscode/tasks.json r=jya
https://hg.mozilla.org/integration/autoland/rev/519ad74e9d7b
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.

Status: RESOLVED → REOPENED
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 tcampbell@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4e3a2ac7a81d
Change directory before running mach in .vscode/tasks.json on Windows. r=jya
Status: REOPENED → RESOLVED
Closed: 4 months ago4 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.