Skip to content

Commit 8d8bc1a

Browse files
committed
[SOL] build-std: pull in our compiler-builtins
When -Z build-std is used, patch compiler-builtins so that our own fork is downloaded. Needed for solana-labs/solana#23465.
1 parent 49d8809 commit 8d8bc1a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/cargo/core/compiler/standard_lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::core::compiler::{CompileKind, CompileMode, RustcTargetData, Unit};
55
use crate::core::profiles::{Profiles, UnitFor};
66
use crate::core::resolver::features::{CliFeatures, FeaturesFor, ResolvedFeatures};
77
use crate::core::resolver::HasDevUnits;
8-
use crate::core::{Dependency, PackageId, PackageSet, Resolve, SourceId, Workspace};
8+
use crate::core::{Dependency, GitReference, PackageId, PackageSet, Resolve, SourceId, Workspace};
99
use crate::ops::{self, Packages};
1010
use crate::util::errors::CargoResult;
1111
use std::collections::{HashMap, HashSet};
@@ -43,14 +43,22 @@ pub fn resolve_std<'cfg>(
4343
"rustc-std-workspace-alloc",
4444
"rustc-std-workspace-std",
4545
];
46-
let patches = to_patch
46+
let mut patches = to_patch
4747
.iter()
4848
.map(|&name| {
4949
let source_path = SourceId::for_path(&src_path.join("library").join(name))?;
5050
let dep = Dependency::parse(name, None, source_path)?;
5151
Ok(dep)
5252
})
5353
.collect::<CargoResult<Vec<_>>>()?;
54+
patches.push(Dependency::parse(
55+
"compiler_builtins",
56+
None,
57+
SourceId::for_git(
58+
&("https://github.com/solana-labs/compiler-builtins".parse()).unwrap(),
59+
GitReference::Tag("bpf-tools-v1.27".to_string()),
60+
)?,
61+
)?);
5462
let crates_io_url = crate::sources::CRATES_IO_INDEX.parse().unwrap();
5563
let mut patch = HashMap::new();
5664
patch.insert(crates_io_url, patches);

0 commit comments

Comments
 (0)