azure-cli-extensions icon indicating copy to clipboard operation
azure-cli-extensions copied to clipboard

Failed to install extension `rdbms-connect` on apple m1 (arm64)

Open SimonSimCity opened this issue 1 year ago • 2 comments

Describe the bug

The command for installing the extension rdbms-connect is failing. What I see to be the error is the following section:

  clang -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_asis.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_binary.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_datetime.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_list.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_pboolean.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_pdecimal.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_pfloat.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_pint.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_qstring.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/aix_support.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/bytes_format.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/column_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/connection_int.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/connection_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/conninfo_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/cursor_int.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/cursor_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/diagnostics_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/error_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/green.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/libpq_support.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/lobject_int.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/lobject_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/microprotocols.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/microprotocols_proto.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/notify_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/pqpath.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/psycopgmodule.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/replication_connection_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/replication_cursor_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/replication_message_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/solaris_support.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/typecast.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/utils.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/win32_support.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/xid_type.o -L/opt/homebrew/opt/libpq/lib -lpq -lssl -lcrypto -o build/lib.macosx-14.0-arm64-cpython-311/psycopg2/_psycopg.cpython-311-darwin.so
  ld: warning: search path '/usr/local/opt/openssl/lib/' not found
  ld: library 'ssl' not found
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  error: command '/usr/bin/clang' failed with exit code 1
  error: subprocess-exited-with-error

  × Building wheel for psycopg2 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

I've installed openssl in homebrew, but it seems that the default location for where brew installs packages is different on x64 and arm64 processors (https://docs.brew.sh/Manpage#--prefix---unbrewed---installed-formula-). It seems that the system here is looking for openssl as if I would have an x64 processor. Don't know whether that's the real reason.

Related command

az extension add --name rdbms-connect

Errors

  clang -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_asis.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_binary.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_datetime.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_list.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_pboolean.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_pdecimal.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_pfloat.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_pint.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/adapter_qstring.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/aix_support.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/bytes_format.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/column_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/connection_int.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/connection_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/conninfo_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/cursor_int.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/cursor_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/diagnostics_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/error_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/green.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/libpq_support.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/lobject_int.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/lobject_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/microprotocols.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/microprotocols_proto.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/notify_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/pqpath.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/psycopgmodule.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/replication_connection_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/replication_cursor_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/replication_message_type.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/solaris_support.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/typecast.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/utils.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/win32_support.o build/temp.macosx-14.0-arm64-cpython-311/psycopg/xid_type.o -L/opt/homebrew/opt/libpq/lib -lpq -lssl -lcrypto -o build/lib.macosx-14.0-arm64-cpython-311/psycopg2/_psycopg.cpython-311-darwin.so
  ld: warning: search path '/usr/local/opt/openssl/lib/' not found
  ld: library 'ssl' not found
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  error: command '/usr/bin/clang' failed with exit code 1
  error: subprocess-exited-with-error

  × Building wheel for psycopg2 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

Issue script & Debug output

Here's the full log I get from the command (with added --debug flag): output.log

Expected behavior

It should install the extension

Environment Summary

azure-cli                         2.64.0

core                              2.64.0
telemetry                          1.1.0

Dependencies:
msal                              1.30.0
azure-mgmt-resource               23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/bin/python'
Extensions directory '/Users/simon/.azure/cliextensions'

Python (Darwin) 3.11.10 (main, Sep  7 2024, 01:03:31) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.

Additional context

No response

SimonSimCity avatar Sep 26 '24 09:09 SimonSimCity

Thank you for opening this issue, we will look into it.

yonzhan avatar Sep 26 '24 09:09 yonzhan

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureSQLGitHub.