adrian-thurston / ragel

Ragel State Machine Compiler
MIT License
533 stars 46 forks source link

Unable to Build Ragel 7.0.4, Colm 0.14.7 #78

Closed essandess closed 3 years ago

essandess commented 3 years ago

We’re trying to update ragel and colm on MacPorts, but there’s an apparently unresolvable conflict, and ragel fails to build with the errors:

Error: Failed to activate colm: Image error: /opt/local/lib/libfsm.a is being used by the active ragel port.  Please deactivate this port first, or use 'port -f activate colm' to force the activation.
:info:configure configure: error: check colm: expected version 0.13.0.7, but 0.1
4.7 is installed
:info:build make[3]: *** No rule to make target `/opt/local/lib/libfsm.la', needed by `ragel'.  Stop.

Because of this, we’ve had to roll back the colm 0.14.7 update.

Related:

adrian-thurston commented 3 years ago

The file has been moved from ragel to colm. Could you install the newer colm to another location to support the transition?

essandess commented 3 years ago

The file has been moved from ragel to colm. Could you install the newer colm to another location to support the transition?

No, because of this issue building ragel version 7.0.4:

:info:build make[3]: *** No rule to make target `/opt/local/lib/libfsm.la', needed by `ragel'.  Stop.
adrian-thurston commented 3 years ago

@essandess you need to use the --with-colm option when building ragel.

essandess commented 3 years ago

@essandess you need to use the --with-colm option when building ragel.

This issue is observed with the configure setting --with-colm=/opt/local.

adrian-thurston commented 3 years ago

@essandess I'm saying you need install colm to a unique location. Then set --with-colm appropriately when you build ragel. This really is a macports packaging issue and not a ragel issue so I am closing it here.

essandess commented 3 years ago

@adrian-thurston This issue is exhibited with colm version 0.14.7 installed.

The very same issue with the very same error message is reported on multiple, different systems in #70—both Linux and macOS.

I do not believe that this is a MacPorts issue, and that the issue should be reopened because at present there is no way to build the most recent ragel.

adrian-thurston commented 3 years ago

@essandess AFAIK, Ragel builds fine on a mac. The fact that it doesn't build with macports appears to me to be related to macport's rules about file ownership. It seems here the issue is upgrading over top older packages causes conflicts according to macport's rules. The thing to do is to install the new versions to a new location to avoid the conflict. Or uninstall the old version first. I don't know which is appropriate for macports.

essandess commented 3 years ago

@adrian-thurston I’m the one trying to update the MacPorts ragel port. The conflict over /opt/local/lib/libfsm.a Is trivial to resolve and I have done so.

The issue is the error encountered building ragel version 7.0.4 after colm version 0.14.7 is installed, encountered here and in #70:

No rule to make target/opt/local/lib/libfsm.la'`

This appears to be a Makefile issue.

I’ve done a lot of due diligence before posting this issue, and believe that this is an upstream issue, not a MacPorts or macOS issue.

If it helps, I’d be happy to post a log of the successful colm install, a list of the files installed, and the log of the failed ragel Install.

This is important because hyperscan depends upon ragel.

adrian-thurston commented 3 years ago

@essandess I don't know where that error comes from. That looks like a macport error, not a ragel build error. Ragel has no libfsm.a target with a path in it.

I just built the release tarballs fine on big sur. So I'm failing to see why this issue belongs in the ragel upstream.

essandess commented 3 years ago

Here are the relevant log files and contents of colm:

colm version 0.14.7: colm-main.log.gz ragel version 7.0.4 (fail): ragel-main.log.gz

