Skip to content

FreeBSD build is broken #188

Closed
Closed

Description

@inferiorhumanorgans
[user@devbox ~]$ uname -a
FreeBSD devbox 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  amd64

[user@devbox ~]$ gem --version
2.7.8

[user@devbox ~]$ ruby --version
ruby 2.4.5p335 (2018-10-18 revision 65137) [x86_64-freebsd12.0]

[user@devbox ~]$ gem install bcrypt
Building native extensions. This could take a while...
ERROR:  Error installing bcrypt:
	ERROR: Failed to build gem native extension.

    current directory: /usr/home/user/.rvm/gems/ruby-2.4.5/gems/bcrypt-3.1.12/ext/mri
/usr/home/user/.rvm/rubies/ruby-2.4.5/bin/ruby -r ./siteconf20181229-84104-u51ca4.rb extconf.rb
creating Makefile

current directory: /usr/home/user/.rvm/gems/ruby-2.4.5/gems/bcrypt-3.1.12/ext/mri
make "DESTDIR=" clean

current directory: /usr/home/user/.rvm/gems/ruby-2.4.5/gems/bcrypt-3.1.12/ext/mri
make "DESTDIR="
compiling bcrypt_ext.c
In file included from bcrypt_ext.c:2:
./ow-crypt.h:19:14: error: conflicting types for 'crypt_r'
extern char *crypt_r(__CONST char *key, __CONST char *setting, void *data);
             ^
/usr/include/unistd.h:499:7: note: previous declaration is here
char    *crypt_r(const char *, const char *, struct crypt_data *);
         ^
bcrypt_ext.c:17:25: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            NIL_P(input) ? 0 : RSTRING_LEN(input));
                               ^~~~~~~~~~~~~~~~~~
/usr/home/user/.rvm/rubies/ruby-2.4.5/include/ruby-2.4.0/ruby/ruby.h:980:6: note: expanded from macro 'RSTRING_LEN'
     RSTRING_EMBED_LEN(str) : \
     ^~~~~~~~~~~~~~~~~~~~~~
/usr/home/user/.rvm/rubies/ruby-2.4.5/include/ruby-2.4.0/ruby/ruby.h:976:6: note: expanded from macro 'RSTRING_EMBED_LEN'
     (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bcrypt_ext.c:17:25: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            NIL_P(input) ? 0 : RSTRING_LEN(input));
                               ^~~~~~~~~~~~~~~~~~
/usr/home/user/.rvm/rubies/ruby-2.4.5/include/ruby-2.4.0/ruby/ruby.h:981:28: note: expanded from macro 'RSTRING_LEN'
     RSTRING(str)->as.heap.len)
     ~~~~~~~~~~~~~~~~~~~~~~^~~
2 warnings and 1 error generated.
*** Error code 1

Stop.
make: stopped in /usr/home/user/.rvm/gems/ruby-2.4.5/gems/bcrypt-3.1.12/ext/mri

make failed, exit code 1

Gem files will remain installed in /home/user/.rvm/gems/ruby-2.4.5/gems/bcrypt-3.1.12 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.4.5/extensions/x86_64-freebsd-12/2.4.0/bcrypt-3.1.12/gem_make.out

Activity

  1. tjschuck commented on Jan 2, 2019

    @tjschuck
    Collaborator

    The issue you're running into is related to the vendored C library we use to power bcrypt-ruby, so won't be addressed by bcrypt-ruby itself. (If you petition upstream and those patches are accepted, we'll pull the changes downstream into bcrypt-ruby.)

    See also #150 and #166, and specifically #166 (comment), which is from the author of the included C library.

  2. solardiz commented on Jan 21, 2019

    @solardiz

    @tjschuck I'm afraid you're misinforming people, resulting in them asking for this to be fixed in upstream crypt_blowfish, whereas the bug is in the way your project incorrectly uses crypt_blowfish (using its bundled wrapper code that was only intended for use from a libc) as I explained in #166 (comment) - is that something you'd be willing to fix? Thanks!

    Patches such as #150 are wrong - they temporarily fix the symptom while not fixing the problem.

    Update: the workaround proposed on #189 and the discussion there make more sense to me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions