Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: bundle exec jekyll build fails on Debian Unstable #9478

Closed
tdltdc opened this issue Oct 29, 2023 · 1 comment
Closed

[Bug]: bundle exec jekyll build fails on Debian Unstable #9478

tdltdc opened this issue Oct 29, 2023 · 1 comment

Comments

@tdltdc
Copy link

tdltdc commented Oct 29, 2023

Operating System

Debian Unstable

Ruby Version

ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]

Jekyll Version

jekyll 4.3.2

GitHub Pages Version

Latest

Expected Behavior

I expected my site to be built successfully when I run the following:

bundle exec jekyll build

Current Behavior

Jekyll fails to build the site. See the relevant log output, and the steps to reproduce the issue in the Code Sample field.

Relevant log output

debian@debian:~/site$ bundle exec jekyll build
Configuration file: /home/debian/site/_config.yml
            Source: /home/debian/site
       Destination: /home/debian/site/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
/home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/lib/sass/embedded/connection.rb:41: warning: /home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/ext/sass/dart-sass/src/dart: error while loading shared libraries: /lib/x86_64-linux-gnu/libc.so: invalid ELF header
  Conversion error: Jekyll::Converters::Scss encountered an error while converting 'assets/main.scss':
                    end of file reached
                    ------------------------------------------------
      Jekyll 4.3.2   Please append `--trace` to the `build` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
/home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/lib/sass/embedded/varint.rb:20:in `readbyte': end of file reached (EOFError)
	from /home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/lib/sass/embedded/varint.rb:20:in `block in read'
	from /home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/lib/sass/embedded/varint.rb:19:in `loop'
	from /home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/lib/sass/embedded/varint.rb:19:in `read'
	from /home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/lib/sass/embedded/connection.rb:29:in `block (2 levels) in initialize'
	from /home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/lib/sass/embedded/connection.rb:28:in `loop'
	from /home/debian/gems/gems/sass-embedded-1.69.5-x86_64-linux/lib/sass/embedded/connection.rb:28:in `block in initialize'

Code Sample

Steps to reproduce the issue

Be running Debian Unstable (Sid) as of Oct 29 2023 (with all the latest apt packages).

Option 1 (Jekyll installed using official Quickstart instructions)

sudo apt install ruby-full
sudo apt install build-essential
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc
echo 'export GEM_HOME="$HOME/gems"' >> ~/.bashrc
echo 'export PATH="$HOME/gems/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
gem install jekyll bundler
jekyll new site
cd site/
bundle exec jekyll build
bundle add webrick
bundle exec jekyll build

Option 2 (Jekyll installed using rbenv)

curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
~/.rbenv/bin/rbenv init
vim ~/.bashrc  # Add line suggested by rbenv init to .bashrc
vim ~/.bashrc 
sudo apt install libyaml-dev
rbenv install 3.2.2
rbenv global 3.2.2
gem update --system 3.4.21
gem install jekyll bundler
jekyll new site
cd site/
bundle exec jekyll build
@ntkme
Copy link
Contributor

ntkme commented Oct 30, 2023

This is a bug in Debian's rubygems. Currently Debian unstable has rubygems 3.4.20, however, if you download the official rubygems source code and compare with the Debian's rubygems you will find that Debian has patched it:

diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
index b721629b7..a16c6fca9 100644
--- a/lib/rubygems/platform.rb
+++ b/lib/rubygems/platform.rb
@@ -117,6 +117,9 @@ def initialize(arch)
       when /^(\w+_platform)(\d+)?/ then [ $1,          $2  ]
       else                              [ "unknown",   nil ]
       end
+
+      # emulate behavior from 3.3.15 on ruby 3.1
+      @version = nil if (RUBY_VERSION < "3.2" && @os == "linux")
     when Gem::Platform then
       @cpu = arch.cpu
       @os = arch.os

This patch breaks platform detection, that it effectively reverted rubygems/rubygems#5852 and rubygems/rubygems#5889 which are required for sass-embedded to install properly. Now both -gnu and -musl are now allowed to be installed on linux-gnu. If you randomly ended up with -musl, you would get the error due to libc incompatibility.

So after all this is a bug in Debian. Please report the bug to Debian, as there is nothing we can do here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants