denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.41k stars 5.18k forks source link

Deno loading .node files with incorrect architecture when using NPM oracledb package #24395

Open jtibble opened 6 days ago

jtibble commented 6 days ago

Version: Deno 1.44.4

Copied from https://discord.com/channels/684898665143206084/1257181475418144899

M1 Mac, arm64 processor, terminal set to i386 mode with "env /usr/bin/arch -x86_64 /bin/zsh --login"

When using the NPM oracledb package v6.5.1, when initializing the Oracle "Thick Client" mode with a call to oracledb.initOracleClient({libDir: '/path/to/instantclient' });, deno is trying load the oracledb ".node" files with a different architecture than my terminal. My terminal is set to i386 mode but deno appears to be trying to load the arm64 node files.

Expected behavior: Deno should respect the architecture of the terminal when loading .node files from oracledb NPM package.

I have not tried reinstalling deno since I switched terminal architecture, so perhaps this could be resolved by reinstalling deno? Will try that next.

Screenshot 2024-06-30 at 11 49 14 PM Screenshot 2024-06-30 at 11 50 49 PM

jtibble commented 6 days ago

I can report that removing and re-installing deno while terminal is in i386 mode does successfully load the correct .node files and allow for connecting to the database. deno --version shows x86_64-apple-darwin mode

Screenshot 2024-07-02 at 12 38 11 PM Screenshot 2024-07-02 at 12 38 27 PM

devsnek commented 5 days ago

This sounds like it is working correctly to me. You can't load x64 code into an aarch64 process.