Skip to content

Building rustc-1.84.0 tarball fails with git error "fatal: --local can only be used inside a git repository" #135358

@etna

Description

@etna

I am trying to build the official tarball on Linux and it fails with the following error:

Finished `dev` profile [unoptimized] target(s) in 0.70s
fatal: --local can only be used inside a git repository
fatal: not a git repository (or any of the parent directories): .git
thread 'main' panicked at src/core/config/config.rs:2908:89:
called `Result::unwrap()` on an `Err` value: "command did not execute successfully: cd \"/home/builder/Tmpdir/rustc-1.84.0-src\" && \"git\" \"rev-list\" \"--author=bors@rust-lang.org\" \"-n1\" \"--first-parent\" \"HEAD\"\nexpected success, got: exit status: 128\n"
stack backtrace:
   0:     0x556f85b3c316 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::ha954892228d36427
   1:     0x556f85b64203 - core::fmt::write::h57d13a959b226250
   2:     0x556f85b181df - std::io::Write::write_fmt::h14c9ac269063afe6
   3:     0x556f85b3c1b3 - std::sys::backtrace::BacktraceLock::print::hf969c1fd7e824e94
   4:     0x556f85b290ad - std::panicking::default_hook::{{closure}}::h45647cb6a8d1ea15
   5:     0x556f85b28ec2 - std::panicking::default_hook::h2dcc389a6edb8d15
   6:     0x556f85b29533 - std::panicking::rust_panic_with_hook::h243558d255d6afd1
   7:     0x556f85b3c6da - std::panicking::begin_panic_handler::{{closure}}::h17209e01ce2aa329
   8:     0x556f85b3c519 - std::sys::backtrace::__rust_end_short_backtrace::hbeff08fd2d23fd72
   9:     0x556f85b2914c - rust_begin_unwind
  10:     0x556f84e06220 - core::panicking::panic_fmt::h600b93cf9acabfc7
  11:     0x556f84e06bb6 - core::result::unwrap_failed::hd0f0a7f7f80f29eb
  12:     0x556f84e5abdd - core::result::Result<T,E>::unwrap::hdcce4d4cbb4ca39f
                               at /home/builder/Tmpdir/rustc-1.83.0-src/library/core/src/result.rs:1104:23
  13:     0x556f84e5abdd - bootstrap::core::config::config::Config::last_modified_commit::h0e5bf6b59b9537e9
                               at /home/builder/Tmpdir/rustc-1.84.0-src/src/bootstrap/src/core/config/config.rs:2908:22
  14:     0x556f84e5a266 - bootstrap::core::config::config::Config::download_ci_rustc_commit::h6e7a14b43ced4064
                               at /home/builder/Tmpdir/rustc-1.84.0-src/src/bootstrap/src/core/config/config.rs:2820:28
  15:     0x556f8514e8c2 - bootstrap::core::config::config::Config::parse_inner::ha7f9a830d56f200a
                               at /home/builder/Tmpdir/rustc-1.84.0-src/src/bootstrap/src/core/config/config.rs:1775:17
  16:     0x556f84e555ad - bootstrap::core::config::config::Config::parse::h294bff55ae4cccc9
                               at /home/builder/Tmpdir/rustc-1.84.0-src/src/bootstrap/src/core/config/config.rs:1305:9
  17:     0x556f84e0c42c - bootstrap::main::he2af89d8870d09bd
                               at /home/builder/Tmpdir/rustc-1.84.0-src/src/bootstrap/src/bin/main.rs:27:18
  18:     0x556f84e084a3 - core::ops::function::FnOnce::call_once::haf58ca782caa1c52
                               at /home/builder/Tmpdir/rustc-1.83.0-src/library/core/src/ops/function.rs:250:5
  19:     0x556f84e10966 - std::sys::backtrace::__rust_begin_short_backtrace::h173f508882ed3517
                               at /home/builder/Tmpdir/rustc-1.83.0-src/library/std/src/sys/backtrace.rs:154:18
  20:     0x556f84e072a9 - std::rt::lang_start::{{closure}}::h41c6084881d81864
                               at /home/builder/Tmpdir/rustc-1.83.0-src/library/std/src/rt.rs:195:18
  21:     0x556f85b26a80 - std::rt::lang_start_internal::hec001d8d383763ba
  22:     0x556f84e07287 - std::rt::lang_start::hbc106bd9b8bea089
                               at /home/builder/Tmpdir/rustc-1.83.0-src/library/std/src/rt.rs:194:17
  23:     0x556f84e0ee4e - main
  24:     0x149dee2bd1ca - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  25:     0x149dee2bd285 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  26:     0x556f84e06bf1 - _start
  27:                0x0 - <unknown>
Build completed unsuccessfully in 0:03:01

Using the same config.toml file on the tarball for rustc 1.83 works with no problems, so this seems to be limited to the 1.84 tarball. Please kindly assist, thank you.

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Jan 11, 2025
added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
C-bugCategory: This is a bug.
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Jan 11, 2025
Noratrieb

Noratrieb commented on Jan 11, 2025

@Noratrieb
Member

what's your config.toml?

Noratrieb

Noratrieb commented on Jan 11, 2025

@Noratrieb
Member

I see the one from @truboxl backlinked from termux: https://github.com/termux/termux-packages/blob/0366d87f0e811efadd6de798cbc8220c216d2faa/packages/rust/config.toml#L4

You need to set profile = "dist" at the top to get a configuration that properly works for building (which is set automatically by ./configure). The dist profile disables download-rustc, whose logic is only intended to be used in a Git repository.

added a commit that references this issue on Jan 11, 2025
onur-ozkan

onur-ozkan commented on Jan 11, 2025

@onur-ozkan
Member

We shouldn't allow using "if-unchanged" on non-git sources.

Noratrieb

Noratrieb commented on Jan 11, 2025

@Noratrieb
Member

Maybe it would also be good to force people to set profile = "dist" in non-git sources? Relying on the config instead of whether it's Git or not seems more reliable and less prone to mistakes. (nice errors would be cool of course)

onur-ozkan

onur-ozkan commented on Jan 11, 2025

@onur-ozkan
Member

I think that wouldn't be enough as can simply override the defaults.

jyn514

jyn514 commented on Jan 11, 2025

@jyn514
Member

defaulting to (but not forcing) profile = dist in non-git sources seems like a good change. i agree with onur that we should additionally add a helpful error when combining download-* with non-git sources.

etna

etna commented on Jan 12, 2025

@etna
Author

Adding profile = "dist" results in a successful build, thank you very much.

I am fine with manually declaring profile = "dist" in my config.toml if it is clearly stated and described in the tarball's config.toml.example

etna

etna commented on Jan 12, 2025

@etna
Author

Sorry, closed by mistake; please re-open if needed.

18 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @cuviper@etna@xry111@jyn514@jieyouxu

    Issue actions

      Building rustc-1.84.0 tarball fails with git error "fatal: --local can only be used inside a git repository" · Issue #135358 · rust-lang/rust