Closed Bug 1751178 Opened 4 years ago Closed 3 years ago

Improve "mach package" behaviour when necessary tools aren't available

Categories

(Firefox Build System :: General, defect, P5)

Firefox 96
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: e12.yukkuri.y, Unassigned)

Details

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 Edg/97.0.1072.62

Steps to reproduce:

Run ". /mach package" in the MINGW shell on Windows 11.

Actual results:

$ ./mach package
Parallelism determined by memory: using 16 jobs for 16 cores based on 47.9 GiB RAM and estimated job size of 1.0 GiB
0:00.97 c:/mozilla-build/bin/mozmake.exe -C . -j16 -s -w package
0:01.07 mozmake: Entering directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32'
0:01.08 mozmake[1]: Entering directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32/browser/installer'
0:01.17 mozmake[2]: Entering directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32/browser/installer'
0:01.19 mozmake[3]: Entering directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32/browser/installer'
0:05.52 Compressing...
.
.
.
0:29.11 mozmake[3]: Leaving directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32/browser/installer'
0:29.13 mozmake[3]: Entering directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32/browser/installer'
0:29.13 mozmake[3]: *** windows: No such file or directory. Stop.
0:29.13 mozmake[3]: Leaving directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32/browser/installer'
0:29.13 mozmake[2]: *** [c:/mozilla-source/gecko-dev/toolkit/mozapps/installer/packager.mk;112: make-package] Error 2
0:29.13 mozmake[2]: Leaving directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32/browser/installer'
0:29.13 mozmake[1]: *** [c:/mozilla-source/gecko-dev/config/rules.mk;352: default] Error 2
0:29.13 mozmake[1]: Leaving directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32/browser/installer'
0:29.13 mozmake: *** [c:/mozilla-source/gecko-dev/browser/build.mk;6: package] Error 2
0:29.13 mozmake: Leaving directory 'c:/mozilla-source/gecko-dev/obj-x86_64-pc-mingw32'

Expected results:

". /mach package" will exit successfully.

Which MinGW shell are you using? MSYS2's?
We generally don't support custom MinGW environments - can you reproduce this issue in MozillaBuild?

Flags: needinfo?(e12.yukkuri.y)

https://searchfox.org/mozilla-central/rev/8012bca692dddb307c2787bac1d4dd48cb0d8243/browser/moz.build#31-32
This suggests you don't have nsis installed (we should have a better error handling of mach package in case the tools necessary for packaging are not available).

What revision are you building?

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #1)

Which MinGW shell are you using? MSYS2's?
We generally don't support custom MinGW environments - can you reproduce this issue in MozillaBuild?
Oh, that was my mistake.
I'm using MozillaBuild.

Flags: needinfo?(e12.yukkuri.y)

Can you share your obj-*/config.log and obj-*/config.status?

Flags: needinfo?(e12.yukkuri.y)

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #4)

Can you share your obj-*/config.log and obj-*/config.status?

config.log:
https://pastebin.pl/view/03bbcc66
config.status:
https://pastebin.pl/view/60b047eb

Flags: needinfo?(e12.yukkuri.y)
Attached file config.status
Attached file config.log
INFO: checking for makensisu... 
DEBUG: makensisu: Looking for makensis
INFO: not found

As glandium suspected, you don't have makensis.
Comparitively, here's what my log looks like:

DEBUG: Trying to bootstrap toolchain-nsis
DEBUG: Resolved toolchain-nsis to gecko.cache.level-3.toolchains.v3.nsis.hash.90a50973d9766d5c056be1cdbc87124a7ccafe81ce1f1c16deff0c3bda08b3c3
INFO: Updating bootstrapped toolchain in C:/Users/Mitch/.mozbuild/nsis
INFO: checking for makensisu... 
DEBUG: makensisu: Looking for makensis
INFO: C:/Users/Mitch/.mozbuild/nsis/bin/makensis.exe
INFO: checking for NSIS version... 
DEBUG: Executing: `C:/Users/Mitch/.mozbuild/nsis/bin/makensis.exe -version`
INFO: 3.07
INFO: checking for 32-bit NSIS... 
INFO: yes

So, two guesses:

  1. You're on an old revision of Firefox that doesn't support bootstrapping: can you try off of central?
  2. You've disabled bootstrapping in your mozconfig: either turn it back on, or manually prepare your machine such that makensis is available.

Where can I get my hands on makensis?

Summary: The "windows" folder is not created and the installer cannot be created. → Improve "mach package" behaviour when necessary tools aren't available

Thank you! I'll give it a try.

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #10)

We're using this NSIS.

The windows folder was created, but a new error occurred.

31:22.51 TEST-PASS | check_js_opcode.py | ok
31:22.57 toolkit/locales/defaultagent_localized.ini.stub
31:33.72 Processing config: c:\Users\e12yu.mozbuild\nsis\nsisconf.nsh
31:33.74 Processing script file: "uninstaller.nsi" (ACP)
31:33.78 !include: could not find: "MUI.nsh"
31:33.78 Error in script "uninstaller.nsi" on line 64 -- aborting creation process
31:33.81 mozmake[5]: *** [c:/mozilla-source/mozilla-unified/toolkit/mozapps/installer/windows/nsis/makensis.mk;107: instgen/helper.exe] Error 1
31:33.82 mozmake[4]: *** [Makefile;20: libs] Error 2
31:33.82 mozmake[3]: *** [c:/mozilla-source/mozilla-unified/config/recurse.mk;99: browser/libs] Error 2
31:33.82 mozmake[2]: *** [c:/mozilla-source/mozilla-unified/config/recurse.mk;34: libs] Error 2
31:33.82 mozmake[1]: *** [c:/mozilla-source/mozilla-unified/config/rules.mk;352: default] Error 2
31:33.82 mozmake: *** [client.mk;63: build] Error 2
31:33.86 313 compiler warnings present.

(In reply to omoti from comment #12)

(In reply to Mitchell Hentges [:mhentges] 🦀 from comment #10)

We're using this NSIS.

The windows folder was created, but a new error occurred.

31:22.51 TEST-PASS | check_js_opcode.py | ok
31:22.57 toolkit/locales/defaultagent_localized.ini.stub
31:33.72 Processing config: c:\Users\e12yu.mozbuild\nsis\nsisconf.nsh
31:33.74 Processing script file: "uninstaller.nsi" (ACP)
31:33.78 !include: could not find: "MUI.nsh"
31:33.78 Error in script "uninstaller.nsi" on line 64 -- aborting creation process
31:33.81 mozmake[5]: *** [c:/mozilla-source/mozilla-unified/toolkit/mozapps/installer/windows/nsis/makensis.mk;107: instgen/helper.exe] Error 1
31:33.82 mozmake[4]: *** [Makefile;20: libs] Error 2
31:33.82 mozmake[3]: *** [c:/mozilla-source/mozilla-unified/config/recurse.mk;99: browser/libs] Error 2
31:33.82 mozmake[2]: *** [c:/mozilla-source/mozilla-unified/config/recurse.mk;34: libs] Error 2
31:33.82 mozmake[1]: *** [c:/mozilla-source/mozilla-unified/config/rules.mk;352: default] Error 2
31:33.82 mozmake: *** [client.mk;63: build] Error 2
31:33.86 313 compiler warnings present.

Sorry, this problem was my mistake.
I was able to successfully create the package! Thanks!

Great, nice work :)

Priority: -- → P5

All the tools necessary for mach package on windows should be auto-bootstrapped nowadays. Please reopen if that's not the case.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: