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

Env build not working on M1 mac #152

Open
avriiil opened this issue Nov 21, 2022 · 12 comments
Open

Env build not working on M1 mac #152

avriiil opened this issue Nov 21, 2022 · 12 comments

Comments

@avriiil
Copy link
Contributor

avriiil commented Nov 21, 2022

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
@avriiil
Copy link
Contributor Author

avriiil commented Nov 21, 2022

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

@jacobtomlinson
Copy link
Member

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.

@jacobtomlinson
Copy link
Member

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

@avriiil
Copy link
Contributor Author

avriiil commented Nov 21, 2022

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?

@jacobtomlinson
Copy link
Member

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.

@jrbourbeau
Copy link
Member

@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?

@avriiil
Copy link
Contributor Author

avriiil commented Nov 21, 2022

@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!

@GenevieveBuckley
Copy link
Collaborator

GenevieveBuckley commented Nov 22, 2022

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.

@GenevieveBuckley
Copy link
Collaborator

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.

@jacobtomlinson
Copy link
Member

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?).

@choldgraf
Copy link

choldgraf commented Nov 22, 2022

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!

@pavithraes
Copy link
Member

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

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

6 participants