logsem / iris-project

2 stars 16 forks source link

Bundler instruction does not work any more #38

Open RalfJung opened 1 month ago

RalfJung commented 1 month ago

Even the "fallback" command fails now:

bundle exec jekyll build && (cd _site && python3 -m http.server 3000)

says

Could not find listen-3.9.0, typhoeus-1.4.1, rb-inotify-0.11.1, ffi-1.17.0-x86_64-linux in locally installed gems
Run `bundle install` to install missing gems.

bundle install fails

Bundler 2.4.20 is running, but your lockfile was generated with 2.5.11. Installing Bundler 2.5.11 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.5.11
Installing bundler 2.5.11
Fetching gem metadata from https://rubygems.org/.........
Fetching ffi 1.17.0 (x86_64-linux)
Fetching rexml 3.2.8
Fetching faraday 2.9.0

Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/ffi-1.17.0-x86_64-linux.gem)
Installing faraday 2.9.0
Installing rexml 3.2.8

Retrying download gem from https://rubygems.org/ due to error (3/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/ffi-1.17.0-x86_64-linux.gem)

Retrying download gem from https://rubygems.org/ due to error (4/4): Gem::RemoteFetcher::FetchError bad response Forbidden 403 (https://rubygems.org/gems/ffi-1.17.0-x86_64-linux.gem)

Bundler::HTTPError: Could not download gem from https://rubygems.org/ due to underlying error <bad response Forbidden 403 (https://rubygems.org/gems/ffi-1.17.0-x86_64-linux.gem)>
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:459:in `rescue in download_gem'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/rubygems_integration.rb:434:in `download_gem'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/source/rubygems.rb:476:in `download_gem'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/source/rubygems.rb:437:in `fetch_gem'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/source/rubygems.rb:421:in `fetch_gem_if_possible'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/source/rubygems.rb:163:in `install'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/installer/gem_installer.rb:54:in `install'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/installer/parallel_installer.rb:132:in `do_install'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/installer/parallel_installer.rb:123:in `block in worker_pool'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/worker.rb:62:in `apply_func'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/worker.rb:57:in `block in process_queue'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/worker.rb:54:in `loop'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/worker.rb:54:in `process_queue'
  /home/r/Dokumente/Unisachen/iris/iris-project.org/.bundle/ruby/3.1.0/gems/bundler-2.5.11/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing ffi (1.17.0), and Bundler cannot continue.

In Gemfile:
  github-pages was resolved to 211, which depends on
    github-pages-health-check was resolved to 1.16.1, which depends on
      typhoeus was resolved to 1.4.1, which depends on
        ethon was resolved to 0.16.0, which depends on
          ffi

Can someone who knows bundler figure out instructions that actually work please? :)

RalfJung commented 1 month ago

Cc @rlepigre who wrote the original instructions I think

RalfJung commented 1 month ago

We also have tons of dependabot alerts, seems like in general the build system here has been bitrotting quite badly over the years. Does anyone feel in charge of maintaining that? I don't know nearly enough about bundler to do that, so we need someone else to be in charge of the ruby stuff. :)

drdreyer commented 1 month ago

I spent about an hour yesterday trying to figure out how to fix this on my Mac, so I'm "glad" to hear it's not only a Mac problem. I tried running it through Docker as well, as the README suggests, and that didn't work either. I found this page here which offers some suggestions, but I tried what the poster suggests and it didn't fix the problem for me. (I got some other error at the end.)

https://medium.com/@ritviknag/ruby-versioning-trouble-with-jekyll-github-pages-fd2748bf4e1d

@amintimany said yesterday that he was willing to take over maintenance of this and possibly change the whole infrastructure, while leaving the general approach of separating the data from appearance (with the .json file) intact. Are you still up for that, @amintimany ?

amintimany commented 1 month ago

Yes, I can do that.

rlepigre commented 1 month ago

Cc @rlepigre who wrote the original instructions I think

@RalfJung I thing I did, but I just wrote down what I managed to get working without understanding much of what I was doing. :sweat_smile: Maybe it's a matter of deleting the lockfile or something like that? I'm pretty sure we don't use anything fancy, so the version of the dependencies probably does not matter and they could probably be updated to the latest version?

rlepigre commented 1 month ago

Locally, I managed to build after https://github.com/logsem/iris-project/pull/39.

Basically, what I did is:

  1. rm -rf .bundle Gemfile.lock.
  2. I edited Gemfile to remove all version constraints, and added json which seems to now be necessary (see https://stackoverflow.com/questions/14994468/ruby-cant-load-json-gem).
  3. Run the instructions from the README.md.
amintimany commented 1 month ago

@rlepigre @RalfJung @robbertkrebbers we should make a decision here. Do we want to change away from Jekyll. I am happy to migrate the webpage to Hugo and maintain it. Unless @rlepigre is happy to continue maintaining this Jekyll setup.

rlepigre commented 1 month ago

@amintimany I don't know Hugo, is it supposed to be more stable than the current setup? Also, will it support the same kind of stuff we're doing here, with the javascript data and the templates?

On the other hand, if the current setup works, is there any point in changing it? I can help maintaining it (although I don't really have a clue what I'm doing, I probably just followed a tutorial when creating the first version), but it'd be better if I was not the only maintainer.

RalfJung commented 1 month ago

I don't have a strong opinion either way. I am more familiar with Jekyll, but I guess Hugo's template language won't be so difficult to learn either. Amin seems to know Hugo better than Rodolphe knows the Jekyll/Ruby setup, but the bus factor would still be 1.

@amintimany can you say a bit more how the Hugo-based setup would look like? Is it required to install Hugo to do any change or can I just push something and CI takes care of everything?

RalfJung commented 1 month ago

On the other hand, if the current setup works, is there any point in changing it?

Also, the current setup unfortunately doesn't work... bundle update still shows errors for me:

Bundler::HTTPError: Could not download gem from https://rubygems.org/ due to underlying error <bad response Forbidden 403 (https://rubygems.org/gems/ffi-1.17.0-x86_64-linux.gem)>
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/rubygems_integration.rb:497:in `rescue in download_gem'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/rubygems_integration.rb:469:in `download_gem'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/source/rubygems.rb:481:in `download_gem'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/source/rubygems.rb:443:in `fetch_gem'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/source/rubygems.rb:427:in `fetch_gem_if_possible'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/source/rubygems.rb:161:in `install'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/installer/gem_installer.rb:54:in `install'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/installer/parallel_installer.rb:156:in `do_install'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/installer/parallel_installer.rb:147:in `block in worker_pool'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:62:in `apply_func'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:57:in `block in process_queue'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:54:in `loop'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:54:in `process_queue'
  /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing ffi (1.17.0), and Bundler cannot continue.

