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

Fix Gemfile #120

Closed
wants to merge 3 commits into from
Closed

Fix Gemfile #120

wants to merge 3 commits into from

Conversation

fsimonis
Copy link
Contributor

The Gemfile currently lacks many dependencies.

This PR uses the gem github-pages as a central dependency for the jekyll website and adds rake for support of the Rakefile

@StephanJanosch
Copy link
Collaborator

I always delete the Gemfile.lock coming from the repo. I don't understand why, but my local install does not like it.

I don't want to accept this PR blindly but really understand it. Maybe I have time later to review it closely.

@knarrff
Copy link
Contributor

knarrff commented Jun 11, 2019

I have to say: I am not at all an expert here. But, these are a lot of dependencies. How can I check that we do indeed need all of those for the current website?

@fsimonis
Copy link
Contributor Author

fsimonis commented Jun 11, 2019

@StephanJanosch Do you run jekyll via bundle? bundle exec jekyll serve

@knarrff I totally agree. github-pages bundles a huge pile of common dependencies. The tradeoff is that this bundle is directly maintained by github and many web developers are familiar with it.

@StephanJanosch
Copy link
Collaborator

StephanJanosch commented Jun 11, 2019

@StephanJanosch Do you run jekyll via bundle? bundle exec jekyll serve

usually not. jekyll s is what I type. I might have used the bundle way once. I have no clue about this ruby world. I did the bare minimum to make it work.

@fsimonis
Copy link
Contributor Author

usually not. jekyll s is what I type. I might have used the bundle way once. I have no clue about this ruby world. I did the bare minimum to make it work.

I quite understand.

For the sake of completeness, bundle install creates a local installation of the dependencies declared in the Gemfile with the locked versions declared in the Gemfile.lock (most recent working setup).
To run something restricted to this local install, one has to use bundle exec <cmd>.

By running the bare command, you use the system install and probably run into problems with conflicting versions.

@knarrff
Copy link
Contributor

knarrff commented Jun 11, 2019

By running the bare command, you use the system install and probably run into problems with conflicting versions.

I do understand the intention that everything should work smoothly when people want to run software. That is very important and often overlooked.

Connected to that is to declare dependencies. Although, for me this also includes to only specify as dependency something you actually depend on, and it includes to specify the oldest version of a dependency that your code still works with, instead of only what happens to be current or installed in your system.

Therefore my question, is there a good, (semi-)automatic way to get to such a list of dependencies in our case here? I am not too familiar with this setup. What I did is to try to build the pages with the short list of dependencies installed on a fresh system, and it worked. This is no proof that it would have worked with "less", but can I take it as indication that it is likely sufficient?

@fsimonis
Copy link
Contributor Author

@knarrff I see you point and I tried to boil down the dependencies as much as possible.
Can you please give it a try?

@knarrff
Copy link
Contributor

knarrff commented Sep 9, 2019

Just tried this today. I cannot make this build with my currently system-installed ruby using 'bundle', neither the master-version, nor the one from this pull request.

What does work though, is simply 'jekyll build' without using bundle. Now I wonder why I would need 'bundle' at all, and if all the packages and versions given in either of the two Gemfile.lock versions are really necessary - since it apparently works just fine without installing anything extra.

I am not familiar with Gemfile.lock and Gemfile files. How are those files generated? In particular, how is the list of dependencies and their versions generated? Because, it seems I can build this project just fine, without some of the packages listed in there, and without updating others to the versions listed there.

I have the suspicion that it's just the versions that happened to be installed on the machine the file in generated on, or maybe the then current versions of packages. If it is any of these, it's no good. What we need is a true list of dependencies with their really needed version dependencies. But maybe my suspicion is wrong and I do miss something?

@fsimonis
Copy link
Contributor Author

What command do you execute to build the website?
It should be something like this:

$ bundle install
$ bundle exec jekyll build

Running jekyll build uses the system/user installed version which most likely differs between systems and can lead to all sorts of hidden problems. Using the prefix bundle exec runs the command "inside" the local installation.

The Gemfile is provided by the user and explicitly defines version constraints of the direct dependencies.

By executing bundle install, two things can happen

  1. If there is a Gemfile.lock present, bundler installs all listed packages at their specified version. This allows for a painless installation and reproduces the latest build environment.
  2. If there is no Gemfile.lock present, bundler builds a version graph that satisfies the constraints expressed in the Gemfile while using the most up-to-date package versions. All dependencies and their selected versions are then saved to the Gemfile.lock. By committing the lock file, the developer publishes the latest working configuration of dependencies of the project. ( Reproducible build environment )

@nuest nuest mentioned this pull request Nov 25, 2019
@nuest
Copy link
Member

nuest commented Nov 25, 2019

Thanks @fsimonis for the explanations and your contributions. Your changes were also a solution for the broken feed #139 and is includes in #140

@nuest nuest closed this Nov 25, 2019
@fsimonis fsimonis deleted the fix-gemfile branch November 25, 2019 11:17
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

Successfully merging this pull request may close these issues.

None yet

4 participants