Closed Bug 1755305 Opened 2 years ago Closed 2 years ago

Visual Studio clean and build targets fail

Categories

(Developer Infrastructure :: Developer Environment Integration, task)

Unspecified
Windows

Tracking

(firefox99 fixed)

RESOLVED FIXED
99 Branch
Tracking Status
firefox99 --- fixed

People

(Reporter: mvollmer, Assigned: mvollmer)

Details

Attachments

(1 file, 1 obsolete file)

The generated msvc/mach.bat that is a target of generated Visual Studio projects, calls mach and then keeps exit code of mach. If mach prints a warning, the exit code is 2. Visual Studio however considers any non-zero exit code in a batch file an error condition, and marks the build as failed (even though it succeeded).

The mach.bat gets generated by python/mozbuild/mozbuild/backend/visualstudio.py

Ideally we just add a little bit of extra logic to the generated batch file, that detects exit code 2, overwrites it with 0, and emits a clear warning for the user and Visual Studio to detect.

Assignee: nobody → mvollmer
Status: NEW → ASSIGNED
Attachment #9263742 - Attachment description: WIP: Bug 1755305 - Patch for Visual Studio mach batch script → Bug 1755305 - Patch for Visual Studio mach batch script r=mhentges
Attachment #9263742 - Attachment description: Bug 1755305 - Patch for Visual Studio mach batch script r=mhentges → Bug 1755305 - Fixes mach warnings detected as errors by Visual Studio r=mhentges
Component: General → Developer Environment Integration
Summary: Visual Studio fails job if mach emits a warning → Visual Studio clean and build targets fail

The clean target in Visual Studio projects in fact uses an invalid mach command. See also this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1670357

The correct command would be clobber, but that deletes the Visual Studio project files while Visual Studio is running, which it doesn't like too much.

A full build after clobber also causes errors, probably due to the environment not being correctly set:

lld-link: error: <root>: undefined symbol: mainCRTStartup
configure: error: installation or configuration problem: compiler cannot create executables.
Attachment #9263742 - Attachment is obsolete: true

So if a full build did work, then running clobber+build from Visual Studio would work. You'd be pulling the rug from under Visual Studio's feet, and then knit a new one under it before it looks down.

The first step is to fix the clean command (use clobber), update the docs that this is half-broken currently, and keep this bug open on low priority to fix the build environment issue in the future.

Attachment #9265341 - Attachment description: WIP: Bug 1755305 - Fix invalid mach command for Visual Studio clean target → Bug 1755305 - Fix invalid mach command for Visual Studio clean target r=mhentges
Pushed by gsvelto@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/95fe1ac0e7f3
Fix invalid mach command for Visual Studio clean target r=mhentges DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: