@esy-nightly/esy
Advanced tools
Comparing version 0.7.3-beta.4-2-g3a27a70b to 0.7.3-beta.5-1-ge124b61d
{ | ||
"name": "@esy-nightly/esy", | ||
"version": "0.7.3-beta.4-2-g3a27a70b", | ||
"version": "0.7.3-beta.5-1-ge124b61d", | ||
"license": "BSD-2-Clause", | ||
@@ -17,7 +17,7 @@ "description": "Package builder for esy.", | ||
"esyInstallRelease.js", | ||
"platform-linux/", | ||
"platform-darwin/", | ||
"platform-darwin-arm64/", | ||
"platform-windows-x64/" | ||
"platform-esy-npm-release-darwin-arm64", | ||
"platform-esy-npm-release-darwin-x64", | ||
"platform-esy-npm-release-linux-x64-static", | ||
"platform-esy-npm-release-win32-x64" | ||
] | ||
} |
@@ -50,59 +50,2 @@ /** | ||
/** | ||
* Since os.arch returns node binary's target arch, not | ||
* the system arch. | ||
* Credits: https://github.com/feross/arch/blob/af080ff61346315559451715c5393d8e86a6d33c/index.js#L10-L58 | ||
*/ | ||
function arch() { | ||
/** | ||
* The running binary is 64-bit, so the OS is clearly 64-bit. | ||
*/ | ||
if (process.arch === 'x64') { | ||
return 'x64'; | ||
} | ||
/** | ||
* All recent versions of Mac OS are 64-bit. | ||
*/ | ||
if (process.platform === 'darwin') { | ||
return 'x64'; | ||
} | ||
/** | ||
* On Windows, the most reliable way to detect a 64-bit OS from within a 32-bit | ||
* app is based on the presence of a WOW64 file: %SystemRoot%\SysNative. | ||
* See: https://twitter.com/feross/status/776949077208510464 | ||
*/ | ||
if (process.platform === 'win32') { | ||
var useEnv = false; | ||
try { | ||
useEnv = !!(process.env.SYSTEMROOT && fs.statSync(process.env.SYSTEMROOT)); | ||
} catch (err) {} | ||
var sysRoot = useEnv ? process.env.SYSTEMROOT : 'C:\\Windows'; | ||
// If %SystemRoot%\SysNative exists, we are in a WOW64 FS Redirected application. | ||
var isWOW64 = false; | ||
try { | ||
isWOW64 = !!fs.statSync(path.join(sysRoot, 'sysnative')); | ||
} catch (err) {} | ||
return isWOW64 ? 'x64' : 'x86'; | ||
} | ||
/** | ||
* On Linux, use the `getconf` command to get the architecture. | ||
*/ | ||
if (process.platform === 'linux') { | ||
var output = cp.execSync('getconf LONG_BIT', {encoding: 'utf8'}); | ||
return output === '64\n' ? 'x64' : 'x86'; | ||
} | ||
/** | ||
* If none of the above, assume the architecture is 32-bit. | ||
*/ | ||
return 'x86'; | ||
} | ||
// implementing it b/c we don't want to depend on fs.copyFileSync which appears | ||
@@ -125,3 +68,3 @@ // only in node@8.x | ||
var copyPlatformBinaries = (platformPath) => { | ||
var platformBuildPath = path.join(__dirname, 'platform-' + platformPath); | ||
var platformBuildPath = path.join(__dirname, platformPath); | ||
@@ -134,3 +77,3 @@ let foldersToCopy, binariesToCopy; | ||
if (platformPath === 'linux') { | ||
if (platformPath === "platform-esy-npm-release-linux-x64-static") { | ||
fs.mkdirSync(path.join(__dirname, 'lib')); | ||
@@ -158,3 +101,3 @@ foldersToCopy = ['bin', 'lib']; | ||
if (platformPath === 'linux') { | ||
if (platformPath === "platform-esy-npm-release-linux-x64-static") { | ||
fs.chmodSync(path.join(__dirname, 'lib', 'esy', 'esyBuildPackageCommand'), 0755); | ||
@@ -172,10 +115,10 @@ fs.chmodSync(path.join(__dirname, 'lib', 'esy', 'esySolveCudfCommand'), 0755); | ||
const platformArch = process.arch; | ||
switch (platform) { | ||
case 'win32': | ||
if (arch() !== 'x64') { | ||
if (platformArch !== 'x64') { | ||
console.warn('error: x86 is currently not supported on Windows'); | ||
process.exit(1); | ||
} | ||
copyPlatformBinaries('windows-x64'); | ||
copyPlatformBinaries('platform-esy-npm-release-win32-x64'); | ||
console.log('Installing native compiler toolchain for Windows...'); | ||
@@ -189,7 +132,7 @@ cp.execSync( | ||
case 'linux': | ||
copyPlatformBinaries(platform); | ||
copyPlatformBinaries(`platform-esy-npm-release-linux-${platformArch}-static`); | ||
// Statically linked binaries dont need postinstall scripts | ||
break; | ||
case 'darwin': | ||
copyPlatformBinaries(platform + (process.arch === 'x64' ? '' : '-arm64')); | ||
copyPlatformBinaries(`platform-esy-npm-release-darwin-${platformArch}`); | ||
require('./esyInstallRelease'); | ||
@@ -196,0 +139,0 @@ break; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 17 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 10 instances in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
270159223
42
57448
4
72
49