@prisma/get-platform 7.10.1 → 7.11.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_ZURTL34W_exports = {};
30
- __export(chunk_ZURTL34W_exports, {
29
+ var chunk_6TXCLFZM_exports = {};
30
+ __export(chunk_6TXCLFZM_exports, {
31
31
  computeLibSSLSpecificPaths: () => computeLibSSLSpecificPaths,
32
32
  getArchFromUname: () => getArchFromUname,
33
33
  getBinaryTargetForCurrentPlatform: () => getBinaryTargetForCurrentPlatform,
@@ -41,7 +41,7 @@ __export(chunk_ZURTL34W_exports, {
41
41
  parseOpenSSLVersion: () => parseOpenSSLVersion,
42
42
  resolveDistro: () => resolveDistro
43
43
  });
44
- module.exports = __toCommonJS(chunk_ZURTL34W_exports);
44
+ module.exports = __toCommonJS(chunk_6TXCLFZM_exports);
45
45
  var import_chunk_FWMN4WME = require("./chunk-FWMN4WME.js");
46
46
  var import_debug = __toESM(require("@prisma/debug"));
47
47
  var import_child_process = __toESM(require("child_process"));
@@ -290,9 +290,9 @@ function parseDistro(osReleaseInput) {
290
290
  ).with(
291
291
  { id: "nixos" },
292
292
  ({ id: originalDistro }) => ({
293
- targetDistro: "nixos",
294
- originalDistro,
295
- familyDistro: "nixos"
293
+ targetDistro: "debian",
294
+ familyDistro: "nixos",
295
+ originalDistro
296
296
  })
297
297
  ).with(
298
298
  { id: "debian" },
@@ -387,9 +387,18 @@ function sanitiseSSLVersion(version) {
387
387
  return void 0;
388
388
  }
389
389
  function computeLibSSLSpecificPaths(args) {
390
- return M(args).with({ familyDistro: "musl" }, () => {
390
+ return M(args).with({ familyDistro: "alpine" }, () => {
391
391
  debug('Trying platform-specific paths for "alpine"');
392
392
  return ["/lib", "/usr/lib"];
393
+ }).with({ familyDistro: "nixos" }, () => {
394
+ debug('Trying platform-specific paths for "nixos"');
395
+ return [
396
+ ...new Set(
397
+ [process.env.NIX_LD_LIBRARY_PATH, process.env.LD_LIBRARY_PATH].flatMap(
398
+ (value) => (value ?? "").split(":").filter(Boolean)
399
+ )
400
+ )
401
+ ];
393
402
  }).with({ familyDistro: "debian" }, ({ archFromUname }) => {
394
403
  debug('Trying platform-specific paths for "debian" (and "ubuntu")');
395
404
  return [`/usr/lib/${archFromUname}-linux-gnu`, `/lib/${archFromUname}-linux-gnu`];
@@ -462,11 +471,8 @@ async function findLibSSL(directory) {
462
471
  try {
463
472
  const dirContents = await import_promises.default.readdir(directory);
464
473
  return dirContents.find((value) => value.startsWith("libssl.so.") && !value.startsWith("libssl.so.0"));
465
- } catch (e2) {
466
- if (e2.code === "ENOENT") {
467
- return void 0;
468
- }
469
- throw e2;
474
+ } catch (_2) {
475
+ return void 0;
470
476
  }
471
477
  }
472
478
  async function getBinaryTargetForCurrentPlatform() {
@@ -531,9 +537,6 @@ ${additionalMessage}`
531
537
  if (platform === "netbsd") {
532
538
  return "netbsd";
533
539
  }
534
- if (platform === "linux" && targetDistro === "nixos") {
535
- return "linux-nixos";
536
- }
537
540
  if (platform === "linux" && arch === "arm64") {
538
541
  const baseName = targetDistro === "musl" ? "linux-musl-arm64" : "linux-arm64";
539
542
  return `${baseName}-openssl-${libssl || defaultLibssl}`;
@@ -17,7 +17,7 @@ export type DistroInfo = {
17
17
  * The target distro is the Linux distro associated with the Prisma Engines.
18
18
  * E.g., on Arch Linux, Debian, and Ubuntu, the target distro is `debian`. On Linux Alpine, the target distro is `musl`.
19
19
  */
20
- targetDistro?: 'rhel' | 'debian' | 'musl' | 'arm' | 'nixos' | 'freebsd11' | 'freebsd12' | 'freebsd13' | 'freebsd14' | 'freebsd15';
20
+ targetDistro?: 'rhel' | 'debian' | 'musl' | 'arm' | 'freebsd11' | 'freebsd12' | 'freebsd13' | 'freebsd14' | 'freebsd15';
21
21
  };
22
22
  type GetOsResultLinux = {
23
23
  platform: 'linux';
@@ -18,21 +18,21 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var getPlatform_exports = {};
20
20
  __export(getPlatform_exports, {
21
- computeLibSSLSpecificPaths: () => import_chunk_ZURTL34W.computeLibSSLSpecificPaths,
22
- getArchFromUname: () => import_chunk_ZURTL34W.getArchFromUname,
23
- getBinaryTargetForCurrentPlatform: () => import_chunk_ZURTL34W.getBinaryTargetForCurrentPlatform,
24
- getBinaryTargetForCurrentPlatformInternal: () => import_chunk_ZURTL34W.getBinaryTargetForCurrentPlatformInternal,
25
- getPlatformInfo: () => import_chunk_ZURTL34W.getPlatformInfo,
26
- getPlatformInfoMemoized: () => import_chunk_ZURTL34W.getPlatformInfoMemoized,
27
- getSSLVersion: () => import_chunk_ZURTL34W.getSSLVersion,
28
- getos: () => import_chunk_ZURTL34W.getos,
29
- parseDistro: () => import_chunk_ZURTL34W.parseDistro,
30
- parseLibSSLVersion: () => import_chunk_ZURTL34W.parseLibSSLVersion,
31
- parseOpenSSLVersion: () => import_chunk_ZURTL34W.parseOpenSSLVersion,
32
- resolveDistro: () => import_chunk_ZURTL34W.resolveDistro
21
+ computeLibSSLSpecificPaths: () => import_chunk_6TXCLFZM.computeLibSSLSpecificPaths,
22
+ getArchFromUname: () => import_chunk_6TXCLFZM.getArchFromUname,
23
+ getBinaryTargetForCurrentPlatform: () => import_chunk_6TXCLFZM.getBinaryTargetForCurrentPlatform,
24
+ getBinaryTargetForCurrentPlatformInternal: () => import_chunk_6TXCLFZM.getBinaryTargetForCurrentPlatformInternal,
25
+ getPlatformInfo: () => import_chunk_6TXCLFZM.getPlatformInfo,
26
+ getPlatformInfoMemoized: () => import_chunk_6TXCLFZM.getPlatformInfoMemoized,
27
+ getSSLVersion: () => import_chunk_6TXCLFZM.getSSLVersion,
28
+ getos: () => import_chunk_6TXCLFZM.getos,
29
+ parseDistro: () => import_chunk_6TXCLFZM.parseDistro,
30
+ parseLibSSLVersion: () => import_chunk_6TXCLFZM.parseLibSSLVersion,
31
+ parseOpenSSLVersion: () => import_chunk_6TXCLFZM.parseOpenSSLVersion,
32
+ resolveDistro: () => import_chunk_6TXCLFZM.resolveDistro
33
33
  });
34
34
  module.exports = __toCommonJS(getPlatform_exports);
35
- var import_chunk_ZURTL34W = require("./chunk-ZURTL34W.js");
35
+ var import_chunk_6TXCLFZM = require("./chunk-6TXCLFZM.js");
36
36
  var import_chunk_FWMN4WME = require("./chunk-FWMN4WME.js");
37
37
  var import_chunk_YVXCXD3A = require("./chunk-YVXCXD3A.js");
38
38
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
package/dist/index.js CHANGED
@@ -19,9 +19,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var index_exports = {};
20
20
  __export(index_exports, {
21
21
  binaryTargets: () => import_chunk_7MLUNQIZ.binaryTargets,
22
- getBinaryTargetForCurrentPlatform: () => import_chunk_ZURTL34W.getBinaryTargetForCurrentPlatform,
23
- getPlatformInfo: () => import_chunk_ZURTL34W.getPlatformInfo,
24
- getos: () => import_chunk_ZURTL34W.getos,
22
+ getBinaryTargetForCurrentPlatform: () => import_chunk_6TXCLFZM.getBinaryTargetForCurrentPlatform,
23
+ getPlatformInfo: () => import_chunk_6TXCLFZM.getPlatformInfo,
24
+ getos: () => import_chunk_6TXCLFZM.getos,
25
25
  jestConsoleContext: () => import_chunk_WFCM4MDC.jestConsoleContext,
26
26
  jestContext: () => import_chunk_WFCM4MDC.jestContext,
27
27
  jestStdoutContext: () => import_chunk_WFCM4MDC.jestStdoutContext,
@@ -29,7 +29,7 @@ __export(index_exports, {
29
29
  processExitContext: () => import_chunk_WFCM4MDC.processExitContext
30
30
  });
31
31
  module.exports = __toCommonJS(index_exports);
32
- var import_chunk_ZURTL34W = require("./chunk-ZURTL34W.js");
32
+ var import_chunk_6TXCLFZM = require("./chunk-6TXCLFZM.js");
33
33
  var import_chunk_M5T7GI2R = require("./chunk-M5T7GI2R.js");
34
34
  var import_chunk_FWMN4WME = require("./chunk-FWMN4WME.js");
35
35
  var import_chunk_YVXCXD3A = require("./chunk-YVXCXD3A.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/get-platform",
3
- "version": "7.10.1",
3
+ "version": "7.11.0-dev.2",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -27,7 +27,7 @@
27
27
  "typescript": "5.4.5"
28
28
  },
29
29
  "dependencies": {
30
- "@prisma/debug": "7.10.1"
30
+ "@prisma/debug": "7.11.0-dev.2"
31
31
  },
32
32
  "files": [
33
33
  "README.md",
@@ -36,7 +36,6 @@
36
36
  "sideEffects": false,
37
37
  "scripts": {
38
38
  "dev": "DEV=true tsx helpers/build.ts",
39
- "build": "tsx helpers/build.ts",
40
- "test": "vitest run"
39
+ "build": "tsx helpers/build.ts"
41
40
  }
42
41
  }