Bug 259177 - lang/swi-pl update from 8.2.3 to 8.4.0-1
Summary: lang/swi-pl update from 8.2.3 to 8.4.0-1
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-15 03:22 UTC by dewayne
Modified: 2021-12-13 06:51 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (mailinglist)


Attachments
Update to 8.4.0 (88.45 KB, text/plain)
2021-10-15 07:23 UTC, Wen Heping
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2021-10-15 03:22:09 UTC
swipl 8.4.0-1 has a lot of functional improvements, including enhancements:
- protobuf package
- redis client ability
For more refer: https://www.swi-prolog.org/ChangeLog?branch=stable
Comment 1 Wen Heping freebsd_committer freebsd_triage 2021-10-15 07:23:47 UTC
Created attachment 228713 [details]
Update to 8.4.0

Here is a patch, it build well on amd64 but failed on i386.
Comment 2 Nikolaj Thygesen 2021-10-17 13:32:48 UTC
I tried out Wens patch on my own (amd64) box, and it builds and works fine. I don't know if I'm supposed to do anything more!? I would be curious to see the results of an i386 build in case there's something we can do, but releasing this initial patch would be great.
Comment 3 Nikolaj Thygesen 2021-10-31 23:08:09 UTC
I just got a reminder that this one requires my action, but I have no clue what action to take! The patch works fine for me on amd64, and I don't know about any specific issues on other architectures. What should I do?
Comment 4 Wen Heping freebsd_committer freebsd_triage 2021-11-01 02:15:18 UTC
The last lines of the build log on i386 system:

