website icon indicating copy to clipboard operation
website copied to clipboard

Add dependecy constraints

Open shubhsboson opened this issue 2 years ago • 9 comments

Lock dependencies to known working versions to ensure builds work in future as well.

shubhsboson avatar May 12 '23 07:05 shubhsboson

@captn3m0 Can you please look into this PR ?

shubhsboson avatar May 26 '23 21:05 shubhsboson

@captn3m0 All requested changes are done.

shubhsboson avatar May 29 '23 16:05 shubhsboson

@captn3m0 Can you please review the PR again ? All requested changes are done.

shubhsboson avatar Jun 01 '23 06:06 shubhsboson

It runs rubygem-jekyll-4.3.2, ruby-3.1.4,1, ruby31-gems-3.4.10.

kprovost avatar Jun 01 '23 07:06 kprovost

Following are the details from the container env, I made the changes on Screenshot 2023-06-01 at 10 13 09 AM

shubhsboson avatar Jun 01 '23 08:06 shubhsboson

@kprovost @captn3m0 , How do you suggest we proceed here ? And if we are all positive and ready to test please merge this to master.

shubhsboson avatar Jun 01 '23 08:06 shubhsboson

So the deployment is just a jekyll invocation for the deploy (jekyll build)? Without bundler, that seems to break (if you have a Gemfile present):

jekyll build
/usr/lib/ruby/3.0.0/bundler/definition.rb:524:in `materialize': Could not find jekyll-4.3.2, jekyll-sass-converter-2.2.0, addressable-2.8.4, colorator-1.1.0, em-websocket-0.5.3, i18n-1.12.0, jekyll-watch-2.2.1, kramdown-2.4.0, kramdown-parser-gfm-1.1.0, liquid-4.0.4, mercenary-0.4.0, pathutil-0.16.2, rouge-4.1.0, safe_yaml-1.0.5, terminal-table-3.0.2, webrick-1.8.1, sassc-2.4.0, public_suffix-5.0.1, eventmachine-1.2.7, http_parser.rb-0.8.0, concurrent-ruby-1.2.2, listen-3.8.0, rexml-3.2.5, forwardable-extended-2.6.0, unicode-display_width-2.4.2, ffi-1.15.5, rb-fsevent-0.11.2, rb-inotify-0.10.1 in locally installed gems (Bundler::GemNotFound)
	from /usr/lib/ruby/3.0.0/bundler/definition.rb:197:in `specs'
	from /usr/lib/ruby/3.0.0/bundler/definition.rb:254:in `specs_for'
	from /usr/lib/ruby/3.0.0/bundler/runtime.rb:18:in `setup'
	from /usr/lib/ruby/3.0.0/bundler.rb:171:in `setup'
	from /home/nemo/.gem/ruby/3.0.0/gems/jekyll-4.3.2/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
	from /home/nemo/.gem/ruby/3.0.0/gems/jekyll-4.3.2/exe/jekyll:11:in `<top (required)>'
	from /home/nemo/.gem/ruby/3.0.0/bin/jekyll:25:in `load'
	from /home/nemo/.gem/ruby/3.0.0/bin/jekyll:25:in `<main>'

Running JEKYLL_NO_BUNDLER_REQUIRE=true jekyll build instead seems to fix it:

Configuration file: /home/nemo/projects/personal/hillhacks-website/_config.yml
            Source: /home/nemo/projects/personal/hillhacks-website
       Destination: /home/nemo/projects/personal/hillhacks-website/_site
 Incremental build: disabled. Enable with --incremental

But that means it will ignore everything in the Gemfile, so the benefits of this PR are ignored.

Using JEKYLL_NO_BUNDLER_REQUIRE still breaks, because it hits #57 (on my setup, freebsd is still pinning the sass-convertor to 2.x so it avoids the issue for now, but it might break in the future?).

Managed to fix #57 while debugging this, so that should give us a clean solution that keeps working. Will push my changes for #57 in this PR, and merge this PR.

We can switch our jekyll invocation in the deploy script to something like the following, after this is merged (Based on https://jekyllrb.com/tutorials/using-jekyll-with-bundler/):

git clone/pull [...]
bundle config set --local path 'vendor/bundle'
bundle install
bundle exec jekyll build

captn3m0 avatar Jun 01 '23 08:06 captn3m0

The deployment 'script' is a cron job that does /srv/www/Hillhacks && /usr/local/bin/git pull >/dev/null && /usr/local/bin/jekyll build >/dev/null.

It looks like Nemo has access to that box. The website lives in the wiki jail, and the job runs as www (sudo jexec wiki sudo -s -u www).

kprovost avatar Jun 01 '23 12:06 kprovost

Will get to this soon.

captn3m0 avatar Jun 07 '23 15:06 captn3m0