Building Chromium for Mac - aarch64-apple-darwin lib not found

277 views
Skip to first unread message

Gaurav Kungwani

unread,
Aug 30, 2023, 3:55:44 PM8/30/23
to Chromium-dev

While building chromium in my local following this article - https://github.com/chromium/chromium/blob/main/docs/mac_build_instructions.md

I encountered this error while executing "autoninja -C out/Default chrome" command given in the instructions.

FileNotFoundError: [Errno 2] No such file or directory: '/Users/gauravk/Documents/chromium/src/third_party/rust-toolchain/lib/rustlib/aarch64-apple-darwin/lib' [21/38436] ACTION //components/flags_ui/resources:build_ts(//build/toolchain/mac:clang_arm64)

I am not sure how do I change something that is coming from chromium git itself, I mean the source code.

I tried installing Rust in my Mac.

> rustc --version 

 rustc 1.71.1 

Yeah, I do have ~/.cargo/bin in the path.

Also, I saw this article https://github.com/rust-lang/rust/issues/82222, but I have already installed the latest Xcode 14 installed.

Also, I followed this article https://github.com/rust-lang/rustup/issues/2413#issuecomment-733998798 - still the same error

Also tried to specify target_cpu='arm64' in args.gn file (src/out/default/args.gn)


Gaurav Kungwani

unread,
Aug 30, 2023, 3:59:28 PM8/30/23
to Chromium-dev

While building chromium in my local following this article - https://github.com/chromium/chromium/blob/main/docs/mac_build_instructions.md

I encountered this error while executing "autoninja -C out/Default chrome" command given in the instructions.

FileNotFoundError: [Errno 2] No such file or directory: '/Users/gauravk/Documents/chromium/src/third_party/rust-toolchain/lib/rustlib/aarch64-apple-darwin/lib' [21/38436] ACTION //components/flags_ui/resources:build_ts(//build/toolchain/mac:clang_arm64)

I tried various ways. The code I got from "fetch chromium" command is not having this "aarch64-apple-darwin" folder instead it has "x86_64-apple-darwin" folder in "Users/gauravk/Documents/chromium/src/third_party/rust-toolchain/lib/rustlib/" 

I am not sure how do I change something that is coming from chromium git itself, i mean the source code.

I tried installing Rust in my Mac. ~ rustc --version ~ rustc 1.71.1

Yeah, I do have /.cargo/bin in the path.

Also, I saw this article https://github.com/rust-lang/rust/issues/82222, but I have already installed latest xcode 14 installed.


Also, I followed this article https://github.com/rust-lang/rustup/issues/2413#issuecomment-733998798 - still the same error


I tried adding target_cpu = "arm64" - error not going. 


Adam Norberg

unread,
Aug 30, 2023, 4:20:35 PM8/30/23
to Chromium-dev, Gaurav Kungwani
The vast majority of the time I see errors like that, it's fixed with gclient sync -D

Kevin Conley

unread,
Sep 28, 2023, 7:59:45 PM9/28/23
to Chromium-dev, Adam Norberg, Gaurav Kungwani
I ran into this error as well, and I found some additional instructions about building with Rust support in `src/docs/rust.md`. Since I don't personally need to build with Rust, I added `enable_rust = false` to my gn args to work around this error and build Chromium for ARM successfully on my M2 Mac, but it sounds like if you want to build with Rust support you might need to additionally set the `rust_sysroot_absolute` and `rustc_version` gn args to teach it about your manually/externally-installed Rust toolchain.
Reply all
Reply to author
Forward
0 new messages