@@ -15,7 +15,6 @@ use semver::Version;
15
15
use shared:: auto_completions:: { Completions , generate_completions} ;
16
16
use std:: cell:: RefCell ;
17
17
use std:: ffi:: OsString ;
18
- use std:: process:: Command ;
19
18
use std:: sync:: Arc ;
20
19
use std:: { fs, num:: NonZeroU32 , thread:: available_parallelism} ;
21
20
use tokio:: runtime:: Builder ;
@@ -25,7 +24,6 @@ pub mod block_number_map;
25
24
mod clean;
26
25
mod combine_configs;
27
26
mod compatibility_check;
28
- mod init;
29
27
mod new;
30
28
mod profile_validation;
31
29
pub mod run_tests;
@@ -36,12 +34,9 @@ mod warn;
36
34
37
35
pub const CAIRO_EDITION : & str = "2024_07" ;
38
36
39
- const MINIMAL_RUST_VERSION : Version = Version :: new ( 1 , 87 , 0 ) ;
40
- const MINIMAL_SCARB_VERSION : Version = Version :: new ( 2 , 9 , 1 ) ;
41
- const MINIMAL_RECOMMENDED_SCARB_VERSION : Version = Version :: new ( 2 , 10 , 0 ) ;
42
- const MINIMAL_SCARB_VERSION_PREBUILT_PLUGIN : Version = Version :: new ( 2 , 10 , 0 ) ;
37
+ const MINIMAL_SCARB_VERSION : Version = Version :: new ( 2 , 10 , 0 ) ;
38
+ const MINIMAL_RECOMMENDED_SCARB_VERSION : Version = Version :: new ( 2 , 10 , 1 ) ;
43
39
const MINIMAL_USC_VERSION : Version = Version :: new ( 2 , 0 , 0 ) ;
44
- const MINIMAL_SCARB_VERSION_FOR_SIERRA_GAS : Version = Version :: new ( 2 , 10 , 0 ) ;
45
40
// TODO(#3723) Bump `MINIMAL_SNFORGE_STD_VERSION` to 0.50.0 and `MINIMAL_SNFORGE_STD_DEPRECATED_VERSION` to 0.50.0
46
41
const MINIMAL_SNFORGE_STD_VERSION : Version = Version :: new ( 0 , 48 , 0 ) ;
47
42
const MINIMAL_SNFORGE_STD_DEPRECATED_VERSION : Version = Version :: new ( 0 , 48 , 0 ) ;
@@ -91,11 +86,6 @@ enum ForgeSubcommand {
91
86
#[ command( flatten) ]
92
87
args : TestArgs ,
93
88
} ,
94
- /// Create a new directory with a Forge project
95
- Init {
96
- /// Name of a new project
97
- name : String ,
98
- } ,
99
89
/// Create a new Forge project at <PATH>
100
90
New {
101
91
#[ command( flatten) ]
@@ -278,10 +268,6 @@ pub fn main_execution(ui: Arc<UI>) -> Result<ExitStatus> {
278
268
let cli = Cli :: parse ( ) ;
279
269
280
270
match cli. subcommand {
281
- ForgeSubcommand :: Init { name } => {
282
- init:: init ( name. as_str ( ) , & ui) ?;
283
- Ok ( ExitStatus :: Success )
284
- }
285
271
ForgeSubcommand :: New { args } => {
286
272
new:: new ( args) ?;
287
273
Ok ( ExitStatus :: Success )
@@ -302,7 +288,7 @@ pub fn main_execution(ui: Arc<UI>) -> Result<ExitStatus> {
302
288
Ok ( ExitStatus :: Success )
303
289
}
304
290
ForgeSubcommand :: Test { args } => {
305
- check_requirements ( false , args . tracked_resource , & ui) ?;
291
+ check_requirements ( false , & ui) ?;
306
292
let cores = if let Ok ( available_cores) = available_parallelism ( ) {
307
293
available_cores. get ( )
308
294
} else {
@@ -318,7 +304,7 @@ pub fn main_execution(ui: Arc<UI>) -> Result<ExitStatus> {
318
304
rt. block_on ( run_for_workspace ( args, ui) )
319
305
}
320
306
ForgeSubcommand :: CheckRequirements => {
321
- check_requirements ( true , ForgeTrackedResource :: default ( ) , & ui) ?;
307
+ check_requirements ( true , & ui) ?;
322
308
Ok ( ExitStatus :: Success )
323
309
}
324
310
ForgeSubcommand :: Completions ( completions) => {
@@ -339,41 +325,18 @@ pub fn main_execution(ui: Arc<UI>) -> Result<ExitStatus> {
339
325
}
340
326
}
341
327
342
- fn check_requirements (
343
- output_on_success : bool ,
344
- forge_tracked_resource : ForgeTrackedResource ,
345
- ui : & UI ,
346
- ) -> Result < ( ) > {
328
+ fn check_requirements ( output_on_success : bool , ui : & UI ) -> Result < ( ) > {
347
329
let mut requirements_checker = RequirementsChecker :: new ( output_on_success) ;
348
- match forge_tracked_resource {
349
- ForgeTrackedResource :: CairoSteps => {
350
- requirements_checker. add_requirement ( Requirement {
351
- name : "Scarb" . to_string ( ) ,
352
- command : RefCell :: new ( ScarbCommand :: new ( ) . arg ( "--version" ) . command ( ) ) ,
353
- minimal_version : MINIMAL_SCARB_VERSION ,
354
- minimal_recommended_version : Some ( MINIMAL_RECOMMENDED_SCARB_VERSION ) ,
355
- helper_text :
356
- "Follow instructions from https://docs.swmansion.com/scarb/download.html"
357
- . to_string ( ) ,
358
- version_parser : create_version_parser (
359
- "Scarb" ,
360
- r"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)" ,
361
- ) ,
362
- } ) ;
363
- }
364
- ForgeTrackedResource :: SierraGas => {
365
- requirements_checker. add_requirement ( Requirement {
366
- name : "Scarb" . to_string ( ) ,
367
- command : RefCell :: new ( ScarbCommand :: new ( ) . arg ( "--version" ) . command ( ) ) ,
368
- minimal_version : MINIMAL_SCARB_VERSION_FOR_SIERRA_GAS ,
369
- minimal_recommended_version : None ,
370
- helper_text : format ! ( "To track sierra gas, minimal required scarb version is {MINIMAL_SCARB_VERSION_FOR_SIERRA_GAS} \
371
- (it comes with sierra >= 1.7.0 support)\n \
372
- Follow instructions from https://docs.swmansion.com/scarb/download.html") ,
373
- version_parser : create_version_parser ( "Scarb" , r"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)" ) ,
374
- } ) ;
375
- }
376
- }
330
+ requirements_checker. add_requirement ( Requirement {
331
+ name : "Scarb" . to_string ( ) ,
332
+ command : RefCell :: new ( ScarbCommand :: new ( ) . arg ( "--version" ) . command ( ) ) ,
333
+ minimal_version : MINIMAL_SCARB_VERSION ,
334
+ minimal_recommended_version : Some ( MINIMAL_RECOMMENDED_SCARB_VERSION ) ,
335
+ helper_text : "Follow instructions from https://docs.swmansion.com/scarb/download.html"
336
+ . to_string ( ) ,
337
+ version_parser : create_version_parser ( "Scarb" , r"scarb (?<version>[0-9]+.[0-9]+.[0-9]+)" ) ,
338
+ } ) ;
339
+
377
340
requirements_checker. add_requirement ( Requirement {
378
341
name : "Universal Sierra Compiler" . to_string ( ) ,
379
342
command : RefCell :: new ( UniversalSierraCompilerCommand :: new ( ) . arg ( "--version" ) . command ( ) ) ,
@@ -387,28 +350,5 @@ fn check_requirements(
387
350
} ) ;
388
351
requirements_checker. check ( ui) ?;
389
352
390
- let scarb_version = ScarbCommand :: version ( ) . run ( ) ?. scarb ;
391
- if scarb_version < MINIMAL_SCARB_VERSION_PREBUILT_PLUGIN {
392
- let mut requirements_checker = RequirementsChecker :: new ( output_on_success) ;
393
- requirements_checker. add_requirement ( Requirement {
394
- name : "Rust" . to_string ( ) ,
395
- command : RefCell :: new ( {
396
- let mut cmd = Command :: new ( "rustc" ) ;
397
- cmd. arg ( "--version" ) ;
398
- cmd
399
- } ) ,
400
- minimal_version : MINIMAL_RUST_VERSION ,
401
- minimal_recommended_version : None ,
402
- version_parser : create_version_parser (
403
- "Rust" ,
404
- r"rustc (?<version>[0-9]+.[0-9]+.[0-9]+)" ,
405
- ) ,
406
- helper_text : "Follow instructions from https://www.rust-lang.org/tools/install"
407
- . to_string ( ) ,
408
- } ) ;
409
-
410
- requirements_checker. check ( ui) ?;
411
- }
412
-
413
353
Ok ( ( ) )
414
354
}
0 commit comments