Skip to content

Commit

Permalink
Pre-bundle openssl binaries for linux builds
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat committed Apr 19, 2024
1 parent 09637e3 commit bf165f2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions combineModules.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,26 @@ fs.mkdirSync(outFolder);

const mergedDeps = Object.assign({}, serverDeps, collectorDeps);
fs.writeFileSync(join(outFolder, 'package.json'), JSON.stringify({ dependencies: mergedDeps }, null, 2), 'utf8');
execSync(`cd ${outFolder} && yarn install --prod=true`, { stdio: 'inherit' });

if(process.platform === 'win32') {
if (['win32', 'darwin'].includes(process.platform)) {
console.log('\n=========================================')
console.log(`Installing dependencies for Mac/Windows...`)
console.log('=========================================')
execSync(`cd ${outFolder} && yarn install --prod=true`, { stdio: 'inherit' });
} else {
console.log('\n=========================================')
console.log(`Installing dependencies for Linux distro...`)
console.log('=========================================')
execSync(`cd ${outFolder} && yarn install --prod=true`, {
stdio: 'inherit',
env: {
...process.env,
PRISMA_CLI_BINARY_TARGETS: "debian-openssl-1.0.x,debian-openssl-1.1.x,debian-openssl-3.0.x"
}
});
}

if (process.platform === 'win32') {
fs.copyFileSync('prune.ps1', `${outFolder}/prune.ps1`);
execSync(`@powershell -NoProfile -ExecutionPolicy Unrestricted -Command ${outFolder}/prune.ps1`, { stdio: 'inherit' });
fs.rmSync(`${outFolder}/prune.ps1`)
Expand Down

0 comments on commit bf165f2

Please sign in to comment.