Bug 254980 - www/nift: update to 2.4.12
Summary: www/nift: update to 2.4.12
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Rainer Hurling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-11 12:22 UTC by Mohammad S. Babaei
Modified: 2021-04-12 19:09 UTC (History)
1 user (show)

See Also:


Attachments
www/nift-2.4.11 to 2.4.12 patch file (6.45 KB, patch)
2021-04-11 12:22 UTC, Mohammad S. Babaei
info: maintainer-approval+
Details | Diff
log file of 11.4 build (broken) on Poudiere (14.44 KB, text/plain)
2021-04-11 15:28 UTC, Rainer Hurling
no flags Details
www/nift-2.4.11 to 2.4.12 patch file (4.12 KB, patch)
2021-04-11 15:41 UTC, Mohammad S. Babaei
info: maintainer-approval+
Details | Diff
www/nift-2.4.11 to 2.4.12 patch file (7.26 KB, patch)
2021-04-11 15:55 UTC, Mohammad S. Babaei
info: maintainer-approval+
Details | Diff
www/nift-2.4.11 to 2.4.12 patch file (7.77 KB, patch)
2021-04-11 20:13 UTC, Mohammad S. Babaei
no flags Details | Diff
www/nift-2.4.11 to 2.4.12 patch file (7.77 KB, patch)
2021-04-11 20:33 UTC, Mohammad S. Babaei
info: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mohammad S. Babaei 2021-04-11 12:22:09 UTC
Created attachment 224024 [details]
www/nift-2.4.11 to 2.4.12 patch file

Release Notes:

further improved line number tracing for errors
added get_pwd and pwd to embedded lua
updated to newer versions of LuaJIT 2.1.0-beta3 and ExprTk
Comment 1 Rainer Hurling freebsd_committer 2021-04-11 15:28:30 UTC
Created attachment 224026 [details]
log file of 11.4 build (broken) on Poudiere

Hi Mohammad,

Thanks for the patch. Trying it with Poudriere 11.4 (amd64 & i386) it fails to build (log file is attached).

Could you please investigate and report back? Thanks in advance :)
Comment 2 Mohammad S. Babaei 2021-04-11 15:29:31 UTC
Thank you very much! I'll take a look.
Comment 3 Rainer Hurling freebsd_committer 2021-04-11 15:31:12 UTC
BTW, FreeBSD versions > 11.x build fine (12.x, 13.x and CURRENT).
Comment 4 Mohammad S. Babaei 2021-04-11 15:32:40 UTC
Thank you, it seems this patch should work for 11.x.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250049

I'll test and make a new patch.
Comment 5 Mohammad S. Babaei 2021-04-11 15:41:54 UTC
Created attachment 224027 [details]
www/nift-2.4.11 to 2.4.12 patch file

Could you please test this?

I don't have 11.x or Poudriere. Thank you!
Comment 6 Mohammad S. Babaei 2021-04-11 15:55:58 UTC
Created attachment 224028 [details]
www/nift-2.4.11 to 2.4.12 patch file