...
[ 90% 2213/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/dicts.tex --summaries 'library(dicts)'
[ 90% 2214/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/debug.tex --summaries 'library(debug)'
[ 90% 2215/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/dcghighorder.tex --summaries 'library(dcg/high_order)'
[ 90% 2216/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/dcgbasics.tex --summaries 'library(dcg/basics)'
[ 90% 2217/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/packages/chr && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs --nopce -q -s /wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/packages/chr/chr_swi_bootstrap.pl -p "chr=/wrkdirs/usr/ports/lang/swi-pl/work/.build/packages/chr:/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/packages/chr" -g "chr_compile_step3('/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/packages/chr/guard_entailment.chr','guard_entailment.pl')" -t halt
[ 90% 2218/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /usr/local/bin/cmake -E make_directory lib && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs /wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man/doc2tex.pl /wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man/lib//clpqr.doc lib//clpqr.tex
[ 90% 2219/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/csv.tex --summaries 'library(csv)'
[ 90% 2220/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/clpfdlib.tex --lib=clpfd --module=clpfd --summaries 'lib/clpfdlib.md'
FAILED: man/lib/clpfdlib.tex man/lib/summaries.d/clpfdlib.tex /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/lib/clpfdlib.tex /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/lib/summaries.d/clpfdlib.tex 
cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/clpfdlib.tex --lib=clpfd --module=clpfd --summaries 'lib/clpfdlib.md'
[ 90% 2220/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /usr/local/bin/cmake -E make_directory lib && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs /wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man/doc2tex.pl /wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man/lib//clpfd.doc lib//clpfd.tex
[ 90% 2220/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /usr/local/bin/cmake -E make_directory lib && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs /wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man/doc2tex.pl /wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man/lib//clpb.doc lib//clpb.tex
[ 90% 2220/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/clpblib.tex --lib=clpb --module=clpb --summaries 'lib/clpblib.md'
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/swi-pl
build of lang/swi-pl | swi-pl-8.4.0 ended at Mon Nov  1 10:08:56 CST 2021
build time: 00:03:04
!!! build failure encountered !!!
Comment 5 dewayne 2021-11-10 07:00:11 UTC
(In reply to Wen Heping from comment #4)
Thank-you Wen Heping.  I had some challenges because I hadn't yet moved to git and our portrevision was 1 not 3.  Regardless, on FreeBSD 12.2Stable and building with gcc10 (gcc-10.2.0), I have 
# swipl -g version.
Welcome to SWI-Prolog (threaded, 32 bits, version 8.4.0)
and
# swipl -g version
Welcome to SWI-Prolog (threaded, 64 bits, version 8.4.0)

We build most of our ports using gcc, because that's what most developers use.

As an FYI, we take advantage of FreeBSD's implementation of ASLR on production systems where SWI-PL 8.4.0 is now installed, we also build with O3 and LDFLAGS=
-Wl,--strip-debug -Wl,--build-id=md5 -Wl,--hash-style=sysv -pie -Wl,-z,notext -z notext -z relro -z now -Wl,-rpath=/usr/local/lib/gcc10 -L/usr/local/lib/gcc10

swi-pl passed our tests which includes "extras" like threads, clpfd, external tables, yaml and now redis :) 

-------------  As an FYI, ...
We attempted to build using clang, but retained the gcc CFLAGS, some of which don't work with clang.  

On i386 with clang 10.0.1 fails with:

306/930] /usr/bin/cc  -Isrc -I/var/ports/usr/ports/lang/swi-pl/work/swipl-8.4.0/src
...
-c /var/ports/usr/ports/lang/swi-pl/work/swipl-8.4.0/src/pl-thread.c
FAILED: src/CMakeFiles/swiplobjs.dir/pl-thread.c.o

/var/ports/usr/ports/lang/swi-pl/work/swipl-8.4.0/src/pl-thread.c:1740:31: error: too few arguments to function call, expected 2, have 1
  if ( pthread_setname_np(name) == 0 )
       ~~~~~~~~~~~~~~~~~~     ^
/usr/include/pthread.h:306:1: note: 'pthread_setname_np' declared here
int             pthread_setname_np(pthread_t, const char *);
^
1 error generated.
ninja: build stopped: subcommand failed.
*** Error code 1

--------------
Back to amd64 build using clang 10.0.1
[105/930] /usr/bin/cc -Dplugin_time_EXPORTS -Ipackages/clib -I/var/ports/usr/ports/lang/swi-pl/work/swipl-8.4.0/src/os
...
-c /var/ports/usr/ports/lang/swi-pl/work/swipl-8.4.0/packages/clib/time.c

/var/ports/usr/ports/lang/swi-pl/work/swipl-8.4.0/packages/clib/time.c:158:33: error: void function 'print_trace' should not return a value [-Wreturn-type]
static void print_trace (void) {return(0);} /* Kludge: FreeBSD doesnt have backtrace in glibc */
                                ^     ~~~
1 error generated.
ninja: build stopped: subcommand failed.
*** Error code 1

=========== The following were my initial build attempts where I had these problems, which are probably of my own doing (because I hadn't moved to portrevision=3

===>  Building package for swi-pl-8.4.0
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/chr-warnings-and-errors.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/debug-determinism.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/increval.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/portraytext.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/prologdebug.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/ssu.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/string.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/tabling-monotonic.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/Manual/terms.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/packages/mqi.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/packages/redis.html:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/us                     r/local/lib/swipl/doc/packages/stomp.html:No such file or directory
*** Error code 1

After some minor changes, we're very happy and I'm glad that it works.  Thank-you.
Comment 6 dewayne 2021-11-10 23:05:54 UTC
(In reply to Wen Heping from comment #4)
Wen Heping, 
Would you attempt to build on i386 and paste the output from your build with MAKE_JOBS_UNSAFE, so we can see where and perhaps why, the compilation fails?
make -C /usr/ports/lang/swi-pl -DMAKE_JOBS_UNSAFE clean package

Also would you include CFLAGS and LDFLAGS?  Something like 
make -C /usr/ports/lang/swi-pl -VCFLAGS -VLDFLAGS
also display your selected options
make -C /usr/ports/lang/swi-pl showconfig

FYI: I'd also customised my build with 
# make -C /usr/ports/lang/swi-pl -VCONFIGURE_ARGS
--with-world --disable-gmp --disable-libdirversion --without-gpl --without-lgpl --enable-shared
Comment 7 Wen Heping freebsd_committer freebsd_triage 2021-11-11 00:34:27 UTC
(In reply to dewayne from comment #6)
I email you the whole build log.
Comment 8 Wen Heping freebsd_committer freebsd_triage 2021-11-11 00:36:41 UTC
(In reply to Nikolaj Thygesen from comment #3)
I shall commit the update to 8.4.0 with maintainer's approvement,
since swi-pl is marked BROKEN with i386 currently.
Comment 9 dewayne 2021-11-11 01:17:01 UTC
(In reply to Wen Heping from comment #8)
Thanks Wen Heping.  I enabled DOC and MAN on i386 but was successful with the build.  From the last line of your pouderie log 
[ 90% 2204/2445] cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/clpfdlib.tex --lib=clpfd --module=clpfd --summaries 'lib/clpfdlib.md'
FAILED: man/lib/clpfdlib.tex man/lib/summaries.d/clpfdlib.tex /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/lib/clpfdlib.tex /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/lib/summaries.d/clpfdlib.tex 
cd /wrkdirs/usr/ports/lang/swi-pl/work/.build/man && /wrkdirs/usr/ports/lang/swi-pl/work/.build/src/swipl -f none --no-packs -x /wrkdirs/usr/ports/lang/swi-pl/work/.build/man/pldoc2tex -- --source=/wrkdirs/usr/ports/lang/swi-pl/work/swipl-8.4.0/man --out=lib/clpfdlib.tex --lib=clpfd --module=clpfd --summaries 'lib/clpfdlib.md'
ninja: build stopped: subcommand failed.
*** Error code 1
it looks like a tex (pldoc2tex?) issue.  Finally because you're running a FreeBSD14 kernel, I'm not able to reproduce your environment.  Sorry.
Comment 10 dewayne 2021-11-11 01:18:32 UTC
(In reply to Nikolaj Thygesen from comment #3)
If Wen's patch applies cleanly in your environment, then I would make it available for others.  I have swipl running on FreeBSD 12.2S on both amd64 and i386.  Cheerio.
Comment 11 Nikolaj Thygesen 2021-11-15 00:17:19 UTC
I would very much like to make wens patch available; am I supposed to submit wens patch!?!?
Comment 12 Nikolaj Thygesen 2021-11-15 00:22:58 UTC
(In reply to dewayne from comment #5)
You mentioned a bunch of test cases passing; did you by any chance run the pengines tests? They have "always" failed for me, but since I don't need them, it hasn't been a major concern of mine.
Comment 13 Nikolaj Thygesen 2021-11-15 00:29:11 UTC
(In reply to Wen Heping from comment #4)

The initial issues encountered when building swipl with clang-i386 were missing implementations of 64-bit atomics in 32-bit compilers, so I don't see much reason to dwell on that build for now - perhaps if we ever get them in clang, as they seem to exist in gcc - at least dewayne has swipl-threaded running in 32 bit!?
Comment 14 Nikolaj Thygesen 2021-11-23 09:39:46 UTC
... in the meantime swipl was updated to 8.4.1 including a couple of fixes. I hope it's pretty much a drop-in replacement for 8.4.0
Comment 15 dewayne 2021-11-26 08:11:19 UTC
(In reply to Nikolaj Thygesen from comment #14)
Nikolaj,
I changed the DISTVERSION from 8.4.0 to 8.4.1, then performed
# make -C /usr/ports/lang/swipl makesum
# make -C /usr/ports/lang/swipl clean package with this result.

===>  Building package for swi-pl-8.4.1
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/usr/local/lib/swipl/lib/amd64-freebsd/libswipl.so.8.4.0:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/usr/local/lib/swipl/library/protobufs/protoc_gen_prolog_pb/google/protobuf/INDEX.pl:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/usr/local/lib/swipl/library/protobufs/protoc_gen_prolog_pb/google/protobuf/compiler/INDEX.pl:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/usr/local/lib/swipl/library/protobufs/protoc_gen_prolog_pb/google/protobuf/compiler/plugin_pb.pl:No such file or directory
pkg-static: Unable to access file /var/ports/usr/ports/lang/swi-pl/work/stage/usr/local/lib/swipl/library/protobufs/protoc_gen_prolog_pb/google/protobuf/descriptor_pb.pl:No such file or directory
*** Error code 1

I found the last entry (using find) here
/var/ports/usr/ports/lang/swi-pl/work/stage/usr/local/lib/swipl/library/protobufs/gen_pb/google/protobuf/descriptor_pb.pl

So I changed protoc_gen_prolog_pb to gen_pb, and 8.4.0 to 8.4.1 in pkg_list via 
# sed -i '' -e "s|protoc_gen_prolog_pb|gen_pb|g" -e "s|8\.4\.0|8\.4\.1|g" /usr/ports/lang/swi-pl/pkg-plist
then 
# make clean package install

# swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.4.1)

# swipl
Welcome to SWI-Prolog (threaded, 32 bits, version 8.4.1)

on FreeBSD 12.2-STABLE #1 r369922M

--- 
Unfortunately I wasn't able to find examples to easily use pengines without spending a lot of time learning about it, so we'll have to park that functionality as I haven't a need for it either.

I have a similar problem with uuid/2 (and /1) generating a segfault.  Otherwise - I'm very happy with swipl ;)

Please note that I do use a cut-down swipl Makefile as I only use the CLI, and no: gpl, lgpl, gmp; yes I also comment out libossp-uuid.so.
Comment 16 Nikolaj Thygesen 2021-11-26 16:36:25 UTC
This may all make some kind of sense, as the pengines, if I call recall correctly, uses uuid's, and so if they segfault, obviously pengines will fail. I believe I struggled quite a bit with uuid's back in the day - the whole cmake stuff surrounding them, seemed quite messy... also I remember seeing comments on them recently.

If you and Wen could join forces and get 8.4.1 released preliminarily, I will follow up once I've had another look at and hopefully reworked uuid' - how does that sound?
Comment 17 Wen Heping freebsd_committer freebsd_triage 2021-12-13 06:51:10 UTC
Superceded by 260351.