Opened 5 months ago
Last modified 5 months ago
#73540 assigned defect
tree-sitter-markdown @0.5.3: cc1: error: unrecognized command line option "-std=c11"
| Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | amake (Aaron Madlon-Kay) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.12.1 |
| Keywords: | snowleopard | Cc: | |
| Port: | tree-sitter-markdown |
Description
tree-sitter-markdown fails to build:
---> Building tree-sitter-markdown DEBUG: Executing org.macports.build (tree-sitter-markdown) DEBUG: system -W /opt/local/var/macports/build/tree-sitter-markdown-39cb5924/work/tree-sitter-markdown-0.5.3: make all make -C tree-sitter-markdown all cc -Isrc -std=c11 -fPIC -c -o src/parser.o src/parser.c cc1: error: unrecognized command line option "-std=c11" make[1]: *** [src/parser.o] Error 1 make: *** [all] Error 2 Command failed: make all Exit code: 2
It isn't UsingTheRightCompiler or flags and it isn't requesting a C11-compatible compiler.
The former might be solved by removing this code from the Portfile...
build { system -W ${worksrcpath} "make all" }
...since the default action of the build phase is to run make all but with all the environment variables set correctly.
The second is solved by adding:
compiler.c_standard 2011
Note: See
TracTickets for help on using
tickets.

Replying to ryandesign:
That won't fix it, since the port includes the tree_sitter portgroup which has already overridden the build phase; with the way the portgroup is written, there's no way to get back the standard build phase.
Also, I was assuming the port ran a standard configure phase where the environment variables would have been recorded. However, the tree_sitter portgroup disables the configure phase, so the port will need to do its own thing to use the right compiler and flags.
The makefile portgroup can potentially help with this, if it doesn't conflict with the tree_sitter portgroup. For this to work, the tree_sitter portgroup might need to gain an option not to override the build phase that the port would set.