dask / dask-blog

Dask development blog

Home Page:https://blog.dask.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Env build not working on M1 mac

avriiil opened this issue · comments

Describe the issue:
I'm trying to contribute a blog but cannot build the ruby/jekyll software environment. Most likely because I'm on an M1 Mac.

Minimal Complete Verifiable Example:
conda install rb-commonmarker
OR
bundle install within the project directory

bundle install

partial output:

...
Installing nokogiri 1.13.9 (arm64-darwin)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/rpelgrim/mambaforge/envs/dask-blog/share/rubygems/gems/commonmarker-0.23.6/ext/commonmarker
/Users/rpelgrim/mambaforge/envs/dask-blog/bin/ruby -I /Users/rpelgrim/mambaforge/envs/dask-blog/lib/ruby/3.1.0 -r
./siteconf20221121-16691-jyr1nw.rb extconf.rb
creating Makefile

current directory: /Users/rpelgrim/mambaforge/envs/dask-blog/share/rubygems/gems/commonmarker-0.23.6/ext/commonmarker
make DESTDIR\= clean

current directory: /Users/rpelgrim/mambaforge/envs/dask-blog/share/rubygems/gems/commonmarker-0.23.6/ext/commonmarker
make DESTDIR\=
compiling arena.c
make: arm64-apple-darwin20.0.0-clang: No such file or directory
make: *** [arena.o] Error 1

make failed, exit code 2
...

Anything else we need to know?:

Environment:

  • Dask version: n/a
  • Ruby version: 3.1.2
  • Operating System: MacOS
  • Install method (conda, pip, source): conda / gem

@jacobtomlinson - I see you've most recently published a blog. Have you encountered anything like this?

Sorry I haven't tried building this on an M1 machine. Ruby headaches were one of the reasons why I moved my blog away from Jekyll a few years ago.

I use docker for building this blog on the occasions that I need to, it's not ideal but it works. I aliased jekyll to docker run -p 4000:4000 -v $(pwd):/site bretfisher/jekyll-serve.

I know @quasiben uses conda to manage jekyll things so maybe has some thoughts?

Thanks @jacobtomlinson - I suppose I could also just skip the local build and push straight to gh-pages with the draft tag set to True to see a rendered version. Or would you advise against that?

I'm also happy to build your PR locally and check that it looks ok if you aren't able to get your local install working.

@jacobtomlinson I wonder how easy it would be to get a build preview (e.g. through readthedocs) on PRs here. Maybe since we're using Jekyll it's not straightforward?

Ruby headaches were one of the reasons why I moved my blog away from Jekyll a few years ago.

Thoughts on switching the Dask blog to to something like, for example, Hugo?

@jacobtomlinson - PR is ready here #153
I ran it through an in-browser markdown renderer and it looks good but LMK if anything needs changing. Thanks for your help!

I tried this on an M1 machine, and also was not able to install some ruby packages from conda-forge:

  • rb-nokogiri
  • rb-commonmarker

I was sort-of able to get it working by trying these commands (from this tweet)

conda install -c conda-forge c-compiler compilers cxx-compiler
conda install -c conda-forge ruby
gem install jekyll bundler

and then

bundle install
bundle exec jekyll serve

There were a bunch of unhappy messages, but it did also output .html files to the _site folder. The output html files don't seem to know about the blog display theme, but they do show the contents.

Details:
(dask-blog) genevieb@ dask-blog % bundle exec jekyll serve
Configuration file: /Users/genevieb/Documents/GitHub/dask-blog/_config.yml
       Deprecation: The 'gems' configuration option has been renamed to 'plugins'. Please update your config file accordingly.
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
            Source: /Users/genevieb/Documents/GitHub/dask-blog
       Destination: /Users/genevieb/Documents/GitHub/dask-blog/_site
 Incremental build: enabled
      Generating...
     Build Warning: Layout 'nil' requested in atom.xml does not exist.
                    done in 3.227 seconds.
 Auto-regeneration: enabled for '/Users/genevieb/Documents/GitHub/dask-blog'
bundler: failed to load command: jekyll (/Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/bin/jekyll)
/Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:184:in `require_relative'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:184:in `setup'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:102:in `process'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:93:in `block in start'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:93:in `each'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:93:in `start'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/jekyll-3.9.2/exe/jekyll:15:in `<top (required)>'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/bin/jekyll:25:in `load'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/bin/jekyll:25:in `<top (required)>'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `load'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:23:in `run'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/cli.rb:486:in `exec'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/cli.rb:31:in `dispatch'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/cli.rb:25:in `start'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/exe/bundle:48:in `block in <top (required)>'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /Users/genevieb/mambaforge/envs/dask-blog/share/rubygems/gems/bundler-2.3.26/exe/bundle:36:in `<top (required)>'
	from /Users/genevieb/mambaforge/envs/dask-blog/bin/bundle:31:in `load'
	from /Users/genevieb/mambaforge/envs/dask-blog/bin/bundle:31:in `<main>'

Screen Shot 2022-11-22 at 1 30 05 pm

Edit: I don't see any problems with the formatting here, looks good to me.

Just in case anyone else stumbles across this issue: building the blog locally is not a requirement for contributing a blog post! Writing the markdown draft is enough 😄

Some people like to proofread things they contribute this way, which is fine. But you can always ask the reviewer to do it instead (like Jacob's done here), and it's also super easy to submit a correction/update PR to fix any wonky formatting. It's not a big deal either way.

I wonder how easy it would be to get a build preview

I use netlify on my personal blog for build previews and I think it would be a good option here. RTD would also work but might be overkill for this.

Thoughts on switching the Dask blog to to something like, for example, Hugo?

I would be very +1 on switching to Hugo, it's my favourite SSG by far and it's so fast and portable, working on themes does require some knowledge of the Go templating language though. We could also consider switching to Sphinx given that our community has strong Sphinx skills. Someone was advocating for the ablog Sphinx extension on Twitter recently (maybe @choldgraf?).

I've used both Hugo and Sphinx/ABlog, I like 'em both! I ended up using Sphinx for my personal blog because it's familiar to me and because I loved the idea of customizing with Python instead of Go (Hugo templates still confuse the crap outta me). I also liked the idea of upstreaming contributions to ABlog open source-style (it is maintained by the SunPy project), and that is much easier for me in Python than in Hugo (which is basically impossible for me to contribute to). But I think either is nice!

Quick note in case it helps, I'm able to run the blog locally on my M1 with ruby+jekyll if I do so without conda envs (not even using base).

I did need to install webrick separately because it's no longer included with ruby>3, ref: https://github.com/github/pages-gem/issues/752

I did:

  • Fresh ruby from homebrew: brew install ruby
  • gem install bundler
  • bundle install
  • bundle add webrick
  • bundle exec jekyll serve