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

Fix mach bootstrap on Windows #25224

Closed
MeFisto94 opened this issue Dec 10, 2019 · 3 comments · Fixed by #29954
Closed

Fix mach bootstrap on Windows #25224

MeFisto94 opened this issue Dec 10, 2019 · 3 comments · Fixed by #29954
Labels
A-mach P-windows Any version of Windows capable of running Servo

Comments

@MeFisto94
Copy link
Contributor

According to jdm on the IRC, mach bootstrap doesn't do anything useful, because every build-related command is already triggering windows_msvc.

Invoking bootstrap however, is done by https://github.com/servo/servo/blob/master/python/servo/bootstrap.py#L396 which in turn is called from https://github.com/servo/servo/blob/master/python/mach_bootstrap.py#L241

The following exception happens when ./mach bootstrap is invoked:

$ ./mach bootstrap
Traceback (most recent call last):
  File "./mach", line 103, in <module>
    main(sys.argv)
  File "./mach", line 31, in main
    sys.exit(mach_bootstrap.bootstrap_command_only(topdir))
  File "e:\Marc\Documents\Coding\servo\python\mach_bootstrap.py", line 245, in bootstrap_command_only
    bootstrap(context, force)
  File "e:\Marc\Documents\Coding\servo\python\servo\bootstrap.py", line 413, in bootstrap
    return bootstrapper(context, force=force)
  File "e:\Marc\Documents\Coding\servo\python\servo\bootstrap.py", line 278, in windows_msvc
    deps_dir = os.path.join(context.sharedir, "msvc-dependencies")
AttributeError: 'DummyContext' object has no attribute 'sharedir'

I think the solution to this is adding context.sharedir = os.path.join(context.topdir, ".servo") to the lastly linked code in mach_bootstrap.py, because other build tasks indeed do download the dependencies to .servo relative to the topdir.

Note that this would affect windows and linux alike, but it seems this sharedir is only requested from salt and windows and not linux, which installs the packets globally using apt.

@jdm jdm added the A-mach label Dec 10, 2019
@highfive
Copy link

cc @wafflespeanut

@jdm jdm added the P-windows Any version of Windows capable of running Servo label Dec 10, 2019
@MeFisto94
Copy link
Contributor Author

According to https://github.com/servo/servo/blob/master/python/servo/command_base.py#L316
context.sharedir = self.config["tools"]["cache-dir"] is the correct value for the sharedir.
I assume we cannot inherit from that class, because mach bootstrap happens before mach is fully functional?

@jdm
Copy link
Member

jdm commented Dec 10, 2019

This might be a regression from #24567.

MeFisto94 added a commit to MeFisto94/servo that referenced this issue Dec 12, 2019
… bootstrap can successfully download dependencies to it
MeFisto94 added a commit to MeFisto94/servo that referenced this issue Dec 12, 2019
… bootstrap can successfully download dependencies to it
MeFisto94 added a commit to MeFisto94/servo that referenced this issue Dec 12, 2019
… bootstrap can successfully download dependencies to it
MeFisto94 added a commit to MeFisto94/servo that referenced this issue Dec 12, 2019
… bootstrap can successfully download dependencies to it
bors-servo added a commit that referenced this issue Jul 3, 2023
Windows bootstrap support

<!-- Please describe your changes on the following line: -->

---
<!-- 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 #25224
- [x] These changes do not require tests because they are just support script changes.

<!-- 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. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mach P-windows Any version of Windows capable of running Servo
Projects
None yet
3 participants