Skip to content

Commit

Permalink
cargo: Do not download platform2 by default
Browse files Browse the repository at this point in the history
Cargo tries to download dependencies even if it's optional.
Stub it to stop download the platform2 repository.

See also upstream bug:
rust-lang/cargo#4544

BUG=None
TEST=audio-qv

Change-Id: If5e66313d3ed688a940843b6bff627ed23232bf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/4622503
Commit-Queue: Li-Yu Yu <aaronyu@google.com>
Tested-by: ChromeOS Audio Quick Verifier <audio-qv@chromeos-audio-qv.iam.gserviceaccount.com>
Tested-by: chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com <chromeos-cop-builder@chromeos-cop.iam.gserviceaccount.com>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
  • Loading branch information
afq984 authored and Chromeos LUCI committed Jun 20, 2023
1 parent 00db84e commit d5bb7ac
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 57 deletions.
2 changes: 1 addition & 1 deletion Cargo.Bazel.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "6a8dda70d6281ab460a2fe29586969fe860154c9960e091625a16084dbf11694",
"checksum": "94543ee1647ad50697832b07a6b3ec89bda67c736fa2d45100aa019e9fbb4487",
"crates": {
"aho-corasick 0.7.20": {
"name": "aho-corasick",
Expand Down
54 changes: 1 addition & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ audio_processor = { path = "audio_processor" }
cras = { path = "cras/src/server/rust" }
cras_dlc = { path = "cras/src/server/rust/cras_dlc" }

system_api = { git = "https://chromium.googlesource.com/chromiumos/platform2", version = ">=0.24.53" } # ignored by ebuild
# Replace the above with the below when making testing in-repo changes in chroot.
#system_api = { path = "../../platform2/system_api" } # ignored by ebuild
# When building out of ChromiumOS, we do not actually use system_api.
# Stub it to avoid downloading the platform2 repository.
# See also: https://github.com/rust-lang/cargo/issues/4544
system_api = { path = "repositories/system_api_stub" } # ignored by ebuild
# Replace the above with the below when testing with ChromiumOS features.
# For out of chroot using TOT platform2:
# system_api = { git = "https://chromium.googlesource.com/chromiumos/platform2", version = ">=0.24.53" } # ignored by ebuild
# For testing in-repo changes in chroot:
# system_api = { path = "../../platform2/system_api" } # ignored by ebuild
5 changes: 5 additions & 0 deletions repositories/system_api_stub/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[package]
name = "system_api"
version = "0.24.53"
authors = ["The ChromiumOS Authors"]
edition = "2021"
3 changes: 3 additions & 0 deletions repositories/system_api_stub/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Copyright 2023 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

0 comments on commit d5bb7ac

Please sign in to comment.