Open Bug 931141 Opened 12 years ago Updated 2 years ago

./mach build gives "[Error 193] %1 is not a valid Win32 application"

Categories

(Firefox Build System :: General, defect)

x86_64
Windows 8.1
defect

Tracking

(Not tracked)

People

(Reporter: abbGZcvu_bugzilla.mozilla.org, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release) Build ID: 20130910160258 Steps to reproduce: Follow steps to get prerequisites and build Firefox at https://developer.mozilla.org/en/docs/Simple_Firefox_build. Start build shell. Run commands: cd /c/mozilla-source/mozilla-central EXPORT PYTHON= export MOZBUILD_STATE_PATH=/c/mozilla-source/.mozbuild ./mach build Actual results: $ ./mach build 0:00.53 C:/mozilla-build/msys/bin/sh.exe -c c:/mozilla-build/python/python.exe c:/mozilla-source/mozilla-central/build/pymake/make.py -f client.mk -s ProcessManager NOT managing child processes 0:01.72 Adding client.mk options from c:/mozilla-source/mozilla-central/.mozconfig: 0:01.72 FOUND_MOZCONFIG := c:/mozilla-source/mozilla-central/.mozconfig 0:01.81 c:\mozilla-source\mozilla-central\client.mk:309:0: command 'c:/mozilla-source/mozilla-central/js/src/config/check-sync-dirs.py c:/mozilla-source/mozilla-central/js/src/build c:/mozilla-source/mozilla-central/build' failed, return code -127 0:01.81 c:\mozilla-source\mozilla-central\client.mk:179:0: command 'c:/mozilla-build/python/python.exe c:/mozilla-source/mozilla-central/build/pymake/pymake/../make.py -f c:/mozilla-source/mozilla-central/client.mk realbuild' failed, return code 2 0:01.82 [Error 193] %1 is not a valid Win32 application 0:01.85 0 compiler warnings present. 2 Expected results: No error message.
Tested and confirmed on another clean machine: Windows 8, VS 2010, SDK 8. Is there a log file somewhere that might give me more useful information?
Flags: needinfo?
I see the same problem on Windows 8, VS express 2013. Moreover in my case the error is in italian, thus it includes unicode chars, and thus it causes mach to fail in class ConvertToStructuredFilter(logging.Filter) since record.getMessage is unicode and gets then passed to TestStartFilter in mach_commands... Well, the result is that I can't run xpcshell tests... if I change code in ConvertToStructuredFilter to record.params = {'msg': record.getMessage().decode('utf-8', 'replace')} then I can run tests and I see the localized error 193.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?
Also getting this following the official instructions! Debug output here: Error running mach: ['build'] The error occurred in code that was called by the mach command. This is either a bug in the called code itself or in the way that mach is calling it. You should consider filing a bug for this issue. If filing a bug, please include the full output of mach, including this error message. The details of the failure are as follows: WindowsError: [Error 193] %1 is not a valid Win32 application File "C:\mozilla-source\mozilla-central\python/mozbuild/mozbuild/mach_commands .py", line 285, in build warnings_path = self._get_state_filename('warnings.json') File "C:\mozilla-source\mozilla-central\python/mozbuild\mozbuild\base.py", lin e 382, in _get_state_filename path = self.statedir File "C:\mozilla-source\mozilla-central\python/mozbuild\mozbuild\base.py", lin e 283, in statedir return os.path.join(self.topobjdir, '.mozbuild') File "C:\mozilla-source\mozilla-central\python/mozbuild\mozbuild\base.py", lin e 214, in topobjdir self.topsrcdir, self.mozconfig, default='obj-@CONFIG_GUESS@') File "C:\mozilla-source\mozilla-central\python/mozbuild\mozbuild\base.py", lin e 203, in resolve_mozconfig_topobjdir MozbuildObject.resolve_config_guess(mozconfig, topsrcdir)) File "C:\mozilla-source\mozilla-central\python/mozbuild\mozbuild\base.py", lin e 357, in resolve_config_guess return subprocess.check_output(args, cwd=topsrcdir).strip() File "C:\mozilla-build\python\lib\subprocess.py", line 568, in check_output process = Popen(stdout=PIPE, *popenargs, **kwargs) File "C:\mozilla-build\python\lib\subprocess.py", line 711, in __init__ errread, errwrite) File "C:\mozilla-build\python\lib\subprocess.py", line 948, in _execute_child startupinfo)
BTW Running Visual Studio Ultimate 2012 on my machine with Windows 8.1 (but without Update 1) on x86-64
(In reply to Jonathan from comment #3) > Also getting this following the official instructions! Debug output here: This is a different issue, it looks like config.guess isn't executable somehow. If you type "./build/autoconf/config.guess" from the top of the source checkout, what does it say?
(In reply to SkyLined from comment #0) > User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 > Firefox/24.0 (Beta/Release) > Build ID: 20130910160258 > > Steps to reproduce: > > Follow steps to get prerequisites and build Firefox at > https://developer.mozilla.org/en/docs/Simple_Firefox_build. Start build > shell. Run commands: > > cd /c/mozilla-source/mozilla-central > EXPORT PYTHON= > export MOZBUILD_STATE_PATH=/c/mozilla-source/.mozbuild > ./mach build Why are you running that "export PYTHON=" line? I suspect that's what's causing the problem here. We should certainly present a better error message there.
Product: Core → Firefox Build System
Severity: normal → S3

Hello, I had the same error and found the solution. The problem is in the bootstrap.py file in the which function definition. This program is expecting Mercurial executable to be named hg.exe, but mine is named hg.bat. Confirmed by running this command in my powershell: (Get-Command hg).Path

I'm not sure if this is caused by an update to Mercurial, but I have a simple solution that would allow compatibility with both naming conventions.

Can I claim this bug so I can push a fix?

Flags: needinfo?(abbGZcvu_bugzilla.mozilla.org)

I should also add that I am running Windows 11 and the ticket's platform is marked as Windows 8. Just wanted to put that out there in case someone wanted to update the platform to include Windows 11, because this bug definitely occurs on Windows 11.

I have a NEEDSINFO request on this but I do not know what I am being asked to do. Please clarify and create a new one if needed.

Flags: needinfo?(abbGZcvu_bugzilla.mozilla.org)

Sorry, I am new to this Bugzilla platform. I'd like to be assigned to this ticket

I don't work on FF; I just reported the issue. I'm sure there's a doc somewhere that explain what to do. You can probably just submit a patch.

Ah ok, my bad. Yeah I'll probably just submit it. It's a very simple fix

When bootstrapping, the which function is used to find the Mercurial executable (hg is the executable name). On Windows, it is possible that Mercurial is installed with extension .bat, which this script does not account for.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: