Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erlexec compile failing on FreeBSD 14 #3803

Closed
seannaswell opened this issue Jun 30, 2024 · 7 comments
Closed

Erlexec compile failing on FreeBSD 14 #3803

seannaswell opened this issue Jun 30, 2024 · 7 comments

Comments

@seannaswell
Copy link
Contributor

seannaswell commented Jun 30, 2024

Zotonic version

git master

OS / Browser version

FreeBSD 14

Updated to current master and compiled. Erlexec fails with the messages below.

Had a similar issue previously which was related to Erlexec and FreeBSD support, wondering if the errors below are also related to FreeBSD, or something Zotonic specific.

FreeBSD 14
Erlang 25.3.2.12

===> Verifying dependencies...                                                                                       
gmake[1]: Entering directory '/usr/home/zotonic/zotonic/_build/default/lib/bcrypt/c_src'                             
gmake[1]: Nothing to be done for 'all'.                                                                              
gmake[1]: Leaving directory '/usr/home/zotonic/zotonic/_build/default/lib/bcrypt/c_src'                              
===> Compiling c_src/eiconv_nif.c 
gmake[1]: Entering directory '/usr/home/zotonic/zotonic/_build/default/lib/erlexec/c_src'                                                                                                                                                      
mkdir -p "/usr/home/zotonic/zotonic/_build/default/lib/erlexec/priv/x86_64-unknown-freebsd14.0/"                       
c++ ei++.o exec.o exec_impl.o  -L/usr/local/lib/erlang/lib/erl_interface-5.3.2.1/lib -lei -o /usr/home/zotonic/zotonic/_build/default/lib/erlexec/priv/x86_64-unknown-freebsd14.0/exec-port                                                    
ld: error: undefined symbol: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>::compare(char const*) const                                                                                                        
>>> referenced by basic_string.h:3609 (/usr/local/lib/gcc12/include/c++/bits/basic_string.h:3609)                      
>>>               ei++.o:(ei::stringIndex(char const**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int, int))                                                                                      
                                                                                                                                                                                                                                               
ld: error: undefined symbol: std::basic_ostream<char, std::char_traits<char>>& std::__ostream_insert<char, std::char_traits<char>>(std::basic_ostream<char, std::char_traits<char>>&, char const*, long)                                       
>>> referenced by ostream:620 (/usr/local/lib/gcc12/include/c++/ostream:620)                                                                                                                                                                   
>>>               ei++.o:(ei::Serializer::print(std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&))                                                                                         
>>> referenced by basic_string.h:3896 (/usr/local/lib/gcc12/include/c++/bits/basic_string.h:3896)                      
>>>               ei++.o:(ei::Serializer::print(std::ostream&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&))                                                                                         
>>> referenced by ostream:620 (/usr/local/lib/gcc12/include/c++/ostream:620)                                                                                                                                                                   
>>>               ei++.o:(ei::dump(std::ostream&, unsigned char const*, int, bool))                                    
>>> referenced 12 more times                     

Many, many more of the same, finishing with:

ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
c++: error: linker command failed with exit code 1 (use -v to see invocation)              
gmake[1]: *** [Makefile:126: /usr/home/zotonic/zotonic/_build/default/lib/erlexec/priv/x86_64-unknown-freebsd14.0/exec-port] Error 1
gmake[1]: Leaving directory '/usr/home/zotonic/zotonic/_build/default/lib/erlexec/c_src' 
@mworrell
Copy link
Member

mworrell commented Jul 1, 2024

Hi @seannaswell,

I just tried compiling erlexec on FreeBSD (Aarch64 in Parallels on a M1 Mac) and that worked well, so it seems. I cloned it from here https://github.com/saleyn/erlexec

Somehow a compile of Zotonic itself stops at this error, which I don't understand yet.

Screenshot 2024-07-01 at 09 27 15

Maybe later in the week I have some time to dig into that one.

Could you check if erlexec from git compiles on your machine?

@mworrell
Copy link
Member

mworrell commented Jul 1, 2024

On a parallel note, I just plugged the first part of your error into Kagi and found this page:

https://stackoverflow.com/questions/67259454/undefined-reference-to-std-cxx11basic-stringchar-stdchar-traitschar

Maybe worth a try, or just random noice.

@seannaswell
Copy link
Contributor Author

seannaswell commented Jul 1, 2024

Actually I am getting exactly what your screenshot shows. I updated the issue shortly after opening, adding the opening lines to provide some context...

Edit: not "exactly" what you are seeing, but likely the same cause. Will test Erlexec and follow-up.

@seannaswell
Copy link
Contributor Author

Okay, did some testing with a ZFS clone of a Zotonic jail...

Updated to the latest Zotonic git, and attempted to compile, which results in the errors seen above.

Then a rm -r ~/zotonic/_build/default/lib/erlexec removes the existing erlexec install, and running gmake causes Zotonic to fetch and install erlexec again, and the build completes successfully.

When testing I first cloned the git repo of Erlexec into the ~/zotonic/_build/default/lib directory and the build succeeded, but just wanted to see what happened if Zotonic tried to fetch a fresh copy, and surprisingly that worked.

At least it worked for me...

@seannaswell
Copy link
Contributor Author

Not sure how many people use Zotonic on FreeBSD, and whether it makes sense to investigate further if this is a FreeBSD specific issue. Also not certain why deleting the erlexec build folder works, but it has on several VM's.

I can do further tests if helpful, otherwise feel free to close this issue...

Thanks for taking the time to fire up a FreeBSD VM and point me in the right direction, very helpful and much appreciated.

@mworrell mworrell changed the title Erlexec compile failing Erlexec compile failing on FreeBSD 14 Jul 15, 2024
@mworrell
Copy link
Member

For now I will just close this :-) Let's revisit when the compile acts up again.

@seannaswell
Copy link
Contributor Author

Agree, and unfortunately not much else I can add. It did happen on another VM, but removing the Erlexec folder and letting GMake fetch and compile a fresh copy worked.

Did some testing using various combinations of Erlang/Postgres and GCC versions (GCC 12.5 is default, but 13 supported on FreeBSD), and the results were not conclusive. Since nobody else chimed in and the solution above worked, I did not look further.

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants