File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 22
33use std:: {
44 collections:: HashMap ,
5+ str:: FromStr ,
56 sync:: { LazyLock , Mutex } ,
67} ;
78
89use revive_dt_common:: types:: VersionOrRequirement ;
910
10- use semver:: Version ;
11+ use semver:: { Version , VersionReq } ;
1112use sha2:: { Digest , Sha256 } ;
1213
1314use crate :: list:: List ;
@@ -65,6 +66,9 @@ impl SolcDownloader {
6566 target : & ' static str ,
6667 list : & ' static str ,
6768 ) -> anyhow:: Result < Self > {
69+ static MAXIMUM_COMPILER_VERSION_REQUIREMENT : LazyLock < VersionReq > =
70+ LazyLock :: new ( || VersionReq :: from_str ( "<=0.8.30" ) . unwrap ( ) ) ;
71+
6872 let version_or_requirement = version. into ( ) ;
6973 match version_or_requirement {
7074 VersionOrRequirement :: Version ( version) => Ok ( Self {
@@ -79,7 +83,10 @@ impl SolcDownloader {
7983 . builds
8084 . into_iter ( )
8185 . map ( |build| build. version )
82- . filter ( |version| requirement. matches ( version) )
86+ . filter ( |version| {
87+ MAXIMUM_COMPILER_VERSION_REQUIREMENT . matches ( version)
88+ && requirement. matches ( version)
89+ } )
8390 . max ( )
8491 else {
8592 anyhow:: bail!( "Failed to find a version that satisfies {requirement:?}" ) ;
You can’t perform that action at this time.
0 commit comments