From e24f7f0c84c431d74c8b74b0b384013dcea0ebd5 Mon Sep 17 00:00:00 2001 From: Jordi Bertran de Balanda Date: Mon, 13 Mar 2023 12:55:07 +0100 Subject: [PATCH] skip incompatible services on ARM64 `yarn services` (#2868) Some libraries relying on native modules will not compile on ARM64: * couchbase is missing an ARM64 `config` directory [1] * oracledb still does not support it because first party client libraries are not available [2] * grpc is EoL and does not support ARM64 [3] We skip these services such that `yarn services` still succeeds and installs all other dependencies. [1] https://github.com/couchbase/couchnode/pull/106 [2] https://github.com/oracle/node-oracledb/issues/1349 [3] https://github.com/grpc/grpc-node/issues/1880#issuecomment-1273627039 --- README.md | 4 ++++ scripts/install_plugin_modules.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 06deb308f69..3039fb4a341 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,10 @@ $ docker-compose up -d -V --remove-orphans --force-recreate $ yarn services ``` +> **Note** +> The `couchbase`, `grpc` and `oracledb` instrumentations rely on native modules +> that do not compile on ARM64 devices (for example M1/M2 Mac) - their tests +> cannot be run locally on these devices. ### Unit Tests diff --git a/scripts/install_plugin_modules.js b/scripts/install_plugin_modules.js index ccfde83f81e..c14867a4439 100644 --- a/scripts/install_plugin_modules.js +++ b/scripts/install_plugin_modules.js @@ -1,6 +1,7 @@ 'use strict' const fs = require('fs') +const os = require('node:os') const path = require('path') const crypto = require('crypto') const semver = require('semver') @@ -11,6 +12,7 @@ const externals = require('../packages/dd-trace/test/plugins/externals') const requirePackageJsonPath = require.resolve('../packages/dd-trace/src/require-package-json') +const excludeList = os.arch() === 'arm64' ? ['couchbase', 'grpc', 'oracledb'] : [] const workspaces = new Set() const versionLists = {} const deps = {} @@ -42,6 +44,8 @@ async function run () { assertFolder() await assertVersions() assertWorkspace() + // Some native addon packages rely on libraries that are not supported on ARM64 + excludeList.forEach(pkg => delete workspaces[pkg]) install() } @@ -197,7 +201,7 @@ function install () { function addFolder (name, version) { const basename = [name, version].filter(val => val).join('@') - workspaces.add(basename) + if (!excludeList.includes(name)) workspaces.add(basename) } function folder (name, version) {