In Gemfile:
  github-pages was resolved to 231, which depends on
    github-pages-health-check was resolved to 1.18.2, which depends on
      typhoeus was resolved to 1.4.1, which depends on
        ethon was resolved to 0.16.0, which depends on
          ffi
RalfJung commented 1 month ago

It seems like the correct filename is ffi-1.17.0-x86_64-linux-gnu.gem. But why does it use the wrong filename?

$ gem --version
3.4.20
$ bundle --version
Bundler version 2.4.20

Looks like maybe bundler/gem are broken in Debian. :(

amintimany commented 1 month ago

The only advantage of Hugo is that it is easier to manage locally as it does not rely on ruby. We could set up CI so it essentially work as it is now.

RalfJung commented 1 month ago

Okay I got it to work by manually editing /usr/lib/ruby/vendor_ruby/rubygems/platform.rb and un-doing this patch. Then I still get this huge warning:

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

All this doesn't exactly make me more confident in the Ruby-based approach (though to be fair this is Debian's fault to a large extent).

drdreyer commented 1 month ago

It works for me now on Mac (and I didn't have to go through the hoops that Ralf did).

RalfJung commented 1 month ago

Yeah Debian's Ruby is just extremely outdated, and has some bad patches. Not really Ruby's fault (unless they are doing something that makes packaging hard).

OTOH, the version of Hugo in Debian is from March. So just from that perspective hugo would probably work better on my system. ;) That's not a very strong argument though.

RalfJung commented 1 week ago

Okay I got it to work by manually editing /usr/lib/ruby/vendor_ruby/rubygems/platform.rb and un-doing https://github.com/jekyll/jekyll/issues/9478#issuecomment-1785797746.

Turns out that was a bad idea, it breaks using the jekyll that is shipped with Debian. :(