rubensworks / ScholarMarkdown

A framework for writing markdown-based scholarly articles.
MIT License
42 stars 8 forks source link

Add support for M1 Apple Silicon Macs #29

Closed smessie closed 2 years ago

smessie commented 2 years ago

It actually looks like those (manual) changes in the lock file and gem spec are not required after all. I removed them again and it looks like it is still working on my machine. They just have to be both in the lock file and I think the install_if in the Gemfile just handles it fine then.

rubensworks commented 2 years ago

Thanks! Released as 2.11.0.

RubenVerborgh commented 2 years ago

Does not work on my M1 MacBook:

An error occurred while installing libv8 (3.16.14.19), and Bundler cannot continue.

In Gemfile:
  scholarmarkdown was resolved to 2.11.0, which depends on
    therubyracer was resolved to 0.12.3, which depends on
      libv8

Note how it's still trying to install therubyracer despite 2.11.0

rubensworks commented 2 years ago

Did you run into this problem @smessie?

smessie commented 2 years ago

Yeah, I ran into many problems including that one, and tried quite some things before coming to the final solution. So it might be that some previous tries had influence on my final solution. Though, does it work if you first manually install mini_racer with gem install mini_racer and then run bundle install again?

RubenVerborgh commented 2 years ago

Though, does it work if you first manually install mini_racer with gem install mini_racer and then run bundle install again?

It does not. (Note that I am installing scholarmarkdown as a dependency to another.)

Could we either:

rubensworks commented 2 years ago

Make mini_racer the default and fallback for old Linux?

Sure, I'm fine with that one!

RubenVerborgh commented 2 years ago

@smessie Could you take this up?

smessie commented 2 years ago

@smessie Could you take this up?

I don't really know how that fallback would work though, never worked with Gem files before

RubenVerborgh commented 2 years ago

I think the is_mac = RUBY_PLATFORM.include?('darwin') is failing; can we replaced it by a condition that is more likely to be false, something like is_old_linux or so?

But does gem install scholarmarkdown work for you now then?

RubenVerborgh commented 2 years ago

Seems like there's incorrect information in the registry:

$ curl -s https://index.rubygems.org/info/scholarmarkdown | tail -n 1
2.11.0 bibmarkdown:~> 2.0.0,bibtex-ruby:>= 0,citeproc-ruby:>= 1.1.6,csl-styles:>= 0,execjs:>= 0,i18n:>= 0,katex:>= 0,kramdown-math-sskatex:>= 0,latex-decode:>= 0,libv8-node:= 16.10.0.0,mini_racer:>= 0,puma:>= 0,sskatex:>= 0,therubyracer:>= 0|checksum:0caa9cb72866e0eaa63cc25753dc01875217f96a0844d9d6ac18adc82a5abd58

so the install_if is simply not seen (therubyracer is there).

smessie commented 2 years ago

Explicitly running gem install scholarmarkdown also errors for me. But bundle install does not when using gem 'scholarmarkdown', github: 'smessie/ScholarMarkdown', branch: 'mac-m1-support' in my Gemfile (so using GitHub instead of the registry). Undoing that and using the default gem 'scholarmarkdown' results in bundle install failing as well.

Looks like the issue is related with the registry and likely related with your last comment that install_if is not seen in the registry, but probably is, using GitHub.

RubenVerborgh commented 2 years ago

@rubensworks Can we drop old Linux versions?

rubensworks commented 2 years ago

Sure, but we'll have to do a major version bump then.

smessie commented 2 years ago

Shall I make a PR? Are you going to do the version bump yourself or should I include it?

RubenVerborgh commented 2 years ago

Fine with me (but not sure if this is the rule for gems), thanks!