Bootsnap not compiling on branch main ( FreeBSD 10.0 ) [ fatal error: sys/xattr.h: No such file or directory #include <sys/xattr.h> ]

branch: master
OS: 10.3-STABLE FreeBSD

since bootsnap was added on May 11 when i try to

env GYP_DEFINES="make_clang_dir=" CXX=/usr/bin/clang++ CC=/usr/bin/clang bundle install --without development test

I get error

(...)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /usr/home/spider/.rvm/gems/ruby-2.3.3/gems/bootsnap-0.2.14/ext/bootsnap
/home/spider/.rvm/rubies/ruby-2.3.3/bin/ruby -r ./siteconf20170515-61851-u8spxp.rb extconf.rb
creating Makefile

current directory: /usr/home/spider/.rvm/gems/ruby-2.3.3/gems/bootsnap-0.2.14/ext/bootsnap
make "DESTDIR=" clean

current directory: /usr/home/spider/.rvm/gems/ruby-2.3.3/gems/bootsnap-0.2.14/ext/bootsnap
make "DESTDIR="
compiling bootsnap.c
bootsnap.c:3:23: fatal error: sys/xattr.h: No such file or directory
 #include <sys/xattr.h>
                       ^
compilation terminated.
*** Error code 1

Stop.
make: stopped in /usr/home/spider/.rvm/gems/ruby-2.3.3/gems/bootsnap-0.2.14/ext/bootsnap

make failed, exit code 1

Gem files will remain installed in /home/spider/.rvm/gems/ruby-2.3.3/gems/bootsnap-0.2.14 for inspection.
Results logged to /home/spider/.rvm/gems/ruby-2.3.3/extensions/x86_64-freebsd-10/2.3.0/bootsnap-0.2.14/gem_make.out

An error occurred while installing bootsnap (0.2.14), and Bundler cannot continue.
Make sure that `gem install bootsnap -v '0.2.14'` succeeds before bundling.

I assume that it’s something similar to issue with platform triplet as mentioned in https://github.com/cowboyd/libv8/issues/236

Before bootsnap was added I had no issues.

I submited bug report also to bootsnap:
https://github.com/Shopify/bootsnap/issues/32

3 Likes

Note, I had not intention of breaking anything but we are going to need your help here submitting a PR to bootsnap. the xattr stuff is not needed for a lot of what it does, if it is not detected in mkmf it should just skip that part.

2 Likes

This is now sorted per:

https://github.com/discourse/discourse/commit/076f079d17bf69b157d38445d769f13946755d9f

4 Likes