@@ -7,7 +7,8 @@ import type { PackageVariant } from '../config';
77import { getDistro , getArch } from '../config' ;
88
99export async function downloadCryptLibrary (
10- variant : PackageVariant | 'host'
10+ variant : PackageVariant | 'host' ,
11+ versionSpec = ''
1112) : Promise < { cryptLibrary : string ; version : string } > {
1213 let opts : DownloadOptions = { } ;
1314 opts . arch = variant === 'host' ? undefined : getArch ( variant ) ;
@@ -32,18 +33,19 @@ export async function downloadCryptLibrary(
3233 'crypt-store' ,
3334 variant
3435 ) ;
35- // Download mongodb for latest server version, including rapid releases
36- // (for the platforms that they exist for, i.e. for ppc64le/s390x only pick stable releases).
37- let versionSpec = '8.0.12' ; // TODO(MONGOSH-2192): Switch back to 'continuous' and deal with affected platform support.
3836
39- // For 8.2.0-rc4, we use the equivalent crypt shared library version for testing.
40- if ( process . env . MONGOSH_SERVER_TEST_VERSION === '8.2.0-rc4-enterprise' ) {
41- versionSpec = '8.2.0-rc4' ;
42- } else if ( / p p c 6 4 | s 3 9 0 x / . test ( opts . arch || process . arch ) ) {
43- versionSpec = '8.0.12' ;
44- } else if ( ( opts . platform || process . platform ) === 'darwin' ) {
45- versionSpec = '8.0.5' ; // TBD(MONGOSH-2192,SERVER-101020): Figure out at what point we use a later version.
37+ if ( ! versionSpec ) {
38+ // Download mongodb for latest server version, including rapid releases
39+ // (for the platforms that they exist for, i.e. for ppc64le/s390x only pick stable releases).
40+ versionSpec = '8.0.12' ; // TODO(MONGOSH-2192): Switch back to 'continuous' and deal with affected platform support.
41+
42+ if ( / p p c 6 4 | s 3 9 0 x / . test ( opts . arch || process . arch ) ) {
43+ versionSpec = '8.0.12' ;
44+ } else if ( ( opts . platform || process . platform ) === 'darwin' ) {
45+ versionSpec = '8.0.5' ; // TBD(MONGOSH-2192,SERVER-101020): Figure out at what point we use a later version.
46+ }
4647 }
48+
4749 const { downloadedBinDir : libdir , version } =
4850 await downloadMongoDbWithVersionInfo ( cryptTmpTargetDir , versionSpec , opts ) ;
4951 const cryptLibrary = path . join (
@@ -54,7 +56,9 @@ export async function downloadCryptLibrary(
5456 ) ;
5557 // Make sure that the binary exists and is readable.
5658 await fs . access ( cryptLibrary , fsConstants . R_OK ) ;
57- console . info ( 'mongosh: downloaded' , cryptLibrary , 'version' , version ) ;
59+ console . info (
60+ `mongosh: downloaded ${ cryptLibrary } version ${ version } (requested: ${ versionSpec } )`
61+ ) ;
5862 return { cryptLibrary, version } ;
5963}
6064
0 commit comments