@@ -1125,10 +1125,7 @@ export class CodeQLCliServer implements Disposable {
1125
1125
] ;
1126
1126
if ( targetDbScheme ) {
1127
1127
args . push ( "--target-dbscheme" , targetDbScheme ) ;
1128
- if (
1129
- allowDowngradesIfPossible &&
1130
- ( await this . cliConstraints . supportsDowngrades ( ) )
1131
- ) {
1128
+ if ( allowDowngradesIfPossible ) {
1132
1129
args . push ( "--allow-downgrades" ) ;
1133
1130
}
1134
1131
}
@@ -1210,10 +1207,8 @@ export class CodeQLCliServer implements Disposable {
1210
1207
if ( searchPath !== undefined ) {
1211
1208
args . push ( "--search-path" , join ( ...searchPath ) ) ;
1212
1209
}
1213
- if ( await this . cliConstraints . supportsAllowLibraryPacksInResolveQueries ( ) ) {
1214
- // All of our usage of `codeql resolve queries` needs to handle library packs.
1215
- args . push ( "--allow-library-packs" ) ;
1216
- }
1210
+ // All of our usage of `codeql resolve queries` needs to handle library packs.
1211
+ args . push ( "--allow-library-packs" ) ;
1217
1212
args . push ( suite ) ;
1218
1213
return this . runJsonCodeQlCliCommand < string [ ] > (
1219
1214
[ "resolve" , "queries" ] ,
@@ -1300,12 +1295,9 @@ export class CodeQLCliServer implements Disposable {
1300
1295
}
1301
1296
1302
1297
async generateDil ( qloFile : string , outFile : string ) : Promise < void > {
1303
- const extraArgs = ( await this . cliConstraints . supportsDecompileDil ( ) )
1304
- ? [ "--kind" , "dil" , "-o" , outFile , qloFile ]
1305
- : [ "-o" , outFile , qloFile ] ;
1306
1298
await this . runCodeQlCliCommand (
1307
1299
[ "query" , "decompile" ] ,
1308
- extraArgs ,
1300
+ [ "--kind" , "dil" , "-o" , outFile , qloFile ] ,
1309
1301
"Generating DIL" ,
1310
1302
) ;
1311
1303
}
@@ -1583,85 +1575,20 @@ export function shouldDebugCliServer() {
1583
1575
}
1584
1576
1585
1577
export class CliVersionConstraint {
1586
- /**
1587
- * CLI version where --kind=DIL was introduced
1588
- */
1589
- public static CLI_VERSION_WITH_DECOMPILE_KIND_DIL = new SemVer ( "2.3.0" ) ;
1590
-
1591
- /**
1592
- * CLI version where languages are exposed during a `codeql resolve database` command.
1593
- */
1594
- public static CLI_VERSION_WITH_LANGUAGE = new SemVer ( "2.4.1" ) ;
1595
-
1596
- public static CLI_VERSION_WITH_NONDESTURCTIVE_UPGRADES = new SemVer ( "2.4.2" ) ;
1597
-
1598
- /**
1599
- * CLI version where `codeql resolve upgrades` supports
1600
- * the `--allow-downgrades` flag
1601
- */
1602
- public static CLI_VERSION_WITH_DOWNGRADES = new SemVer ( "2.4.4" ) ;
1603
-
1604
- /**
1605
- * CLI version where the `codeql resolve qlref` command is available.
1606
- */
1607
- public static CLI_VERSION_WITH_RESOLVE_QLREF = new SemVer ( "2.5.1" ) ;
1608
-
1609
- /**
1610
- * CLI version where database registration was introduced
1611
- */
1612
- public static CLI_VERSION_WITH_DB_REGISTRATION = new SemVer ( "2.4.1" ) ;
1613
-
1614
- /**
1615
- * CLI version where the `--allow-library-packs` option to `codeql resolve queries` was
1616
- * introduced.
1617
- */
1618
- public static CLI_VERSION_WITH_ALLOW_LIBRARY_PACKS_IN_RESOLVE_QUERIES =
1619
- new SemVer ( "2.6.1" ) ;
1620
-
1621
- /**
1622
- * CLI version where the `database unbundle` subcommand was introduced.
1623
- */
1624
- public static CLI_VERSION_WITH_DATABASE_UNBUNDLE = new SemVer ( "2.6.0" ) ;
1625
-
1626
- /**
1627
- * CLI version where the `--no-precompile` option for pack creation was introduced.
1628
- */
1629
- public static CLI_VERSION_WITH_NO_PRECOMPILE = new SemVer ( "2.7.1" ) ;
1630
-
1631
- /**
1632
- * CLI version where remote queries (variant analysis) are supported.
1633
- */
1634
- public static CLI_VERSION_REMOTE_QUERIES = new SemVer ( "2.6.3" ) ;
1635
-
1636
1578
/**
1637
1579
* CLI version where building QLX packs for remote queries is supported.
1638
1580
* (The options were _accepted_ by a few earlier versions, but only from
1639
1581
* 2.11.3 will it actually use the existing compilation cache correctly).
1640
1582
*/
1641
1583
public static CLI_VERSION_QLX_REMOTE = new SemVer ( "2.11.3" ) ;
1642
1584
1643
- /**
1644
- * CLI version where the `resolve ml-models` subcommand was introduced.
1645
- */
1646
- public static CLI_VERSION_WITH_RESOLVE_ML_MODELS = new SemVer ( "2.7.3" ) ;
1647
-
1648
1585
/**
1649
1586
* CLI version where the `resolve ml-models` subcommand was enhanced to work with packaging.
1650
1587
*/
1651
1588
public static CLI_VERSION_WITH_PRECISE_RESOLVE_ML_MODELS = new SemVer (
1652
1589
"2.10.0" ,
1653
1590
) ;
1654
1591
1655
- /**
1656
- * CLI version where the `--old-eval-stats` option to the query server was introduced.
1657
- */
1658
- public static CLI_VERSION_WITH_OLD_EVAL_STATS = new SemVer ( "2.7.4" ) ;
1659
-
1660
- /**
1661
- * CLI version where packaging was introduced.
1662
- */
1663
- public static CLI_VERSION_WITH_PACKAGING = new SemVer ( "2.6.0" ) ;
1664
-
1665
1592
/**
1666
1593
* CLI version where the `--evaluator-log` and related options to the query server were introduced,
1667
1594
* on a per-query server basis.
@@ -1702,94 +1629,16 @@ export class CliVersionConstraint {
1702
1629
return ( await this . cli . getVersion ( ) ) . compare ( v ) >= 0 ;
1703
1630
}
1704
1631
1705
- public async supportsDecompileDil ( ) {
1706
- return this . isVersionAtLeast (
1707
- CliVersionConstraint . CLI_VERSION_WITH_DECOMPILE_KIND_DIL ,
1708
- ) ;
1709
- }
1710
-
1711
- public async supportsLanguageName ( ) {
1712
- return this . isVersionAtLeast (
1713
- CliVersionConstraint . CLI_VERSION_WITH_LANGUAGE ,
1714
- ) ;
1715
- }
1716
-
1717
- public async supportsNonDestructiveUpgrades ( ) {
1718
- return this . isVersionAtLeast (
1719
- CliVersionConstraint . CLI_VERSION_WITH_NONDESTURCTIVE_UPGRADES ,
1720
- ) ;
1721
- }
1722
-
1723
- public async supportsDowngrades ( ) {
1724
- return this . isVersionAtLeast (
1725
- CliVersionConstraint . CLI_VERSION_WITH_DOWNGRADES ,
1726
- ) ;
1727
- }
1728
-
1729
- public async supportsResolveQlref ( ) {
1730
- return this . isVersionAtLeast (
1731
- CliVersionConstraint . CLI_VERSION_WITH_RESOLVE_QLREF ,
1732
- ) ;
1733
- }
1734
-
1735
- public async supportsAllowLibraryPacksInResolveQueries ( ) {
1736
- return this . isVersionAtLeast (
1737
- CliVersionConstraint . CLI_VERSION_WITH_ALLOW_LIBRARY_PACKS_IN_RESOLVE_QUERIES ,
1738
- ) ;
1739
- }
1740
-
1741
- async supportsDatabaseRegistration ( ) {
1742
- return this . isVersionAtLeast (
1743
- CliVersionConstraint . CLI_VERSION_WITH_DB_REGISTRATION ,
1744
- ) ;
1745
- }
1746
-
1747
- async supportsDatabaseUnbundle ( ) {
1748
- return this . isVersionAtLeast (
1749
- CliVersionConstraint . CLI_VERSION_WITH_DATABASE_UNBUNDLE ,
1750
- ) ;
1751
- }
1752
-
1753
- async supportsNoPrecompile ( ) {
1754
- return this . isVersionAtLeast (
1755
- CliVersionConstraint . CLI_VERSION_WITH_NO_PRECOMPILE ,
1756
- ) ;
1757
- }
1758
-
1759
- async supportsRemoteQueries ( ) {
1760
- return this . isVersionAtLeast (
1761
- CliVersionConstraint . CLI_VERSION_REMOTE_QUERIES ,
1762
- ) ;
1763
- }
1764
-
1765
1632
async supportsQlxRemote ( ) {
1766
1633
return this . isVersionAtLeast ( CliVersionConstraint . CLI_VERSION_QLX_REMOTE ) ;
1767
1634
}
1768
1635
1769
- async supportsResolveMlModels ( ) {
1770
- return this . isVersionAtLeast (
1771
- CliVersionConstraint . CLI_VERSION_WITH_RESOLVE_ML_MODELS ,
1772
- ) ;
1773
- }
1774
-
1775
1636
async supportsPreciseResolveMlModels ( ) {
1776
1637
return this . isVersionAtLeast (
1777
1638
CliVersionConstraint . CLI_VERSION_WITH_PRECISE_RESOLVE_ML_MODELS ,
1778
1639
) ;
1779
1640
}
1780
1641
1781
- async supportsOldEvalStats ( ) {
1782
- return this . isVersionAtLeast (
1783
- CliVersionConstraint . CLI_VERSION_WITH_OLD_EVAL_STATS ,
1784
- ) ;
1785
- }
1786
-
1787
- async supportsPackaging ( ) {
1788
- return this . isVersionAtLeast (
1789
- CliVersionConstraint . CLI_VERSION_WITH_PACKAGING ,
1790
- ) ;
1791
- }
1792
-
1793
1642
async supportsStructuredEvalLog ( ) {
1794
1643
return this . isVersionAtLeast (
1795
1644
CliVersionConstraint . CLI_VERSION_WITH_STRUCTURED_EVAL_LOG ,
0 commit comments