Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network error breaks mach on Windows #22727

Closed
learning opened this issue Jan 18, 2019 · 2 comments
Closed

Network error breaks mach on Windows #22727

learning opened this issue Jan 18, 2019 · 2 comments

Comments

@learning
Copy link
Contributor

@learning learning commented Jan 18, 2019

Network error breaks mach on Windows

  1. .\mach.bat build -d
  2. Downloading dependencies...
  3. Network error
  4. Error: File is not a zip file
C:\Users\Learning\Documents\Projects\servo> .\mach.bat build -d
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.3
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Installing missing MSVC dependencies...
Extracting llvm-6.0.0...Error running mach:

    ['build', '-d']

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:

BadZipfile: File is not a zip file

  File "C:\Users\Learning\Documents\Projects\servo\python\servo\build_commands.py", line 280, in build
    self.ensure_bootstrapped(target=target)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\command_base.py", line 798, in ensure_bootstrapped
    Registrar.dispatch("bootstrap", context=self.context)
  File "C:\Users\Learning\Documents\Projects\servo\python\_virtualenv\Lib\site-packages\mach\registrar.py", line 123, in dispatch
    return self._run_command_handler(handler, context=context, **kwargs)
  File "C:\Users\Learning\Documents\Projects\servo\python\_virtualenv\Lib\site-packages\mach\registrar.py", line 90, in _run_command_handler
    result = fn(**kwargs)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\bootstrap_commands.py", line 59, in bootstrap
    return bootstrap.bootstrap(self.context, force=force)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\bootstrap.py", line 392, in bootstrap
    return bootstrapper(context, force=force)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\bootstrap.py", line 329, in windows_msvc
    extract(zip_path, deps_dir)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\util.py", line 193, in extract
    ZipFileWithUnixPermissions(src).extractall(dst)
  File "C:\Python27\lib\zipfile.py", line 770, in __init__
    self._RealGetContents()
  File "C:\Python27\lib\zipfile.py", line 811, in _RealGetContents
    raise BadZipfile, "File is not a zip file"

And I can't do anything after that, even mach clean:

PS C:\Users\Learning\Documents\Projects\servo> .\mach.bat clean
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.3
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Installing missing MSVC dependencies...
Extracting llvm-6.0.0...Error running mach:

    ['clean']

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:

BadZipfile: File is not a zip file

  File "C:\Users\Learning\Documents\Projects\servo\python\servo\build_commands.py", line 623, in clean
    self.ensure_bootstrapped()
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\command_base.py", line 798, in ensure_bootstrapped
    Registrar.dispatch("bootstrap", context=self.context)
  File "C:\Users\Learning\Documents\Projects\servo\python\_virtualenv\Lib\site-packages\mach\registrar.py", line 123, in dispatch
    return self._run_command_handler(handler, context=context, **kwargs)
  File "C:\Users\Learning\Documents\Projects\servo\python\_virtualenv\Lib\site-packages\mach\registrar.py", line 90, in _run_command_handler
    result = fn(**kwargs)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\bootstrap_commands.py", line 59, in bootstrap
    return bootstrap.bootstrap(self.context, force=force)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\bootstrap.py", line 392, in bootstrap
    return bootstrapper(context, force=force)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\bootstrap.py", line 329, in windows_msvc
    extract(zip_path, deps_dir)
  File "C:\Users\Learning\Documents\Projects\servo\python\servo\util.py", line 193, in extract
    ZipFileWithUnixPermissions(src).extractall(dst)
  File "C:\Python27\lib\zipfile.py", line 770, in __init__
    self._RealGetContents()
  File "C:\Python27\lib\zipfile.py", line 811, in _RealGetContents
    raise BadZipfile, "File is not a zip file"
@jdm
Copy link
Member

@jdm jdm commented Jan 18, 2019

Sounds like mach clean should also remove self.context.sharedir.

@learning
Copy link
Contributor Author

@learning learning commented Jan 19, 2019

My solution is delete the bad zip file and download it again, it works for me.

bors-servo added a commit that referenced this issue Jan 21, 2019
Fix BadZipfile error while install msvc dependencies

<!-- Please describe your changes on the following line: -->
Fix BadZipfile error while install msvc dependencies

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #22727

<!-- Either: -->
- [X] These changes do not require tests because it's a patch to `mach`

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22734)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Jan 21, 2019
Fix BadZipfile error while install msvc dependencies

<!-- Please describe your changes on the following line: -->
Fix BadZipfile error while install msvc dependencies

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #22727

<!-- Either: -->
- [X] These changes do not require tests because it's a patch to `mach`

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22734)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.