@@ -44,8 +44,7 @@ fn build(
44
44
let dst = rustlib. parent ( ) . join ( "lib" ) ;
45
45
util:: mkdir ( & dst) ?;
46
46
47
- build_libcore ( cmode, & ctoml, home, src, & dst, verbose) ?;
48
- build_liballoc ( cmode, & ctoml, home, src, & dst, config, verbose) ?;
47
+ build_liballoc ( cmode, & ctoml, src, & dst, config, verbose) ?;
49
48
50
49
// Create hash file
51
50
util:: write ( & rustlib. parent ( ) . join ( ".hash" ) , & hash. to_string ( ) ) ?;
@@ -58,7 +57,6 @@ fn build_crate(
58
57
mut stoml : String ,
59
58
cmode : & CompilationMode ,
60
59
ctoml : & cargo:: Toml ,
61
- home : & Home ,
62
60
dst : & Path ,
63
61
verbose : bool ,
64
62
) -> Result < ( ) > {
@@ -113,7 +111,6 @@ fn build_crate(
113
111
}
114
112
115
113
cmd. arg ( "--" ) ;
116
- cmd. env ( "RUSTFLAGS" , & format ! ( "--sysroot {}" , home. display( ) ) ) ;
117
114
cmd. arg ( "-Z" ) ;
118
115
cmd. arg ( "force-unstable-if-unmarked" ) ;
119
116
@@ -131,39 +128,9 @@ fn build_crate(
131
128
Ok ( ( ) )
132
129
}
133
130
134
- fn build_libcore (
135
- cmode : & CompilationMode ,
136
- ctoml : & cargo:: Toml ,
137
- home : & Home ,
138
- src : & Src ,
139
- dst : & Path ,
140
- verbose : bool ,
141
- ) -> Result < ( ) > {
142
- const TOML : & ' static str = r#"
143
- [package]
144
- authors = ["The Rust Project Developers"]
145
- name = "sysroot"
146
- version = "0.0.0"
147
- "# ;
148
-
149
- let mut stoml = TOML . to_owned ( ) ;
150
-
151
- let path = src. path ( ) . join ( "libcore" ) . display ( ) . to_string ( ) ;
152
- let mut core_dep = Table :: new ( ) ;
153
- core_dep. insert ( "path" . to_owned ( ) , Value :: String ( path) ) ;
154
- let mut deps = Table :: new ( ) ;
155
- deps. insert ( "core" . to_owned ( ) , Value :: Table ( core_dep) ) ;
156
- let mut map = Table :: new ( ) ;
157
- map. insert ( "dependencies" . to_owned ( ) , Value :: Table ( deps) ) ;
158
- stoml. push_str ( & Value :: Table ( map) . to_string ( ) ) ;
159
-
160
- build_crate ( "core" , stoml, cmode, ctoml, home, dst, verbose)
161
- }
162
-
163
131
fn build_liballoc (
164
132
cmode : & CompilationMode ,
165
133
ctoml : & cargo:: Toml ,
166
- home : & Home ,
167
134
src : & Src ,
168
135
dst : & Path ,
169
136
config : & Config ,
@@ -182,9 +149,18 @@ version = "0.1.0"
182
149
let mut stoml = TOML . to_owned ( ) ;
183
150
184
151
if config. memcpy {
185
- stoml. push_str ( "features = [\" mem\" ]\n " ) ;
152
+ stoml. push_str ( "features = [\" mem\" , \" core\" ]\n " ) ;
153
+ } else {
154
+ stoml. push_str ( "features = [\" rustc-std-workspace-core\" ]\n " ) ;
186
155
}
187
156
157
+ stoml. push_str ( "[dependencies.core]\n " ) ;
158
+ stoml. push_str ( & format ! ( "path = \" {}\" \n " , src. path( ) . join( "libcore" ) . display( ) ) ) ;
159
+
160
+ stoml. push_str ( "[patch.crates-io.rustc-std-workspace-core]\n " ) ;
161
+ stoml. push_str ( & format ! ( "path = '{}'\n " ,
162
+ src. path( ) . join( "tools/rustc-std-workspace-core" ) . display( ) ) ) ;
163
+
188
164
let path = src. path ( ) . join ( "liballoc/lib.rs" ) . display ( ) . to_string ( ) ;
189
165
let mut map = Table :: new ( ) ;
190
166
let mut lib = Table :: new ( ) ;
@@ -193,7 +169,7 @@ version = "0.1.0"
193
169
map. insert ( "lib" . to_owned ( ) , Value :: Table ( lib) ) ;
194
170
stoml. push_str ( & Value :: Table ( map) . to_string ( ) ) ;
195
171
196
- build_crate ( "alloc" , stoml, cmode, ctoml, home , dst, verbose)
172
+ build_crate ( "alloc" , stoml, cmode, ctoml, dst, verbose)
197
173
}
198
174
199
175
fn old_hash ( cmode : & CompilationMode , home : & Home ) -> Result < Option < u64 > > {
0 commit comments