erlangpack / bcrypt

Erlang wrapper for OpenBSD's Blowfish password hashing code
https://hex.pm/packages/bcrypt
Other
16 stars 19 forks source link

Remove specifying the arch for which is built #21

Closed mmzeeman closed 3 years ago

mmzeeman commented 3 years ago

This PR removes the hard coded arch for which is built. When the user compiles on a M1 powered Mac, the built will be either a x86_64 or an arm64, depending on the current arch in the users terminal.

It is possible to check this with the arch command. The architecture of the underlying erlang system must be the same as the one in the terminal where the built is run.

I don't know a good way to determine the architecture of the underlying erlang system. If that is possible, the builds architecture could be set to the architecture of the erlang system, not of the terminal. This PR assumes the architecture of the terminal is the same as the erlang system, which is usually the case.

Fixes #20

mworrell commented 3 years ago

How is the arch in the shell specified? And could it be that we are rebuilding with a different arch than the original build?

To me it looks like removing the x86_64 option is indeed the correct one (as 32 bit builds on "Darwin" should have been phased out by now).

mmzeeman commented 3 years ago

There is an arch command now. This can be used to run a command (or shell) into i386or arm64 architecture on an M1 Mac.

mmzeeman commented 3 years ago

Maybe there is a way to get the "arch" of the current erlang version for which the build is running as this can now be different from the shell the command is running from.

mworrell commented 3 years ago

Merged, thanks!