port contents colm
Port colm contains:
  /opt/local/bin/colm
  /opt/local/bin/colm-wrap
  /opt/local/include/aapl/astring.h
  /opt/local/include/aapl/avlbasic.h
  /opt/local/include/aapl/avlcommon.h
  /opt/local/include/aapl/avlibasic.h
  /opt/local/include/aapl/avlikeyless.h
  /opt/local/include/aapl/avlimap.h
  /opt/local/include/aapl/avlimel.h
  /opt/local/include/aapl/avlimelkey.h
  /opt/local/include/aapl/avliset.h
  /opt/local/include/aapl/avlitree.h
  /opt/local/include/aapl/avlkeyless.h
  /opt/local/include/aapl/avlmap.h
  /opt/local/include/aapl/avlmel.h
  /opt/local/include/aapl/avlmelkey.h
  /opt/local/include/aapl/avlset.h
  /opt/local/include/aapl/avltree.h
  /opt/local/include/aapl/bstcommon.h
  /opt/local/include/aapl/bstmap.h
  /opt/local/include/aapl/bstset.h
  /opt/local/include/aapl/bsttable.h
  /opt/local/include/aapl/bubblesort.h
  /opt/local/include/aapl/buffer.h
  /opt/local/include/aapl/compare.h
  /opt/local/include/aapl/dlcommon.h
  /opt/local/include/aapl/dlist.h
  /opt/local/include/aapl/dlistmel.h
  /opt/local/include/aapl/dlistval.h
  /opt/local/include/aapl/insertsort.h
  /opt/local/include/aapl/mergesort.h
  /opt/local/include/aapl/quicksort.h
  /opt/local/include/aapl/resize.h
  /opt/local/include/aapl/rope.h
  /opt/local/include/aapl/sbstmap.h
  /opt/local/include/aapl/sbstset.h
  /opt/local/include/aapl/sbsttable.h
  /opt/local/include/aapl/svector.h
  /opt/local/include/aapl/table.h
  /opt/local/include/aapl/vector.h
  /opt/local/include/colm/bytecode.h
  /opt/local/include/colm/colm.h
  /opt/local/include/colm/colmex.h
  /opt/local/include/colm/config.h
  /opt/local/include/colm/debug.h
  /opt/local/include/colm/defs.h
  /opt/local/include/colm/input.h
  /opt/local/include/colm/internal.h
  /opt/local/include/colm/map.h
  /opt/local/include/colm/pdarun.h
  /opt/local/include/colm/pool.h
  /opt/local/include/colm/program.h
  /opt/local/include/colm/struct.h
  /opt/local/include/colm/tree.h
  /opt/local/include/colm/type.h
  /opt/local/include/libfsm/action.h
  /opt/local/include/libfsm/asm.h
  /opt/local/include/libfsm/common.h
  /opt/local/include/libfsm/dot.h
  /opt/local/include/libfsm/fsmgraph.h
  /opt/local/include/libfsm/gendata.h
  /opt/local/include/libfsm/ragel.h
  /opt/local/include/libfsm/redfsm.h
  /opt/local/lib/libcolm-0.14.7.dylib
  /opt/local/lib/libcolm.a
  /opt/local/lib/libcolm.dylib
  /opt/local/lib/libfsm-0.14.7.dylib
  /opt/local/lib/libfsm.a
  /opt/local/lib/libfsm.dylib
  /opt/local/share/doc/colm/0_00_welcome.html
  /opt/local/share/doc/colm/0_01_installing.html
  /opt/local/share/doc/colm/0_02_vim_syntax.html
  /opt/local/share/doc/colm/0_03_commandline.html
  /opt/local/share/doc/colm/0_04_hello_world.html
  /opt/local/share/doc/colm/0_05_fizzbuzz.html
  /opt/local/share/doc/colm/0_06_scope.html
  /opt/local/share/doc/colm/1_00_language_overview.html
  /opt/local/share/doc/colm/1_01_statements.html
  /opt/local/share/doc/colm/1_02_expressions.html
  /opt/local/share/doc/colm/1_03_control_flow.html
  /opt/local/share/doc/colm/1_04_functions.html
  /opt/local/share/doc/colm/1_05_variables.html
  /opt/local/share/doc/colm/1_06_iterators.html
  /opt/local/share/doc/colm/2_00_types.html
  /opt/local/share/doc/colm/2_01_basic.html
  /opt/local/share/doc/colm/2_02_list_map_struct_alias.html
  /opt/local/share/doc/colm/2_03_def.html
  /opt/local/share/doc/colm/3_00_language_transformation.html
  /opt/local/share/doc/colm/3_01_lex.html
  /opt/local/share/doc/colm/3_02_parse.html
  /opt/local/share/doc/colm/3_03_match.html
  /opt/local/share/doc/colm/3_04_undo.html
  /opt/local/share/doc/colm/3_05_reduction.html
  /opt/local/share/doc/colm/8_00_advanced_topics.html
  /opt/local/share/doc/colm/8_01_embedding.html
  /opt/local/share/doc/colm/8_02_modularity.html
  /opt/local/share/doc/colm/8_03_performance.html
  /opt/local/share/doc/colm/8_04_error_handling.html
  /opt/local/share/doc/colm/8_05_contributing.html
  /opt/local/share/doc/colm/9_00_q_and_a.html
  /opt/local/share/doc/colm/colm.vim
  /opt/local/share/ril.lm
  /opt/local/share/rlhc-c.lm
  /opt/local/share/rlhc-crack.lm
  /opt/local/share/rlhc-csharp.lm
  /opt/local/share/rlhc-d.lm
  /opt/local/share/rlhc-go.lm
  /opt/local/share/rlhc-java.lm
  /opt/local/share/rlhc-js.lm
  /opt/local/share/rlhc-julia.lm
  /opt/local/share/rlhc-main.lm
  /opt/local/share/rlhc-ocaml.lm
  /opt/local/share/rlhc-ruby.lm
  /opt/local/share/rlhc-rust.lm
  /opt/local/share/runtests
barracuda156 commented 2 years ago

@essandess AFAIK, Ragel builds fine on a mac. The fact that it doesn't build with macports appears to me to be related to macport's rules about file ownership. It seems here the issue is upgrading over top older packages causes conflicts according to macport's rules. The thing to do is to install the new versions to a new location to avoid the conflict. Or uninstall the old version first. I don't know which is appropriate for macports.

@adrian-thurston ragel builds fine on 10.6.8, but fails with the error mentioned above on new MacOS: https://github.com/macports/macports-ports/pull/15762

A5kar commented 2 years ago

Hi, I am having exactly the same issue on gentoo portage. ragel compilation fails as it is unable to find a rule for libcolm.la and libfsm.la. I noticed is that ragel's Makefile points to libcolm.la which in reality has been replaced with libcolm.dylib, since I already compiled ragel-7.0.4 without issues on my system... I suspect that what changed is colm, when it moved from previous version to 0.14.7 and replaced libcolm.la and libfsm.la with their dylib equivalents... Apart from this, @essandess could you please advise how I can solve the issue in the less painful way possible :)

barracuda156 commented 2 years ago

Hi, I am having exactly the same issue on gentoo portage. ragel compilation fails as it is unable to find a rule for libcolm.la and libfsm.la. I noticed is that ragel's Makefile points to libcolm.la which in reality has been replaced with libcolm.dylib, since I already compiled ragel-7.0.4 without issues on my system... I suspect that what changed is colm, when it moved from previous version to 0.14.7 and replaced libcolm.la and libfsm.la with their dylib equivalents... Apart from this, @essandess could you please advise how I can solve the issue in the less painful way possible :)

@A5kar You may borrow a fix from the PR I referred to. Or from the commit: https://github.com/macports/macports-ports/commit/cd2c9d0da801a359f456efc50a3aeeaf6dd86596

adrian-thurston commented 1 year ago

This is fixed in 463f4914057b0193c6ca025e9233c17035bc0448 where we are now falling back to using AC_CHECK_LIB for libfsm and libcolm.