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

commonmarker not installing on FreeBSD (expecting GNU make?) #343

Open
duncan-bayne opened this issue Jan 16, 2025 · 3 comments
Open

commonmarker not installing on FreeBSD (expecting GNU make?) #343

duncan-bayne opened this issue Jan 16, 2025 · 3 comments

Comments

@duncan-bayne
Copy link

Hi :) First up, thanks for commonmarker 💖 It's been very helpful, and installs and works just fine on GNU/Linux.

However, installing the commonmarker Gem on FreeBSD fails.

repro steps

Running gem install commonmarker produces:

Building native extensions. This could take a while...
ERROR:  Error installing commonmarker:
	ERROR: Failed to build gem native extension.

    current directory: /home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker
/home/duncan/.rbenv/versions/3.4.1/bin/ruby extconf.rb
checking for clang... yes
checking for clang++... yes
checking for llvm-ar... yes
checking for cargo... yes
checking for install_name_tool... no

current directory: /home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker
make DESTDIR\= sitearchdir\=./.gem.20250116-32201-hzaxz9 sitelibdir\=./.gem.20250116-32201-hzaxz9 clean
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 8: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 10: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 20: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 22: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 24: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 31: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 32: warning: duplicate script for target "ifneq" ignored
make: "Makefile" line 9: warning: using previous script for "ifneq" defined here
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 33: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 35: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 270: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 271: warning: duplicate script for target "ifneq" ignored
make: "Makefile" line 9: warning: using previous script for "ifneq" defined here
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 271: warning: duplicate script for target "(,)" ignored
make: "Makefile" line 32: warning: using previous script for "(,)" defined here
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 272: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 530: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 535: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 537: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 541: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 543: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 545: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 564: Invalid line type
make: Fatal errors encountered -- cannot continue
make: stopped in /home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker

current directory: /home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker
make DESTDIR\= sitearchdir\=./.gem.20250116-32201-hzaxz9 sitelibdir\=./.gem.20250116-32201-hzaxz9
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 8: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 10: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 20: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 22: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 24: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 31: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 32: warning: duplicate script for target "ifneq" ignored
make: "Makefile" line 9: warning: using previous script for "ifneq" defined here
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 33: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 35: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 270: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 271: warning: duplicate script for target "ifneq" ignored
make: "Makefile" line 9: warning: using previous script for "ifneq" defined here
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 271: warning: duplicate script for target "(,)" ignored
make: "Makefile" line 32: warning: using previous script for "(,)" defined here
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 272: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 530: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 535: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 537: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 541: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 543: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 545: Invalid line type
make: "/home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker/Makefile" line 564: Invalid line type
make: Fatal errors encountered -- cannot continue
make: stopped in /home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1/ext/commonmarker

make failed, exit code 1

Gem files will remain installed in /home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/commonmarker-2.0.2.1 for inspection.
Results logged to /home/duncan/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/extensions/x86_64-freebsd-14/3.4.0/commonmarker-2.0.2.1/gem_make.out

workaround

I suspect what's happening here is that commonmarker is expecting GNU make, not BSD make. If I install with:

make=gmake gem install commonmarker

... then everything works as intended, and the Gem installs.

versions

  • FreeBSD 14.2-RELEASE
  • ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-freebsd14.1]
  • cargo 1.83.0 / rustc 1.83.0
@kivikakk
Copy link
Collaborator

Hi @duncan-bayne! (context for @gjtorikian: we are coworkers.)

This appears to be an issue with rb-sys, which we use for compiling Ruby native extensions built with Rust; see oxidize-rb/rb-sys#381 for similar.

Most likely we'd need to write and upstream the fix ourselves.

@duncan-bayne
Copy link
Author

Wild @kivikakk appeared!

Yeah you're right - I'll have a look at this on the weekend, I think. For now will just work around it.

@kivikakk
Copy link
Collaborator

If you want a hand, throw me a message on Mattermost (I'll bring up a FreeBSD VM) and we can have a look together.

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