@@ -1125,10 +1125,7 @@ export class CodeQLCliServer implements Disposable {
11251125 ] ;
11261126 if ( targetDbScheme ) {
11271127 args . push ( "--target-dbscheme" , targetDbScheme ) ;
1128- if (
1129- allowDowngradesIfPossible &&
1130- ( await this . cliConstraints . supportsDowngrades ( ) )
1131- ) {
1128+ if ( allowDowngradesIfPossible ) {
11321129 args . push ( "--allow-downgrades" ) ;
11331130 }
11341131 }
@@ -1210,10 +1207,8 @@ export class CodeQLCliServer implements Disposable {
12101207 if ( searchPath !== undefined ) {
12111208 args . push ( "--search-path" , join ( ...searchPath ) ) ;
12121209 }
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" ) ;
12171212 args . push ( suite ) ;
12181213 return this . runJsonCodeQlCliCommand < string [ ] > (
12191214 [ "resolve" , "queries" ] ,
@@ -1300,12 +1295,9 @@ export class CodeQLCliServer implements Disposable {
13001295 }
13011296
13021297 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 ] ;
13061298 await this . runCodeQlCliCommand (
13071299 [ "query" , "decompile" ] ,
1308- extraArgs ,
1300+ [ "--kind" , "dil" , "-o" , outFile , qloFile ] ,
13091301 "Generating DIL" ,
13101302 ) ;
13111303 }
@@ -1583,85 +1575,20 @@ export function shouldDebugCliServer() {
15831575}
15841576
15851577export 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-
16361578 /**
16371579 * CLI version where building QLX packs for remote queries is supported.
16381580 * (The options were _accepted_ by a few earlier versions, but only from
16391581 * 2.11.3 will it actually use the existing compilation cache correctly).
16401582 */
16411583 public static CLI_VERSION_QLX_REMOTE = new SemVer ( "2.11.3" ) ;
16421584
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-
16481585 /**
16491586 * CLI version where the `resolve ml-models` subcommand was enhanced to work with packaging.
16501587 */
16511588 public static CLI_VERSION_WITH_PRECISE_RESOLVE_ML_MODELS = new SemVer (
16521589 "2.10.0" ,
16531590 ) ;
16541591
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-
16651592 /**
16661593 * CLI version where the `--evaluator-log` and related options to the query server were introduced,
16671594 * on a per-query server basis.
@@ -1702,94 +1629,16 @@ export class CliVersionConstraint {
17021629 return ( await this . cli . getVersion ( ) ) . compare ( v ) >= 0 ;
17031630 }
17041631
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-
17651632 async supportsQlxRemote ( ) {
17661633 return this . isVersionAtLeast ( CliVersionConstraint . CLI_VERSION_QLX_REMOTE ) ;
17671634 }
17681635
1769- async supportsResolveMlModels ( ) {
1770- return this . isVersionAtLeast (
1771- CliVersionConstraint . CLI_VERSION_WITH_RESOLVE_ML_MODELS ,
1772- ) ;
1773- }
1774-
17751636 async supportsPreciseResolveMlModels ( ) {
17761637 return this . isVersionAtLeast (
17771638 CliVersionConstraint . CLI_VERSION_WITH_PRECISE_RESOLVE_ML_MODELS ,
17781639 ) ;
17791640 }
17801641
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-
17931642 async supportsStructuredEvalLog ( ) {
17941643 return this . isVersionAtLeast (
17951644 CliVersionConstraint . CLI_VERSION_WITH_STRUCTURED_EVAL_LOG ,
0 commit comments