Skip to content

rustc offline build #124967

Closed as not planned
Closed as not planned
@deepa2015

Description

@deepa2015

Hello,
I'm new to RUST and the build process. Going through the documents and scripts.
It is required for us to build "rustc" offline.
Following are the steps followed

  • Do a rustc build as given in https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html

  • List all Cargo project in "https://github.com/rust-lang/rust.git ". Searched the .toml files

  • In each project, do "cargo vendor". It creates "vendor" folder.

  • Add following to .cargo/config.toml
    [net]
    offline = true
    [source.crates-io]
    replace-with = "vendored-sources"
    [source.vendored-sources]
    directory = "vendor"

  • Rebuild the project (cargo build)

  • For "rust/library/core", it was succesful. Logs are attached.
    - How to identify that the build is done offline using the prebuilt downloads from "vendor" folder?

  • The same steps are followed for rust-analyzer but get build errors. Vendoring succeeded.
    error[E0599]: no variant or associated item named InvalidPrefix found for enum TokenKind in the current scope
    --> crates/parser/src/lexed_str.rs:181:41
    |
    181 | rustc_lexer::TokenKind::InvalidPrefix | rustc_lexer::TokenKind::InvalidIdent => {
    | ^^^^^^^^^^^^^ variant or associated item not found in TokenKind

    Compiling cfg v0.0.0 (/home/deepa/work/rust-build/rust/src/tools/rust-analyzer/crates/cfg)
    For more information about this error, try rustc --explain E0599.
    ..
    rust-analyzer-build-error.log

Can "cargo vendor" be added in build script which executes post build of each project?
If it is feasible to do then can you please highlight spots in build scripts where changes can be added ? Are there any other issues that may arise ?

Thanks

core-build.log
core-cargo-vendor.log
core-carg-vendored-build.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions