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

Added submodule fetch instructions. #49338

Closed
wants to merge 1 commit into from
Closed

Added submodule fetch instructions. #49338

wants to merge 1 commit into from

Conversation

krk
Copy link
Contributor

@krk krk commented Mar 24, 2018

No description provided.

@varkor
Copy link
Member

varkor commented Mar 24, 2018

This shouldn't be necessary, because x.py automatically fetches and updates the submodules each time it's run.

@krk
Copy link
Contributor Author

krk commented Mar 25, 2018

It didn't work for me on Windows 10 x64, x.py complained that src\tools\clippy is empty.

After fetching the submodules, x.py can display --help.

@pietroalbini pietroalbini added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 26, 2018
@pietroalbini
Copy link
Member

Thanks for this PR! Seems strange that doesn't work on Windows... (also highfive failed to assign a reviewer, picking one randomly)

cc @retep998
r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

I can reproduce this on non-windows, it seems that perhaps Cargo has recently(?) started examining toml files on cargo build that aren't the ones passed via manifest-path... @alexcrichton / @matklad Any thoughts on whether that's the case?

@ehuss
Copy link
Contributor

ehuss commented Mar 27, 2018

I've noticed that since #48569 that you can't run x.py --help on a fresh checkout because of this:

# No help text depends on submodules. This check saves ~1 minute of git commands, even if
# all the submodules are present and downloaded!
if not help_triggered:
build.update_submodules()

Cargo can't build bootstrap because it is part of the workspace, and the submodules are missing.

Maybe that check is no longer necessary since #49057 has landed?

@matklad
Copy link
Member

matklad commented Mar 27, 2018

I can reproduce this on non-windows,

@Mark-Simulacrum this works for me on Linux:

~/trash
λ g clone https://github.com/rust-lang/rust                                                                                          ~/trash
Cloning into 'rust'...
remote: Counting objects: 770444, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 770444 (delta 2), reused 2 (delta 0), pack-reused 770435
Receiving objects: 100% (770444/770444), 344.99 MiB | 9.29 MiB/s, done.
Resolving deltas: 100% (622321/622321), done.

~/trash 1m 4s
λ cd rust                                                                                                                            ~/trash

~/trash/rust master
λ ./x.py build
...
Updating submodule src/tools/cargo
Submodule 'src/tools/cargo' (https://github.com/rust-lang/cargo.git) registered for path 'src/tools/cargo'
Cloning into '/home/matklad/trash/rust/src/tools/cargo'...
Submodule path 'src/tools/cargo': checked out '311a5eda6f90d660bb23e97c8ee77090519b9eda'
...

What is exactly the error are you seeing? It's hard to figure out what is from from the issue description, and I it works for me on Linux :)

@Mark-Simulacrum
Copy link
Member

@krk Could you let us know what you are seeing that goes wrong? We can't seem to reproduce (my previous comment turned out to not actually be the case).

@ollie27
Copy link
Member

ollie27 commented Mar 27, 2018

The issue occurs when running x.py --helpwith no submodules checked out:

> python x.py --help --verbose
info: Downloading and building bootstrap before processing --help
      command. See src/bootstrap/README.md for help with common
      commands.
running: C:\Source\rust_test\build\x86_64-pc-windows-msvc\stage0\bin\cargo.exe build --manifest-path C:\Source\rust_test\src/bootstrap/Cargo.toml
error: failed to read `C:\Source\rust_test\src\tools\clippy\Cargo.toml`

Caused by:
  The system cannot find the file specified. (os error 2)
Traceback (most recent call last):
  File "x.py", line 20, in <module>
    bootstrap.main()
  File "C:\Source\rust_test\src\bootstrap\bootstrap.py", line 800, in main
    bootstrap(help_triggered)
  File "C:\Source\rust_test\src\bootstrap\bootstrap.py", line 780, in bootstrap
    build.build_bootstrap()
  File "C:\Source\rust_test\src\bootstrap\bootstrap.py", line 606, in build_bootstrap
    run(args, env=env, verbose=self.verbose)
  File "C:\Source\rust_test\src\bootstrap\bootstrap.py", line 148, in run
    raise RuntimeError(err)
RuntimeError: failed to run: C:\Source\rust_test\build\x86_64-pc-windows-msvc\stage0\bin\cargo.exe build --manifest-path C:\Source\rust_test\src/bootstrap/Cargo.toml

@ollie27
Copy link
Member

ollie27 commented Apr 7, 2018

#49750 has fixed the issue of x.py --help not working without the submodules checked out so this can probably be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants