microsoft/homebrew-mssql-release

macOS version of libmsodbcsql.17.dylib in msodbcsql-17.8.1.1 appears to want to load libodbcinst.2.dylib in /opt/homebrew/lib instead of /usr/local/lib

vt-pongrass opened this issue · 4 comments

Hi,

thanks for the ARM64 version of the driver. It's much appreciated.

I've noticed a difference in the path to the libodbcinst.2.dylib library that the msodbcsql-17.8.1.1 driver is linked to:

% otool -L /path/to/msodbcsql-17.8.1.1/lib/libmsodbcsql.17.dylib
/path/to/msodbcsql-17.8.1.1/lib/libmsodbcsql.17.dylib:
	libmsodbcsql.17.dylib (compatibility version 0.0.1, current version 8.1.1)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
	/opt/homebrew/lib/libodbcinst.2.dylib (compatibility version 3.0.0, current version 3.0.0)
	/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)

and see that it wants to load /opt/homebrew/lib/libodbcinst.2.dylib whereas the previous version msodbcsql-17.7.2.1 is linked to:

% otool -L /path/to/msodbcsql-17.7.2.1/lib/libmsodbcsql.17.dylib 
/path/to/msodbcsql-17.7.2.1/lib/libmsodbcsql.17.dylib:
	libmsodbcsql.17.dylib (compatibility version 0.0.1, current version 7.2.1)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1259.11.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
	/usr/local/lib/libodbcinst.2.dylib (compatibility version 3.0.0, current version 3.0.0)
	/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)

and see that it wants to load /usr/local/lib/libodbcinst.2.dylib.

So is this change correct? Is libodbcinst.2.dylib now supposed to be in /opt/homebrew/lib ?

Thank you.

Yes, the arm64 version of Homebrew is in /opt/homebrew/, /usr/local is the path for the x86 one. (This is likely to avoid mixing different architecture binaries, which will definitely cause confusion.)

Thank you for the explanation. Can I suggest you add this information to the release notes?

On another note, is there any intention to release a Universal dylib (ie, ARM64 + x64)?

This information is in the Homebrew docs: https://docs.brew.sh/FAQ (search for "ARM")

On another note, is there any intention to release a Universal dylib (ie, ARM64 + x64)?

That will cause a massive confusion, also it will be twice as big as it needs to be. The architectures are kept separate because you also need the rest of application and ODBC stack to be consistent. If you installed arm64 driver, it looks in location of arm64 libraries. If you installed x86, it looks in that location instead.

Thanks for the home-brew FAQ link. I wasn't aware of that decision by homebrew so it now makes sense.

Also thanks for the explanation re separate architectures.

I consider this issue closed. Thanks again.