@@ -19,10 +19,6 @@ function printVar(name, value) {
1919}
2020
2121function printCompassEnv ( ) {
22- const {
23- EVERGREEN_BUILD_VARIANT
24- } = process . env ;
25-
2622 let {
2723 // This is an env var set in bash that we exported in print-compass-env.sh
2824 OSTYPE
@@ -48,34 +44,41 @@ function printCompassEnv() {
4844 # - https://github.com/mongodb-js/compass/pull/2403
4945 # - https://github.com/mongodb-js/compass/pull/2410
5046 */
51- if ( originalPWD . startsWith ( '\ /cygdrive\ /c' ) ) {
47+ if ( originalPWD . startsWith ( '/cygdrive/c' ) ) {
5248 // Change cygdrive from c to z without chanding rest of the path
53- newPWD = originalPWD . replace ( '\ /cygdrive\ /c' , '\ /cygdrive\ /z' ) ;
49+ newPWD = originalPWD . replace ( '/cygdrive/c' , '/cygdrive/z' ) ;
5450 // we have to change the directory in the shell script we're outputting, not in this node process
5551 console . log ( `cd "${ newPWD } ";` ) ;
5652 console . log ( 'echo "Changed cwd on cygwin. Current working dir: $PWD";' ) ;
5753 }
5854
59- const pathsToPrepend = [ ]
55+ const pathsToPrepend = [ ] ;
6056
6157 if ( OSTYPE === 'cygwin' ) {
6258 // NOTE lucas: for git-core addition, See
6359 // https://jira.mongodb.org/browse/COMPASS-4122
6460 pathsToPrepend . unshift ( '/cygdrive/c/wixtools/bin' ) ;
6561 pathsToPrepend . unshift ( `${ newPWD } /.deps` ) ;
66- pathsToPrepend . unshift ( '/cygdrive/c/Program Files/Git/mingw32/libexec/git-core' ) ;
67- printVar ( 'APPDATA' , 'Z:\\\;' ) ;
62+ pathsToPrepend . unshift (
63+ '/cygdrive/c/Program Files/Git/mingw32/libexec/git-core'
64+ ) ;
65+ printVar ( 'APPDATA' , 'Z:\\;' ) ;
6866 } else {
6967 pathsToPrepend . unshift ( `${ newPWD } /.deps/bin` ) ;
7068 }
7169
72- if ( EVERGREEN_BUILD_VARIANT === 'rhel ' ) {
70+ if ( process . env . IS_RHEL === 'true ' ) {
7371 // To build node modules on RHEL post electron 13 we need
7472 // a newer c++ compiler version, this adds it.
7573 // https://jira.mongodb.org/browse/COMPASS-5150
7674 pathsToPrepend . unshift ( '/opt/mongodbtoolchain/v3/bin' ) ;
7775 }
7876
77+ if ( process . env . PLATFORM === 'linux' ) {
78+ // Make sure that linux is using python 3.6 (node-gyp requirement)
79+ pathsToPrepend . unshift ( '/opt/python/3.6/bin' ) ;
80+ }
81+
7982 PATH = maybePrependPaths ( PATH , pathsToPrepend ) ;
8083 printVar ( 'PATH' , PATH ) ;
8184
@@ -91,6 +94,13 @@ function printCompassEnv() {
9194 printVar ( 'npm_config_cache' , npmCacheDir ) ;
9295 // npm tmp is deprecated, but let's keep it around just in case
9396 printVar ( 'npm_config_tmp' , npmTmpDir ) ;
97+
98+ printVar ( 'PLATFORM' , process . env . PLATFORM ) ;
99+ printVar ( 'IS_WINDOWS' , process . env . IS_WINDOWS ) ;
100+ printVar ( 'IS_OSX' , process . env . IS_OSX ) ;
101+ printVar ( 'IS_LINUX' , process . env . IS_LINUX ) ;
102+ printVar ( 'IS_RHEL' , process . env . IS_RHEL ) ;
103+ printVar ( 'IS_UBUNTU' , process . env . IS_UBUNTU ) ;
94104}
95105
96106printCompassEnv ( ) ;
0 commit comments