./mach doc fails to unlink/remove file in use by other process, breaking `mach doc` on Windows
Categories
(Developer Infrastructure :: Source Documentation, defect)
Tracking
(firefox-esr91 unaffected, firefox98 wontfix, firefox99 wontfix, firefox100 wontfix, firefox101 fixed)
Tracking | Status | |
---|---|---|
firefox-esr91 | --- | unaffected |
firefox98 | --- | wontfix |
firefox99 | --- | wontfix |
firefox100 | --- | wontfix |
firefox101 | --- | fixed |
People
(Reporter: handyman, Assigned: Gijs)
References
(Blocks 2 open bugs, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
./mach doc
(on Windows 10) runs for a few minutes and then terminates with this error:
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\dapar\\AppData\\Local\\Temp\\tmpkhcpmynf'
File "c:\mozilla-src\mozilla-unified\tools/moztreedocs/mach_commands.py", line 165, in build_docs
status, warnings = _run_sphinx(docdir, savedir, fmt=fmt, jobs=jobs, verbose=verbose)
File "c:\mozilla-src\mozilla-unified\tools/moztreedocs/mach_commands.py", line 288, in _run_sphinx
os.unlink(warn_path)
The full log of this run is attached.
The missing file does not exist before mach doc
is run. I am not simultaneously using any other applications that should be touching these files. My repo was updated today. I don't know the last time I successfully built docs but I think it was only a couple of weeks ago.
I've tried running mach bootstrap
and mach clobber
first but get the same error. As suggested by the output, it gets far enough that I can open the generated HTML files in docs/html
, although it looks like the failure is from warn_path
.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox Build System::Documentation Infrastructure' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•3 years ago
|
||
The severity field is not set for this bug.
:Sylvestre, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 3•3 years ago
|
||
Andrew, what do you think about this one ?
Comment 4•3 years ago
|
||
I'm not really sure what's going on here. Looks like this warn_path
file was added in bug 1748845. My best guess is that something is failing in the Sphinx build, so Sphinx is still holding onto that file. Then when we hit the finally
block, there's an exception raised which obscures the real error.
David, do you see any other errors if you comment out that os.unlink
call?
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Set release status flags based on info from the regressing bug 1748845
Updated•3 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Earlier in the build process I also see:
C:\mozilla-build\python3\python.exe: can't open file 'path\to\srcdir\doc': [Errno 2] No such file or directory
Which doesn't seem good. There's no context to indicate where that's from. It appears straight after:
updating environment: [new config] 1767 added, 0 changed, 0 removed
and before a dump of environment variables.
(In reply to Andrew Halberstadt [:ahal] from comment #4)
I'm not really sure what's going on here. Looks like this
warn_path
file was added in bug 1748845. My best guess is that something is failing in the Sphinx build, so Sphinx is still holding onto that file.
There are a lot of warnings printed to the console, but I see those on macOS too. I wonder if this is just Windows being more upset about deleting files used by other apps than unix systems are? This is not that uncommon...
Then when we hit the
finally
block, there's an exception raised which obscures the real error.
Can you elaborate on this? I don't see a catch
block so I don't understand why this would obscure a "real" error; the real error would have surfaced earlier in the log if it threw an exception and was uncaught, right?
David, do you see any other errors if you comment out that
os.unlink
call?
No, if I comment it out the docs page loads as expected and everything appears to be fine.
Assignee | ||
Updated•3 years ago
|
Reporter | ||
Comment 8•3 years ago
|
||
Sorry for the tardy -- was on PTO til yesterday. FWIW I see what Gijs reports -- no errors, just the usual ton of warnings. When the unlink is removed, it builds the docs and launches them in the browser as expected. I'm also still seeing the "FileNotFound" on README.rst.
Comment 9•3 years ago
|
||
Can you elaborate on this? I don't see a catch block so I don't understand why this would obscure a "real" error; the real error would have surfaced earlier in the log if it threw an exception and was uncaught, right?
Yeah, mostly I'm unsure how Sphinx works under the hood. I see we're passing in --jobs
so it's possible that there's some subprocess being left running that still has a handle on the file.. But this would only happen if there were some (pretty major) bug in Sphinx, so agree it's unlikely. And like you said, one would assume some kind of error is displayed if it did.
Assignee | ||
Comment 10•3 years ago
|
||
How can we move forward here? The documentation mach command needs to work on Windows. I'm happy to help but honestly unsure if we can just remove the unlink
or need to do something more complicated or what, exactly.
Comment 11•3 years ago
|
||
gijs, yeah, can you do it? (remove unlink). We will see if we regress!
Assignee | ||
Comment 12•3 years ago
|
||
Updated•3 years ago
|
Comment 13•3 years ago
|
||
Comment 14•3 years ago
|
||
bugherder |
Updated•2 years ago
|
Description
•