Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#57852 closed defect (fixed)

monotone: error: const_cast from 'const real_pcre *' to 'pcre_t *'

Reported by: mojca (Mojca Miklavec) Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: monotone p5-monotone-automatestdio

Description

See logs from the buildbot:

src/pcrewrap.cc:107:25: error: const_cast from 'const real_pcre *' to 'pcre_t *' (aka 'real_pcre8_or_16 *') is not allowed
              pcre_free(const_cast<pcre_t *>(iter->second.first));
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/pcrewrap.cc:133:13: error: assigning to 'const struct real_pcre *' from incompatible type 'pcre_t *' (aka 'real_pcre8_or_16 *')
    basedat = pcre_compile2(pattern, flags_to_internal(options),
            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/pcrewrap.cc:138:22: error: no matching function for call to 'pcre_study'
    pcre_extra *ed = pcre_study(basedat, 0, &err);
                     ^~~~~~~~~~
/opt/local/include/pcre.h:633:27: note: candidate function not viable: cannot convert argument of incomplete type 'const struct real_pcre *' to 'const pcre_t *' (aka 'const real_pcre8_or_16 *')
PCRE_EXP_DECL pcre_extra *pcre_study(const pcre *, int, const char **);
                          ^
src/pcrewrap.cc:180:14: error: no matching function for call to 'pcre_exec'
    int rc = pcre_exec(basedat, extradat,
             ^~~~~~~~~

There are two existing ancient tickets for this port: #38515, #40277. The problem surfaced while trying to build perl modules: #57848.

Change History (4)

comment:1 Changed 2 months ago by mojca (Mojca Miklavec)

Port: p5-monotone-automatestdio added

comment:2 Changed 2 months ago by dbevans (David B. Evans)

Owner: set to dbevans
Resolution: fixed
Status: newclosed

In 6234fdee8be21da75e7b8cb0c24fc09a4c81623d/macports-ports (master):

monotone: fix build with pcre 8.42

See https://bugzilla.redhat.com/show_bug.cgi?id=1555231 for details.
Closes #57852.

comment:3 Changed 2 months ago by kencu (Ken)

Thanks Dave -- that does fix the build.

However after that, the tests fail for me firstly with a simple missing

#include <iostream>

in test/unit/tests/merge_3way.cc but then later on with this:

./run_func_tests
Running tests...
warning: [string "testlib.lua"]:1072: bad argument #2 to 'format' (number has no integer representation){ echo '#!/bin/sh';							  	\
	  echo 'export LANG=C';								  	\
	  echo 'PATH="/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_devel_monotone/monotone/work/monotone-1.1/.:/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_devel_monotone/monotone/work/monotone-1.1/./test/bin:$PATH"';	  		\
	  echo './test/bin/tester "./test/extra-testsuite.lua" "$@"';	\
	  echo 'echo $? > ./test/extra.status';			  	  	\
	  echo 'exit 0'; } > run_extra_tests && \
	chmod 755 run_extra_tests
./run_extra_tests
Running tests...
warning: [string "testlib.lua"]:1072: bad argument #2 to 'format' (number has no integer representation)============================================================
3 of 4 test suites malfunctioned
Please report to https://code.monotone.ca/p/monotone/issues/
make[3]: *** [check-testers] Error 1
make[2]: *** [check-am] Error 2
make[1]: *** [check-recursive] Error 1
make: *** [check] Error 2
Command failed:  cd "/opt/local/var/macports/build/_opt_macportsofficial_macports-ports_devel_monotone/monotone/work/monotone-1.1" && /usr/bin/make check 
Exit code: 2
Error: Failed to test monotone: command execution failed

and that last bunch doesn't look so pretty. A similar error is brought up here <https://bugzilla.redhat.com/show_bug.cgi?id=1185790>, and I presume in the end it will have something to do with lua version incompatibilities.

comment:4 Changed 2 months ago by mojca (Mojca Miklavec)

This in fact looks like lua 5.2 vs. 5.3 incompatibility (maybe a different version, but that doesn't change anything).

Note: See TracTickets for help on using tickets.