Open Bug 1531181 Opened 6 years ago Updated 2 years ago

Linting on Windows 10 fails if the system local is set to Unicode (which is experimental)

Categories

(Developer Infrastructure :: Source Code Analysis, defect, P3)

Tracking

(Not tracked)

People

(Reporter: jorgk-bmo, Unassigned)

Details

IOError: [Errno 22] Invalid argument

File "c:\mozilla-source\comm-central\tools/lint/mach_commands.py", line 84, in eslint
argv=extra_args, **kwargs)
File "c:\mozilla-source\comm-central\python/mach\mach\registrar.py", line 139, in dispatch
return self._run_command_handler(handler, context=context, **kwargs)
File "c:\mozilla-source\comm-central\python/mach\mach\registrar.py", line 96, in _run_command_handler
result = fn(**kwargs)
File "c:\mozilla-source\comm-central\tools/lint/mach_commands.py", line 65, in lint
return cli.run(*runargs, **lintargs)
File "c:\mozilla-source\comm-central\python/mozlint\mozlint\cli.py", line 186, in run
print(out)

works with

  • out = formatter(result).encode(sys.stdout.encoding or 'ascii', 'replace')
  • out = formatter(result).encode('ascii', 'replace')

FYI:

$ python
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import sys
print sys.stdout.encoding
cp65001

That's UTF-8 in M$ speak ;-)

The priority flag is not set for this bug.
:sylvestre, could you have a look please?

Flags: needinfo?(sledru)

What was the command which caused that?

Flags: needinfo?(sledru)
Priority: -- → P3

Just normal linting. If all is well, on Windows with an ANSI system code page is shows:

$ ../mach eslint mail/components/extensions/
? 0 problems (0 errors, 0 warnings)

The ? appears to be some special character. If I switch the system code page to UTF-8, or cp65001 in the M$ world by using a Windows 10 beta feature in "Control Panel > Region, Administrative, Change system locale", then I get what I reported in comment #0.

<rant>
mach support on Windows is rather poor anyway, what comes out in nice colours on Linux, comes out as funny escape sequences in the DOS/sh window:

 0:11.16     Blocking waiting for file lock on build directory
 0:11.31     Finished dev [optimized + debuginfo] target(s) in 2.13s
 0:11.31     Finished dev [optimized + debuginfo] target(s) in 2.13s
 0:11.36     Finished dev [optimized + debuginfo] target(s) in 2.18s
 0:12.27     Finished dev [optimized + debuginfo] target(s) in 3.07s

(you can't even see in the posted comment that there are non-printable characters in fron of each [0m, maybe a ESC.)

The rust compiler is another beauty:

 1:18.79    Compiling binast v0.1.1 (C:\mozilla-source\comm-central\js\src\frontend\binast)
 1:18.83    Compiling geckodriver v0.24.0 (C:\mozilla-source\comm-central\testing\geckodriver)

So this is just another example of example how badly Mozilla's prime platform is supported.
</rant>

Please avoid unrelated rant. They aren't bringing any value to this bug.

Sure, the idea was that you might see it an tell me that that's already reported elsewhere. But I filed bug 1535831 now.

Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.