bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

"mach bootstrap" for artifact desktop builds fails due to "FileNotFoundError" in install_rustup()

RESOLVED FIXED in Firefox 54

Status

Firefox Build System
General
RESOLVED FIXED
a year ago
5 months ago

People

(Reporter: whimboo, Assigned: rillian)

Tracking

Trunk
mozilla54

Firefox Tracking Flags

(firefox54 fixed)

Details

MozReview Requests

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

I tried to run "mach bootstrap" on a Windows8 loaner machine via mozilla-build and the command failed as follows:

NameError: global name 'FileNotFoundError' is not defined

  File "c:\builds\mozilla-unified\python/mozboot/mozboot/mach_commands.py", line
 26, in bootstrap
    bootstrapper.bootstrap()
  File "c:\builds\mozilla-unified\python/mozboot\mozboot\bootstrap.py", line 223
, in bootstrap
    self.instance.install_system_packages()
  File "c:\builds\mozilla-unified\python/mozboot\mozboot\mozillabuild.py", line
22, in install_system_packages
    self.install_rustup()
  File "c:\builds\mozilla-unified\python/mozboot\mozboot\mozillabuild.py", line
48, in install_rustup
    except FileNotFoundError:
Flags: needinfo?(giles)
Comment hidden (mozreview-request)
oops, thought I'd fixed. Of course if you got this error it means the install probably also failed?
Assignee: nobody → giles
Flags: needinfo?(giles)
(Assignee)

Updated

a year ago
Attachment #8837281 - Flags: review?(cmanchester)
(Assignee)

Updated

a year ago
Attachment #8837281 - Flags: review?(cmanchester) → review?(nfroyd)
Comment on attachment 8837281 [details]
Bug 1339409 - mozboot: Fix undefined FileNotFoundError.

https://reviewboard.mozilla.org/r/112450/#review113848

r=me.  WDYT about the below change?

::: python/mozboot/mozboot/mozillabuild.py:49
(Diff revision 1)
> -            except FileNotFoundError:
> +            except OSError as e:
> +                # Emulate FileNotFoundError on python 2.
> +                if e.errno == errno.ENOENT:

I think we could just remove the comment.  I wondered what would happen in Python 3 with this code--as future readers might--and discovered `FileNotFoundError` was a subclass of `OSError`.  Talking about emulation in this context is just a historical artifact of the code, IMHO.
Attachment #8837281 - Flags: review?(nfroyd) → review+
(Assignee)

Comment 4

a year ago
mozreview-review
Comment on attachment 8837281 [details]
Bug 1339409 - mozboot: Fix undefined FileNotFoundError.

https://reviewboard.mozilla.org/r/112450/#review113854

::: python/mozboot/mozboot/mozillabuild.py:49
(Diff revision 1)
> -            except FileNotFoundError:
> +            except OSError as e:
> +                # Emulate FileNotFoundError on python 2.
> +                if e.errno == errno.ENOENT:

According the the requests, module, FileNotFoundError is a subclass of OSError, and so this clause will pass that as well. This seems to work in a test script I tried.

This is what I was trying to indicate with the comment, apparently unsuccessfully. I don't think it's worth writing out the whole thing just for potential python3 porting, so I'll just remove the comment.
Comment hidden (mozreview-request)
(Assignee)

Comment 6

a year ago
mozreview-review
Comment on attachment 8837281 [details]
Bug 1339409 - mozboot: Fix undefined FileNotFoundError.

https://reviewboard.mozilla.org/r/112450/#review113856

Comment 7

a year ago
Pushed by rgiles@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4dd3c6bf5b29
mozboot: Fix undefined FileNotFoundError. r=froydnj
(In reply to Ralph Giles (:rillian) | needinfo me from comment #2)
> oops, thought I'd fixed. Of course if you got this error it means the
> install probably also failed?

Most likely yes. But not sure what it actually was because of the busted stack output.

Thanks for fixing this problem.

Comment 9

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/4dd3c6bf5b29
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox54: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Now I also know the underlying issue... for details see bug 1339347 comment 5.
Ah, python too old for tls does explain it. :/

Updated

5 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.