From f680e2b76d60d6f99b4155d8a12bd036c492996c Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Thu, 20 Nov 2025 13:34:07 -0800 Subject: [PATCH 1/2] Support Linux & Intel Macs This grabs the native files directly since the ones at the root are not expected to work in our cases, namely Intel Mac where we use arm machines to build the x64 build. --- .../extension.webpack.config.js | 30 ++++++++++++++++--- .../src/node/cachedPublicClientApplication.ts | 4 +-- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/extensions/microsoft-authentication/extension.webpack.config.js b/extensions/microsoft-authentication/extension.webpack.config.js index 2182e98e21316..c2cdc178dc131 100644 --- a/extensions/microsoft-authentication/extension.webpack.config.js +++ b/extensions/microsoft-authentication/extension.webpack.config.js @@ -8,20 +8,42 @@ import CopyWebpackPlugin from 'copy-webpack-plugin'; import path from 'path'; const isWindows = process.platform === 'win32'; -const windowsArches = ['x64']; const isMacOS = process.platform === 'darwin'; +const isLinux = !isWindows && !isMacOS; + +const windowsArches = ['x64']; const macOSArches = ['arm64']; +const linuxArches = ['x64']; + +let platformFolder; +switch (process.platform) { + case 'win32': + platformFolder = 'windows'; + break; + case 'darwin': + platformFolder = 'macos'; + break; + case 'linux': + platformFolder = 'linux'; + break; + default: + throw new Error(`Unsupported platform: ${process.platform}`); +} -const arch = process.arch; +const arch = process.env.VSCODE_ARCH || process.arch; console.log(`Building Microsoft Authentication Extension for ${process.platform} (${arch})`); const plugins = [...nodePlugins(import.meta.dirname)]; -if ((isWindows && windowsArches.includes(arch)) || (isMacOS && macOSArches.includes(arch))) { +if ( + (isWindows && windowsArches.includes(arch)) || + (isMacOS && macOSArches.includes(arch)) || + (isLinux && linuxArches.includes(arch)) +) { plugins.push(new CopyWebpackPlugin({ patterns: [ { // The native files we need to ship with the extension - from: '**/dist/(lib|)msal*.(node|dll|dylib)', + from: `**/dist/${platformFolder}/${arch}/(lib|)msal*.(node|dll|dylib|so)`, to: '[name][ext]' } ] diff --git a/extensions/microsoft-authentication/src/node/cachedPublicClientApplication.ts b/extensions/microsoft-authentication/src/node/cachedPublicClientApplication.ts index 1f0e528c99f3e..e86269833a8e5 100644 --- a/extensions/microsoft-authentication/src/node/cachedPublicClientApplication.ts +++ b/extensions/microsoft-authentication/src/node/cachedPublicClientApplication.ts @@ -51,9 +51,7 @@ export class CachedPublicClientApplication implements ICachedPublicClientApplica const loggerOptions = new MsalLoggerOptions(_logger, telemetryReporter); let broker: BrokerOptions | undefined; - if (process.platform !== 'win32' && process.platform !== 'darwin') { - this._logger.info(`[${this._clientId}] Native Broker is only available on Windows and macOS`); - } else if (env.uiKind === UIKind.Web) { + if (env.uiKind === UIKind.Web) { this._logger.info(`[${this._clientId}] Native Broker is not available in web UI`); } else if (workspace.getConfiguration('microsoft-authentication').get<'msal' | 'msal-no-broker'>('implementation') === 'msal-no-broker') { this._logger.info(`[${this._clientId}] Native Broker disabled via settings`); From 03407ef578678c10bc357f6ae194ca45921395f8 Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Thu, 20 Nov 2025 15:45:24 -0800 Subject: [PATCH 2/2] actually include macOS intel bits --- .../microsoft-authentication/extension.webpack.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/microsoft-authentication/extension.webpack.config.js b/extensions/microsoft-authentication/extension.webpack.config.js index c2cdc178dc131..a46d5a527dfec 100644 --- a/extensions/microsoft-authentication/extension.webpack.config.js +++ b/extensions/microsoft-authentication/extension.webpack.config.js @@ -12,7 +12,6 @@ const isMacOS = process.platform === 'darwin'; const isLinux = !isWindows && !isMacOS; const windowsArches = ['x64']; -const macOSArches = ['arm64']; const linuxArches = ['x64']; let platformFolder; @@ -36,7 +35,7 @@ console.log(`Building Microsoft Authentication Extension for ${process.platform} const plugins = [...nodePlugins(import.meta.dirname)]; if ( (isWindows && windowsArches.includes(arch)) || - (isMacOS && macOSArches.includes(arch)) || + isMacOS || (isLinux && linuxArches.includes(arch)) ) { plugins.push(new CopyWebpackPlugin({