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

Open
MeFisto94 opened this issue Dec 10, 2019 · 3 comments · May be fixed by #25256
Open

Fix mach bootstrap on Windows #25224

MeFisto94 opened this issue Dec 10, 2019 · 3 comments · May be fixed by #25256
Labels

Comments

@MeFisto94
Copy link
Contributor

@MeFisto94 MeFisto94 commented Dec 10, 2019

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

@highfive highfive commented Dec 10, 2019

@jdm jdm added the P-windows label Dec 10, 2019
@MeFisto94
Copy link
Contributor Author

@MeFisto94 MeFisto94 commented Dec 10, 2019

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 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 MeFisto94 linked a pull request that will close this issue Dec 12, 2019
4 of 4 tasks complete
MeFisto94 added a commit to MeFisto94/servo that referenced this issue Dec 12, 2019
… bootstrap can successfully download dependencies to it
@jdm jdm mentioned this issue Mar 6, 2020
4 of 4 tasks complete
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.

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