Bug 278203 - www/nift: update from 2.4.11 to 3.0.3
Summary: www/nift: update from 2.4.11 to 3.0.3
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL: https://nift.dev
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-06 18:21 UTC by yds
Modified: 2024-04-27 18:53 UTC (History)
2 users (show)

See Also:
info: maintainer-feedback+


Attachments
[UPGRADE] www/nift from 2.4.11 to 3.0.3 (7.06 KB, patch)
2024-04-06 18:21 UTC, yds
no flags Details | Diff
[UPGRADE] www/nift from 2.4.11 to 3.0.3 (7.22 KB, patch)
2024-04-06 18:27 UTC, yds
no flags Details | Diff
fixed-patch v2.4.11_1 to v3.0.3 (7.46 KB, patch)
2024-04-15 09:05 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 yds 2024-04-06 18:21:50 UTC
Created attachment 249770 [details]
[UPGRADE] www/nift from 2.4.11 to 3.0.3

this upgrade removes www/nift/files/patch-Makefile and upgrades www/nift to the latest version 3.0.3
Comment 1 yds 2024-04-06 18:27:18 UTC
Created attachment 249771 [details]
[UPGRADE] www/nift from 2.4.11 to 3.0.3

update WWW to Nift.dev
Comment 2 Mohammad S. Babaei 2024-04-07 03:35:02 UTC
Thank you for the patch!

However, two things:

1. The following is unnecessary:
PORTREVISION=	0

You could just remove the line.

2. I just ran applied the patch and ran a make and I get:

 make
===>  Building for nift-3.0.3
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o GitInfo.o GitInfo.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Expr.o Expr.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Variables.o Variables.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Lolcat.o Lolcat.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Lua.o Lua.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Pagination.o Pagination.cpp
In file included from Lua.cpp:1:
./Lua.h:41:12: fatal error: '/usr/local/include/luajit-2.1/lua.hpp' file not found
                #include "/usr/local/include/luajit-2.1/lua.hpp"
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
gmake: *** [Makefile:258: Lua.o] Error 1
gmake: *** Waiting for unfinished jobs....
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

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

Stop.
make: stopped in /usr/home/mamadou/www/nift


I will investigate this later when I have a bit more time since I haven't touched this port for quite a while. In the meantime feel free to submit a new patch if you feel you could fix it.
Comment 3 Mohammad S. Babaei 2024-04-07 03:35:31 UTC
Thank you for the patch!

However, two things:

1. The following is unnecessary:
PORTREVISION=	0

You could just remove the line.

2. I just ran applied the patch and ran a make and I get:

 make
===>  Building for nift-3.0.3
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o GitInfo.o GitInfo.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Expr.o Expr.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Variables.o Variables.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Lolcat.o Lolcat.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Lua.o Lua.cpp
clang -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity -s -Qunused-arguments -lstdc++ -D__LUAJIT_VERSION_2_1__ -c -o Pagination.o Pagination.cpp
In file included from Lua.cpp:1:
./Lua.h:41:12: fatal error: '/usr/local/include/luajit-2.1/lua.hpp' file not found
                #include "/usr/local/include/luajit-2.1/lua.hpp"
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
gmake: *** [Makefile:258: Lua.o] Error 1
gmake: *** Waiting for unfinished jobs....
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

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

Stop.
make: stopped in /usr/home/mamadou/www/nift


I will investigate this later when I have a bit more time since I haven't touched this port for quite a while. In the meantime feel free to submit a new patch if you feel you could fix it.
Comment 4 yds 2024-04-07 13:29:46 UTC
Regarding:
```
./Lua.h:41:12: fatal error: '/usr/local/include/luajit-2.1/lua.hpp' file not found
                #include "/usr/local/include/luajit-2.1/lua.hpp"
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
I built and installed the updated nift 3.0.3 on 5 separate boxen with luajit-openresty-2.1.20240314 as the dependency -- unable to reproduce this build failure. ¯\_(ツ)_/¯
Comment 5 Mohammad S. Babaei 2024-04-07 19:36:37 UTC
Well, it seems lang/luajit port on FreeBSD is version 2.0 and lang/luajit-devel is version 2.1:

https://cgit.freebsd.org/ports/tree/lang/luajit/Makefile

https://cgit.freebsd.org/ports/tree/lang/luajit-devel/Makefile

Though, somehow LUAJIT_LUAVER is set to 2.1.

PORTS_LUAJIT_MAKE_ARGS=		BUNDLED=0 LUAJIT_VERSION=${LUAJIT_LUAVER}

And, interestingly I don't have anything lua-related set in my make.conf as the cat output is empty:

cat /etc/make.conf | grep lua
Comment 6 yds 2024-04-07 19:52:25 UTC
(In reply to Mohammad S. Babaei from comment #5)

according to Mk/bsd.default-versions.mk on line 100:
LUAJIT_DEFAULT?=        luajit-devel

I believe you would need to explicitly set:
DEFAULT_VERSIONS+=      luajit=luajit
or
LUAJIT_DEFAULT?=        luajit
otherwise LUAJIT_LUAVER will default to 2.1

it seems like 2.0 is no longer the default and has to be explicitly chosen, having the plain old luajit port installed is not enough to change LUAJIT_LUAVER without explicitly adding luajit=luajit to DEFAULT_VERSIONS in make.conf
Comment 7 Mohammad S. Babaei 2024-04-15 09:05:35 UTC
Created attachment 249991 [details]
fixed-patch v2.4.11_1 to v3.0.3

OK, it seems luajit 2.0 has no maintainer and it emits this message when installed:

Installing luajit-2.0.5_7...
===>   NOTICE:

The luajit port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing


For some reason FreeBSD ports installs luajit-devel when you do USES=luajit but keeps the value of LUAJIT_LUAVER to 2.0 not 2.1. That's why we have to explicitly set it to 2.1.

This patch passes all tests on my side.
Comment 8 Mohammad S. Babaei 2024-04-15 09:07:26 UTC
Comment on attachment 249771 [details]
[UPGRADE] www/nift from 2.4.11 to 3.0.3

This patch is broken.
Comment 9 Zsolt Udvari freebsd_committer freebsd_triage 2024-04-27 18:16:41 UTC
Is it any reason to (optionally) use bundled lua/luajit? See https://docs.freebsd.org/en/books/porters-handbook/book/#bundled-libs-why-bad

What do you think about lua:flavors? See https://docs.freebsd.org/en/books/porters-handbook/book/#lua-version-flavors
Your Makefile would be cleaner and will build and available in package repositories with every lua version.
I suggest it.