rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.18k stars 270 forks source link

install failed using go get in Apple Silicon #186

Closed zephyrpathsofglory closed 3 years ago

zephyrpathsofglory commented 3 years ago

I failed to install sql-migrate in macos 11.1, Apple M1 chip. My go version is Go.1.16Beta1

/usr/local/go/pkg/tool/darwin_arm64/link: running clang failed: exit status 1
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000000.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000001.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000002.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000003.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000004.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000005.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000006.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000007.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000008.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000009.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000010.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /var/folders/l7/srvfdj8j2rjd1khdn1qd3ydr0000gn/T/go-link-669664703/000011.o, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
Undefined symbols for architecture arm64:
  "__cgo_02b52858a06a_Cfunc__Cmalloc", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__Cmalloc in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_bind_blob", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_bind_blob in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_bind_text", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_bind_text in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_create_function", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_create_function in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_limit", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_limit in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_open_v2", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_open_v2 in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_prepare_v2_internal", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_prepare_v2_internal in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_result_blob", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_result_blob in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_result_text", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_result_text in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_step_internal", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_step_internal in go.o
  "__cgo_02b52858a06a_Cfunc__sqlite3_step_row_internal", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc__sqlite3_step_row_internal in go.o
  "__cgo_02b52858a06a_Cfunc_free", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_free in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_aggregate_context", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_aggregate_context in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_backup_finish", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_backup_finish in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_backup_init", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_backup_init in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_backup_pagecount", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_backup_pagecount in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_backup_remaining", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_backup_remaining in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_backup_step", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_backup_step in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_bind_double", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_bind_double in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_bind_int", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_bind_int in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_bind_int64", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_bind_int64 in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_bind_null", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_bind_null in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_bind_parameter_count", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_bind_parameter_count in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_bind_parameter_index", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_bind_parameter_index in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_busy_timeout", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_busy_timeout in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_clear_bindings", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_clear_bindings in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_close_v2", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_close_v2 in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_blob", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_blob in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_bytes", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_bytes in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_count", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_count in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_decltype", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_decltype in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_double", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_double in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_int64", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_int64 in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_name", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_name in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_text", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_text in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_column_type", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_column_type in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_commit_hook", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_commit_hook in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_create_collation", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_create_collation in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_db_filename", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_db_filename in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_enable_load_extension", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_enable_load_extension in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_errcode", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_errcode in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_errmsg", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_errmsg in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_errstr", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_errstr in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_exec", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_exec in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_extended_errcode", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_extended_errcode in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_finalize", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_finalize in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_get_autocommit", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_get_autocommit in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_interrupt", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_interrupt in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_load_extension", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_load_extension in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_reset", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_reset in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_result_double", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_result_double in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_result_error", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_result_error in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_result_int64", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_result_int64 in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_result_null", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_result_null in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_rollback_hook", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_rollback_hook in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_set_authorizer", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_set_authorizer in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_threadsafe", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_threadsafe in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_update_hook", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_update_hook in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_user_data", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_user_data in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_value_blob", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_value_blob in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_value_bytes", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_value_bytes in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_value_double", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_value_double in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_value_int64", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_value_int64 in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_value_text", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_value_text in go.o
  "__cgo_02b52858a06a_Cfunc_sqlite3_value_type", referenced from:
      _github.com/mattn/go-sqlite3._cgo_02b52858a06a_Cfunc_sqlite3_value_type in go.o
  "_authorizerTrampoline", referenced from:
      _github.com/mattn/go-sqlite3._Cfpvar_fp_authorizerTrampoline in go.o
     (maybe you meant: __cgoexp_02b52858a06a_authorizerTrampoline)
  "_callbackTrampoline", referenced from:
      _github.com/mattn/go-sqlite3._Cfpvar_fp_callbackTrampoline in go.o
     (maybe you meant: __cgoexp_02b52858a06a_callbackTrampoline)
  "_commitHookTrampoline", referenced from:
      _github.com/mattn/go-sqlite3._Cfpvar_fp_commitHookTrampoline in go.o
     (maybe you meant: __cgoexp_02b52858a06a_commitHookTrampoline)
  "_compareTrampoline", referenced from:
      _github.com/mattn/go-sqlite3._Cfpvar_fp_compareTrampoline in go.o
     (maybe you meant: __cgoexp_02b52858a06a_compareTrampoline)
  "_doneTrampoline", referenced from:
      _github.com/mattn/go-sqlite3._Cfpvar_fp_doneTrampoline in go.o
     (maybe you meant: __cgoexp_02b52858a06a_doneTrampoline)
  "_rollbackHookTrampoline", referenced from:
      _github.com/mattn/go-sqlite3._Cfpvar_fp_rollbackHookTrampoline in go.o
     (maybe you meant: __cgoexp_02b52858a06a_rollbackHookTrampoline)
  "_stepTrampoline", referenced from:
      _github.com/mattn/go-sqlite3._Cfpvar_fp_stepTrampoline in go.o
     (maybe you meant: __cgoexp_02b52858a06a_stepTrampoline)
  "_updateHookTrampoline", referenced from:
      _github.com/mattn/go-sqlite3._Cfpvar_fp_updateHookTrampoline in go.o
     (maybe you meant: __cgoexp_02b52858a06a_updateHookTrampoline)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have also tried env GOOS=darwin CGO_ENABLED=1 GOARCH=arm64 go get -v github.com/rubenv/sql-migrate/sql-migrate , but it is not functional.

Can someone help me?

rubenv commented 3 years ago

This seems like a problem in github.com/mattn/go-sqlite3, nothing we can do about that on our end.