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

Auto-regeneration does not work on Ubuntu 18.04 WSL 2 - version #315

Open
lena-hinrichsen opened this issue May 12, 2022 · 5 comments
Open
Assignees

Comments

@lena-hinrichsen
Copy link
Member

lena-hinrichsen commented May 12, 2022

Problem

Running make serve under Ubuntu 18.04 with WSL 2 (did not test for WSL 1) will break auto-regeneration:

Auto-regeneration may not work on some Windows versions.
Please see: https://github.com/Microsoft/BashOnWindows/issues/216
If it does not work, please upgrade Bash on Windows or run Jekyll with --no-watch.

Proposed solution

This works for me: jekyll/jekyll#5462 (comment) (change one line in vendor\bundle\ruby\2.5.0\gems\jekyll-4.2.2\lib\jekyll\commands\build.rb)

But I don't know if that will break something for other (non-WSL) versions.

@kba
Copy link
Member

kba commented May 13, 2022

Since make serve is mostly for our own usage, I see no reason not to include that hack. However, the workaround is 6 years old and does not seem to apply in my installation, i.e. the relevant part of my vendor/bundle/ruby/2.5.0/gems/jekyll-4.2.2/lib/jekyll/commands/build.rb looks like this:

if Utils::Platforms.bash_on_windows?                                                     
  Jekyll.logger.warn "",                                                                 
                     "Auto-regeneration may not work on some Windows versions."          
  Jekyll.logger.warn "",                                                                 
                     "Please see: https://github.com/Microsoft/BashOnWindows/issues/216" 
  Jekyll.logger.warn "",                                                                 
                     "If it does not work, please upgrade Bash on Windows or "\          
                     "run Jekyll with --no-watch."                                       
end                                                                                      
                                                                                         
External.require_with_graceful_fail "jekyll-watch"                                       
Jekyll::Watcher.watch(options, site)                                                     

AFAICS, the if-clause only outputs warnings but doesn't change anything.

Also, changing the source code of a gem will require rebuilding the Gemfile.lock and is generally non-trivial to automate.

Maybe instead, you could add documentation to the README?

@kba
Copy link
Member

kba commented May 13, 2022

Indeed, the (no-op) warnings are gone in the newest release: https://github.com/jekyll/jekyll/pull/8821/files

@lena-hinrichsen
Copy link
Member Author

AFAICS, the if-clause only outputs warnings but doesn't change anything.

I thought that too when I looked at the lines but somehow there actually was a difference. Maybe I just have to retest.

@lena-hinrichsen
Copy link
Member Author

lena-hinrichsen commented May 17, 2022

Of course, there was something odd when I originally tested.
What works for me instead, is adding --force_polling \ as a parameter for serve in the Makefile (line 122-128).

Are there any objections to do that? If not, I can make a PR.

@kba
Copy link
Member

kba commented May 18, 2022

If --force-polling solves the problem for you, then sure, add it to the Makefile. You can also directly push it to master, no need for a PR. It's probably a bit less efficient in Linux which doesn't require polling but it's more important that it works for you.

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

2 participants