Sorry, the previous patch had issues. This is the correct one to test.
Comment 7 Rainer Hurling freebsd_committer 2021-04-11 17:02:57 UTC
(In reply to Mohammad S. Babaei from comment #6)

I am afraid it is the exactly same error as without the new file patch-LuaJIT_src_lj__prng.c on Poudriere 11.x :(
Comment 8 Mohammad S. Babaei 2021-04-11 19:04:48 UTC
Thank you for testing it out. Then I guess I have to install 11.4 on a VM and test.
Comment 9 Rainer Hurling freebsd_committer 2021-04-11 19:53:41 UTC
(In reply to Mohammad S. Babaei from comment #8)

Finding the error within a VM might help you understand what is going wrong here. Debugger and other tools are also available in the VM :)
Comment 10 Mohammad S. Babaei 2021-04-11 20:13:22 UTC
Created attachment 224032 [details]
www/nift-2.4.11 to 2.4.12 patch file

I guess I have figured out what is wrong. I also had to pass a CFLAG. It won't fail in LuaJIT anymore. But, it fails within the Expr directory.

At least, I made some progress.
Comment 11 Mohammad S. Babaei 2021-04-11 20:15:57 UTC
Sorry, I forgot the log:

nsm.cpp:1496:20: warning: overlapping comparisons always evaluate to false [-Wtautological-overlap-compare]
                        if(noParams < 2 && noParams > 5)
                           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~
1 warning generated.
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__BUNDLED__ -D__LUAJIT_VERSION_2_1__ nsm.o ConsoleColor.o DateTimeInfo.o Directory.o Expr.o ExprtkFns.o Filename.o FileSystem.o Getline.o GitInfo.o HashTk.o Lolcat.o LuaFns.o Lua.o NumFns.o Pagination.o Parser.o Path.o ProjectInfo.o Quoted.o StrFns.o SystemInfo.o Title.o TrackedInfo.o Variables.o WatchList.o -o nsm -pthread ./LuaJIT/src/libluajit.a -ldl -lm
Expr.o: file not recognized: File format not recognized
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [Makefile:226: nsm] Error 1
gmake[2]: Leaving directory '/usr/home/mamadou/nift/work/nsm-2.4.12'
*** Error code 1

Stop.
make[1]: stopped in /usr/home/mamadou/nift
*** Error code 1

Stop.
make: stopped in /usr/home/mamadou/nift
Comment 12 Mohammad S. Babaei 2021-04-11 20:21:46 UTC
Could you explain, what Q= does in the port's Makefile from https://svnweb.freebsd.org/ports/head/lang/luajit-openresty/Makefile?view=markup&pathrev=551228

.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1200000
MAKE_ARGS+=     XCFLAGS=-DLJ_TARGET_HAS_GETENTROPY=0 Q=
.endif

I tried this in the LuaJIT Makefile:

+ifeq ($(detected_OS),FreeBSD)  #FreeBSD
+  ifeq ($(shell expr $(FREEBSD_VERSION) \< 12.0),1)
+    XCFLAGS+=-DLJ_TARGET_HAS_GETENTROPY=0
+    XCFLAGS+=Q\=
+  endif
+endif

And get:

gmake[4]: Entering directory '/usr/home/mamadou/nift/work/nsm-2.4.12/LuaJIT/src'
clang: error: no such file or directory: 'Q='
clang: error: no such file or directory: 'Q='
clang: error: no such file or directory: 'Q='
clang: error: no such file or directory: 'Q='
clang: error: no such file or directory: 'Q='
clang: error: no such file or directory: 'Q='
Makefile:290: *** Unsupported target architecture.  Stop.
gmake[4]: Leaving directory '/usr/home/mamadou/nift/work/nsm-2.4.12/LuaJIT/src'
gmake[3]: *** [Makefile:113: default] Error 2
gmake[3]: Leaving directory '/usr/home/mamadou/nift/work/nsm-2.4.12/LuaJIT'
gmake[2]: *** [Makefile:211: make-lua] Error 2
gmake[2]: Leaving directory '/usr/home/mamadou/nift/work/nsm-2.4.12'
*** Error code 1
Comment 13 Mohammad S. Babaei 2021-04-11 20:31:30 UTC
This is really odd. Somehow Expr.o gets corrupted on 11.x and the linker cannot link it.
Comment 14 Mohammad S. Babaei 2021-04-11 20:33:07 UTC
Created attachment 224033 [details]
www/nift-2.4.11 to 2.4.12 patch file

This is the latest patch I have played with.
Comment 15 Rainer Hurling freebsd_committer 2021-04-12 17:31:46 UTC
(In reply to Mohammad S. Babaei from comment #14)
> This is the latest patch I have played with.
Hmm, isn't this patch 224033 the same as 224032?


The Q args is used here to quiet messages, I think [1]. But I am not an expert in this things.

[1] https://stackoverflow.com/questions/36521268/what-is-the-meaning-of-q-in-makefile


Couldn't the corrupted Expr.o file be a consequence of the compiler choice? Maybe it helps to use a different compiler for the 11.x versions?
Comment 16 Mohammad S. Babaei 2021-04-12 19:01:40 UTC
> Hmm, isn't this patch 224033 the same as 224032?

I guess 99%. There were a few whitespace fixes.

> The Q args is used here to quiet messages, I think [1]. But I am not an expert in this things.

> [1] https://stackoverflow.com/questions/36521268/what-is-the-meaning-of-q-in-makefile

Thank you, I'll take a look.

> Couldn't the corrupted Expr.o file be a consequence of the compiler choice? Maybe it helps to use a different compiler for the 11.x versions?

Well, I created a pull request on GitHub with 2 commits (in order to do less patching on FreeBSD and Gentoo). According to the original developer, he reverted the latest LuaJIT changes. Soon, probably is going to be another release.

https://github.com/nifty-site-manager/nsm/pull/29

> I thought I had already fixed the LDFLAGS problem, sorry I'm not sure how that disaster managed to not get squashed already.

> I had trouble getting Snap to build Nift with the newer version of LuaJIT as well so already reverted that (it failed on amd64 and both types of arm leaving just i386 working as the others already don't work). I have just replaced the newer version with the official beta release in all my repo folders for the next release, some of the brew folks were being snarky about the LuaJIT version for Nift being outdated from the repo. I might make an issue on the LuaJIT repo about platform compatibility seeming to be shot with more recent versions, though if your PR fixes that even for FreeBSD maybe I should point this out to them?

> I've hopefully fixed a bunch of other issues that had creeped their way in more recently too, eg. line number tracing for error reporting, especially with functions/loops/structs/lua/exprtk/etc..
Comment 17 Rainer Hurling freebsd_committer 2021-04-12 19:09:22 UTC
(In reply to Mohammad S. Babaei from comment #16)
Thanks for the info. So we can wait a while for the upstream update ;)