@@ -6,10 +6,6 @@ use std::io::{BufRead, BufReader, BufWriter, Write};
6
6
use std:: path:: { Path , PathBuf } ;
7
7
use std:: { env, io} ;
8
8
9
- fn src_hotfix_dir ( ) -> PathBuf {
10
- Path :: new ( & env:: var_os ( "OUT_DIR" ) . unwrap ( ) ) . join ( "src-hotfix" )
11
- }
12
-
13
9
fn do_cc ( ) {
14
10
let target = env:: var ( "TARGET" ) . unwrap ( ) ;
15
11
if cfg ! ( unix) || target. contains ( "cygwin" ) {
@@ -73,15 +69,6 @@ fn do_ctest() {
73
69
}
74
70
}
75
71
76
- #[ expect( unused) ]
77
- fn ctest_old_cfg ( ) -> ctest_old:: TestGenerator {
78
- let mut cfg = ctest_old:: TestGenerator :: new ( ) ;
79
- let libc_cfgs = [ "libc_thread_local" ] ;
80
- for f in & libc_cfgs {
81
- cfg. cfg ( f, None ) ;
82
- }
83
- cfg
84
- }
85
72
fn ctest_cfg ( ) -> ctest:: TestGenerator {
86
73
let mut cfg = ctest:: TestGenerator :: new ( ) ;
87
74
cfg. skip_private ( true ) ;
@@ -170,39 +157,11 @@ fn main() {
170
157
// Avoid unnecessary re-building.
171
158
println ! ( "cargo:rerun-if-changed=build.rs" ) ;
172
159
173
- let hotfix_dir = src_hotfix_dir ( ) ;
174
- if std:: fs:: exists ( & hotfix_dir) . unwrap ( ) {
175
- std:: fs:: remove_dir_all ( & hotfix_dir) . unwrap ( ) ;
176
- }
177
-
178
- // FIXME(ctest): ctest2 cannot parse `crate::` in paths, so replace them with `::`
179
- let re = regex:: bytes:: Regex :: new ( r"(?-u:\b)crate::" ) . unwrap ( ) ;
180
- copy_dir_hotfix ( Path :: new ( "../src" ) , & hotfix_dir, & re, b"::" ) ;
181
-
182
160
do_cc ( ) ;
183
161
do_ctest ( ) ;
184
162
do_semver ( ) ;
185
163
}
186
164
187
- // FIXME(clippy): removing `replace` somehow fails the `Test tier1 (x86_64-pc-windows-msvc, windows-2022)` CI job
188
- #[ allow( clippy:: only_used_in_recursion) ]
189
- fn copy_dir_hotfix ( src : & Path , dst : & Path , regex : & regex:: bytes:: Regex , replace : & [ u8 ] ) {
190
- std:: fs:: create_dir ( dst) . unwrap ( ) ;
191
- for entry in src. read_dir ( ) . unwrap ( ) {
192
- let entry = entry. unwrap ( ) ;
193
- let src_path = entry. path ( ) ;
194
- let dst_path = dst. join ( entry. file_name ( ) ) ;
195
- if entry. file_type ( ) . unwrap ( ) . is_dir ( ) {
196
- copy_dir_hotfix ( & src_path, & dst_path, regex, replace) ;
197
- } else {
198
- // Replace "crate::" with "::"
199
- let src_data = std:: fs:: read ( & src_path) . unwrap ( ) ;
200
- let dst_data = regex. replace_all ( & src_data, b"::" ) ;
201
- std:: fs:: write ( & dst_path, & dst_data) . unwrap ( ) ;
202
- }
203
- }
204
- }
205
-
206
165
macro_rules! headers {
207
166
( $cfg: ident: [ $m: expr] : $header: literal) => {
208
167
if $m {
0 commit comments