Compile patch for solaris #3456

Closed
panosdim opened this Issue Oct 14, 2016 · 31 comments

Comments

Projects
None yet
5 participants
@panosdim

I am trying to compile fish-2.3.1 in solaris

xigpadi  edeacts0703  ~  $ uname -a
SunOS edeacts0703 5.10 Generic_147147-26 sun4u sparc SUNW,SPARC-Enterprise

and the following patch is need in order to successful compile. Can this patch included in the source code for next release?

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Oct 14, 2016

Member

At least some of this has already been included - would you be able to try against the current Git master? There is some work being done on Solaris-derived platforms in #3340.

Member

zanchey commented Oct 14, 2016

At least some of this has already been included - would you be able to try against the current Git master? There is some work being done on Solaris-derived platforms in #3340.

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Oct 14, 2016

I am trying to compile from git master but i get an error in configure

 xigpadi  edeacts0703  ~/f/p/fish-shell-master  $ autoconf
 xigpadi  edeacts0703  ~/f/p/fish-shell-master  $ ./configure
configure: error: cannot find sources (fish) in . or ..

Can anyone help?

I am trying to compile from git master but i get an error in configure

 xigpadi  edeacts0703  ~/f/p/fish-shell-master  $ autoconf
 xigpadi  edeacts0703  ~/f/p/fish-shell-master  $ ./configure
configure: error: cannot find sources (fish) in . or ..

Can anyone help?

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Oct 14, 2016

Member

That's usually a permissions problem, from what I can see from Google. autoconf; ./configure works ok for me here on Solaris 11.

Member

zanchey commented Oct 14, 2016

That's usually a permissions problem, from what I can see from Google. autoconf; ./configure works ok for me here on Solaris 11.

@krader1961 krader1961 added the question label Oct 14, 2016

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Oct 17, 2016

In order for configure to work i had to create a folder fish and put the src folder inside it.
However not the make command hit new errors:

src/builtin.cpp: In function 'void builtin_print_help(parser_t&, io_streams_t&, const wchar_t*, output_stream_t&)':
src/builtin.cpp:166:36: error: 'wcsdup' was not declared in this scope
     wchar_t *str = wcsdup(h.c_str());
                                    ^
src/builtin.cpp: In function 'int builtin_block(parser_t&, io_streams_t&, wchar_t**)':
src/builtin.cpp:660:32: warning: missing initializer for member 'event_blockage_t::typemask' [-Wmissing-field-initializers]
         event_blockage_t eb = {};
                                ^
src/builtin.cpp: In function 'int builtin_function(parser_t&, io_streams_t&, const wcstring_list_t&, const wcstring&, int, wcstring*)':
src/builtin.cpp:1573:69: error: 'wcscasecmp' was not declared in this scope
                 if ((opt == 'j') && (wcscasecmp(w.woptarg, L"caller") == 0)) {
                                                                     ^
src/builtin.cpp: In function 'int builtin_read(parser_t&, io_streams_t&, wchar_t**)':
src/builtin.cpp:2033:32: warning: missing initializer for member '__mbstate_t::__filler' [-Wmissing-field-initializers]
             mbstate_t state = {};
                                ^
make: *** [Makefile:798: obj/builtin.o] Error 1

In order for configure to work i had to create a folder fish and put the src folder inside it.
However not the make command hit new errors:

src/builtin.cpp: In function 'void builtin_print_help(parser_t&, io_streams_t&, const wchar_t*, output_stream_t&)':
src/builtin.cpp:166:36: error: 'wcsdup' was not declared in this scope
     wchar_t *str = wcsdup(h.c_str());
                                    ^
src/builtin.cpp: In function 'int builtin_block(parser_t&, io_streams_t&, wchar_t**)':
src/builtin.cpp:660:32: warning: missing initializer for member 'event_blockage_t::typemask' [-Wmissing-field-initializers]
         event_blockage_t eb = {};
                                ^
src/builtin.cpp: In function 'int builtin_function(parser_t&, io_streams_t&, const wcstring_list_t&, const wcstring&, int, wcstring*)':
src/builtin.cpp:1573:69: error: 'wcscasecmp' was not declared in this scope
                 if ((opt == 'j') && (wcscasecmp(w.woptarg, L"caller") == 0)) {
                                                                     ^
src/builtin.cpp: In function 'int builtin_read(parser_t&, io_streams_t&, wchar_t**)':
src/builtin.cpp:2033:32: warning: missing initializer for member '__mbstate_t::__filler' [-Wmissing-field-initializers]
             mbstate_t state = {};
                                ^
make: *** [Makefile:798: obj/builtin.o] Error 1
@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Oct 17, 2016

Contributor

In order for configure to work i had to create a folder fish and put the src folder inside it.

@panosdim, That tells me you didn't install the source package correctly. Doing a simple git clone should have produced the correct directory structure. I don't think there is any point in debugging your other build problems until you've correctly installed the source package. What commands did you run to install the fish source?

Contributor

krader1961 commented Oct 17, 2016

In order for configure to work i had to create a folder fish and put the src folder inside it.

@panosdim, That tells me you didn't install the source package correctly. Doing a simple git clone should have produced the correct directory structure. I don't think there is any point in debugging your other build problems until you've correctly installed the source package. What commands did you run to install the fish source?

@floam

This comment has been minimized.

Show comment
Hide comment
@floam

floam Oct 17, 2016

Member

It looks like he's working with a git checkout.

Member

floam commented Oct 17, 2016

It looks like he's working with a git checkout.

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Oct 18, 2016

Member

I can reproduce the wcsdup/wcscasecmp problem - on Solaris, these are in the std:: namespace but on all other platforms they are not namespaced.

Probably a #define wcsdup std::wcsdup in the right place is the thing to do here.

Member

zanchey commented Oct 18, 2016

I can reproduce the wcsdup/wcscasecmp problem - on Solaris, these are in the std:: namespace but on all other platforms they are not namespaced.

Probably a #define wcsdup std::wcsdup in the right place is the thing to do here.

@floam

This comment has been minimized.

Show comment
Hide comment
@floam

floam Oct 18, 2016

Member

What if you #include <cstdlib>? -- I'd rather just have it namespaced everywhere.

Member

floam commented Oct 18, 2016

What if you #include <cstdlib>? -- I'd rather just have it namespaced everywhere.

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Oct 18, 2016

Member

What if you #include <cstdlib>

Nope. Annoyingly std::wcsdup will not compile under glibc or FreeBSD.

Member

zanchey commented Oct 18, 2016

What if you #include <cstdlib>

Nope. Annoyingly std::wcsdup will not compile under glibc or FreeBSD.

@zanchey zanchey removed the question label Oct 18, 2016

@floam floam added the bug label Oct 18, 2016

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Oct 18, 2016

In order for configure to work i had to create a folder fish and put the src folder inside it.
@panosdim, That tells me you didn't install the source package correctly. Doing a simple git clone should have produced the correct directory structure. I don't think there is any point in debugging your other build problems until you've correctly installed the source package. What commands did you run to install the fish source?

Even with a fresh git clone i had the same problem with configure

 xigpadi  edeacts0702  ~/f/priv  $ git clone https://github.com/fish-shell/fish-shell.git
Cloning into 'fish-shell'...
remote: Counting objects: 35786, done.
remote: Compressing objects: 100% (81/81), done.
remote: Total 35786 (delta 37), reused 0 (delta 0), pack-reused 35705
Receiving objects: 100% (35786/35786), 32.16 MiB | 448.00 KiB/s, done.
Resolving deltas: 100% (22982/22982), done.
Checking out files: 100% (1205/1205), done.
 xigpadi  edeacts0702  ~/f/priv  $ ls
fish-shell/
 xigpadi  edeacts0702  ~/f/priv  $ cd fish-shell/
 xigpadi  edeacts0702  ~/f/p/fish-shell  $ ls
CHANGELOG.md     Dockerfile     Doxyfile.user  build_tools/   configure.ac  etc/          fish.xcodeproj/    osx/          share/
CONTRIBUTING.md  Doxyfile       Makefile.in    config.guess*  debian/       fish.pc.in    install-sh*        pcre2-10.21/  src/
COPYING          Doxyfile.help  README.md      config.sub*    doc_src/      fish.spec.in  lexicon_filter.in  po/           tests/
 xigpadi  edeacts0702  ~/f/p/fish-shell  $ autoconf
cut: cannot open FISH-BUILD-VERSION-FILE
 xigpadi  edeacts0702  ~/f/p/fish-shell  $ ls
CHANGELOG.md     Doxyfile       README.md        config.sub*   doc_src/      fish.xcodeproj/    pcre2-10.21/  tests/
CONTRIBUTING.md  Doxyfile.help  autom4te.cache/  configure*    etc/          install-sh*        po/
COPYING          Doxyfile.user  build_tools/     configure.ac  fish.pc.in    lexicon_filter.in  share/
Dockerfile       Makefile.in    config.guess*    debian/       fish.spec.in  osx/               src/
 xigpadi  edeacts0702  ~/f/p/fish-shell  $ ./configure
configure: error: cannot find sources (fish) in . or ..
 xigpadi  edeacts0702  ~/f/p/fish-shell  1  $

In order for configure to work i had to create a folder fish and put the src folder inside it.
@panosdim, That tells me you didn't install the source package correctly. Doing a simple git clone should have produced the correct directory structure. I don't think there is any point in debugging your other build problems until you've correctly installed the source package. What commands did you run to install the fish source?

Even with a fresh git clone i had the same problem with configure

 xigpadi  edeacts0702  ~/f/priv  $ git clone https://github.com/fish-shell/fish-shell.git
Cloning into 'fish-shell'...
remote: Counting objects: 35786, done.
remote: Compressing objects: 100% (81/81), done.
remote: Total 35786 (delta 37), reused 0 (delta 0), pack-reused 35705
Receiving objects: 100% (35786/35786), 32.16 MiB | 448.00 KiB/s, done.
Resolving deltas: 100% (22982/22982), done.
Checking out files: 100% (1205/1205), done.
 xigpadi  edeacts0702  ~/f/priv  $ ls
fish-shell/
 xigpadi  edeacts0702  ~/f/priv  $ cd fish-shell/
 xigpadi  edeacts0702  ~/f/p/fish-shell  $ ls
CHANGELOG.md     Dockerfile     Doxyfile.user  build_tools/   configure.ac  etc/          fish.xcodeproj/    osx/          share/
CONTRIBUTING.md  Doxyfile       Makefile.in    config.guess*  debian/       fish.pc.in    install-sh*        pcre2-10.21/  src/
COPYING          Doxyfile.help  README.md      config.sub*    doc_src/      fish.spec.in  lexicon_filter.in  po/           tests/
 xigpadi  edeacts0702  ~/f/p/fish-shell  $ autoconf
cut: cannot open FISH-BUILD-VERSION-FILE
 xigpadi  edeacts0702  ~/f/p/fish-shell  $ ls
CHANGELOG.md     Doxyfile       README.md        config.sub*   doc_src/      fish.xcodeproj/    pcre2-10.21/  tests/
CONTRIBUTING.md  Doxyfile.help  autom4te.cache/  configure*    etc/          install-sh*        po/
COPYING          Doxyfile.user  build_tools/     configure.ac  fish.pc.in    lexicon_filter.in  share/
Dockerfile       Makefile.in    config.guess*    debian/       fish.spec.in  osx/               src/
 xigpadi  edeacts0702  ~/f/p/fish-shell  $ ./configure
configure: error: cannot find sources (fish) in . or ..
 xigpadi  edeacts0702  ~/f/p/fish-shell  1  $
@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Oct 18, 2016

Contributor

The configure script should set the source dir to "." (that is, the cwd). There is either something wrong with the configure script created by autoconf or there is something weird with the permission bits of your fish-shell directory (or perhaps the ACLs, etc.). I'll be very surprised if this has anything to do with fish.

Open the configure script in your editor. Find this block of code:

# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
   srcdir=.
fi

Insert exit 1 after the fi. Then type /bin/sh -x ./configure and show us the last screenful of output; at least the portion after lines like this:

++ pwd
+ ac_pwd=/Users/krader/projects/3rd-party/fish-shell

Your ac_pwd value will obviously be different.

Contributor

krader1961 commented Oct 18, 2016

The configure script should set the source dir to "." (that is, the cwd). There is either something wrong with the configure script created by autoconf or there is something weird with the permission bits of your fish-shell directory (or perhaps the ACLs, etc.). I'll be very surprised if this has anything to do with fish.

Open the configure script in your editor. Find this block of code:

# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
   srcdir=.
fi

Insert exit 1 after the fi. Then type /bin/sh -x ./configure and show us the last screenful of output; at least the portion after lines like this:

++ pwd
+ ac_pwd=/Users/krader/projects/3rd-party/fish-shell

Your ac_pwd value will obviously be different.

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Oct 21, 2016

Here is the output

+ continue
+ build=
+ host=
+ target=
+ test x '!=' x
+ ac_tool_prefix=
+ test -n ''
+ test '' = yes
++ pwd
+ ac_pwd=/home/xigpadi/ftp/priv/fish-shell
+ test -n /home/xigpadi/ftp/priv/fish-shell
++ ls -di .
+ ac_ls_di='9617298 .'
++ cd /home/xigpadi/ftp/priv/fish-shell
++ ls -di .
+ ac_pwd_ls_di='9617298 .'
+ test 'X9617298 .' = 'X9617298 .'
+ test -z ''
+ ac_srcdir_defaulted=yes
++ dirname -- ./configure
+ ac_confdir=.
+ srcdir=.
+ test '!' -r ./fish
+ srcdir=..
+ test '!' -r ../fish
+ test yes = yes
+ srcdir='. or ..'
+ as_fn_error 0 'cannot find sources (fish) in . or ..'
+ as_status=0
+ test 0 -eq 0
+ as_status=1
+ test ''
+ printf '%s\n' 'configure: error: cannot find sources (fish) in . or ..'
configure: error: cannot find sources (fish) in . or ..
+ as_fn_exit 1
+ set +e
+ as_fn_set_status 1
+ return 1
+ exit 1
 xigpadi  edeacts0702  ~/f/p/fish-shell  1  $

Here is the output

+ continue
+ build=
+ host=
+ target=
+ test x '!=' x
+ ac_tool_prefix=
+ test -n ''
+ test '' = yes
++ pwd
+ ac_pwd=/home/xigpadi/ftp/priv/fish-shell
+ test -n /home/xigpadi/ftp/priv/fish-shell
++ ls -di .
+ ac_ls_di='9617298 .'
++ cd /home/xigpadi/ftp/priv/fish-shell
++ ls -di .
+ ac_pwd_ls_di='9617298 .'
+ test 'X9617298 .' = 'X9617298 .'
+ test -z ''
+ ac_srcdir_defaulted=yes
++ dirname -- ./configure
+ ac_confdir=.
+ srcdir=.
+ test '!' -r ./fish
+ srcdir=..
+ test '!' -r ../fish
+ test yes = yes
+ srcdir='. or ..'
+ as_fn_error 0 'cannot find sources (fish) in . or ..'
+ as_status=0
+ test 0 -eq 0
+ as_status=1
+ test ''
+ printf '%s\n' 'configure: error: cannot find sources (fish) in . or ..'
configure: error: cannot find sources (fish) in . or ..
+ as_fn_exit 1
+ set +e
+ as_fn_set_status 1
+ return 1
+ exit 1
 xigpadi  edeacts0702  ~/f/p/fish-shell  1  $
@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Oct 21, 2016

Contributor

At this point everything looks fine:

+ srcdir=.

Here is where things go wrong:

+ test '!' -r ./fish

That's from this line in the configure script:

if test ! -r "$srcdir/$ac_unique_file"; then

On my systems (macOS, various Linux, Cygwin, BSD) the $ac_unique_file variable is not defined so it tests that the cwd is readable. On your system it has been initialized to "fish". Since that file doesn't exist configure reports that it is unsure where the source can be found.

Some googling suggests this was the behavior of old versions of autoconf; e.g., 2.13. On my systems it is much newer; e.g., 2.69. What does autoconf -V report on your system? You can workaround that specific failure by first doing touch fish. Of course, given that your build tools seem to be quite old there may be other problems.

Contributor

krader1961 commented Oct 21, 2016

At this point everything looks fine:

+ srcdir=.

Here is where things go wrong:

+ test '!' -r ./fish

That's from this line in the configure script:

if test ! -r "$srcdir/$ac_unique_file"; then

On my systems (macOS, various Linux, Cygwin, BSD) the $ac_unique_file variable is not defined so it tests that the cwd is readable. On your system it has been initialized to "fish". Since that file doesn't exist configure reports that it is unsure where the source can be found.

Some googling suggests this was the behavior of old versions of autoconf; e.g., 2.13. On my systems it is much newer; e.g., 2.69. What does autoconf -V report on your system? You can workaround that specific failure by first doing touch fish. Of course, given that your build tools seem to be quite old there may be other problems.

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Oct 24, 2016

I have a new autoconf

 xigpadi  edeacts0702  ~/f/p/fish-shell  1  $ autoconf -V
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
 xigpadi  edeacts0702  ~/f/p/fish-shell  $

Maybe it is some strange behaviour of autoconf in solaris. Nevermind with touch fish it is working ok.

I have a new autoconf

 xigpadi  edeacts0702  ~/f/p/fish-shell  1  $ autoconf -V
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
 xigpadi  edeacts0702  ~/f/p/fish-shell  $

Maybe it is some strange behaviour of autoconf in solaris. Nevermind with touch fish it is working ok.

@krader1961 krader1961 added enhancement packaging and removed bug labels Oct 25, 2016

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Oct 25, 2016

Contributor

We'd love to modify fish so that hacks like touch fish aren't needed to build on Solaris. But I don't believe any of the core devs have access to that environment. So we're going to be dependent on someone like you, @panosdim, to provide a solution.

Contributor

krader1961 commented Oct 25, 2016

We'd love to modify fish so that hacks like touch fish aren't needed to build on Solaris. But I don't believe any of the core devs have access to that environment. So we're going to be dependent on someone like you, @panosdim, to provide a solution.

@krader1961 krader1961 added this to the fish-future milestone Oct 25, 2016

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Oct 25, 2016

No problem i can test any modification in Solaris environment, just tell me when and what you need to test.

No problem i can test any modification in Solaris environment, just tell me when and what you need to test.

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Oct 25, 2016

Member

I have Solaris 11, with autoconf 2.68, and I don't get the same problem with requiring touch fish. I do, however, run into the wcsdup/wcscasecmp problems described above.

Member

zanchey commented Oct 25, 2016

I have Solaris 11, with autoconf 2.68, and I don't get the same problem with requiring touch fish. I do, however, run into the wcsdup/wcscasecmp problems described above.

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Dec 3, 2016

Member

Could you try the patch in #3608? That gives me a clean, working build on Solaris 11.

Member

zanchey commented Dec 3, 2016

Could you try the patch in #3608? That gives me a clean, working build on Solaris 11.

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Dec 5, 2016

Still not working on SunOS edeacts0703 5.10 Generic_147147-26 sun4u sparc SUNW,SPARC-Enterprise Solaris

src/builtin.cpp:187:36: error: 'wcsdup' was not declared in this scope
     wchar_t *str = wcsdup(h.c_str());
                                    ^
make: *** [Makefile:810: obj/builtin_set.o] Error 1
src/builtin.cpp: In function 'int builtin_block(parser_t&, io_streams_t&, wchar_t**)':
src/builtin.cpp:676:32: warning: missing initializer for member 'event_blockage_t::typemask' [-Wmissing-field-initializers]
         event_blockage_t eb = {};
                                ^
make: *** [Makefile:810: obj/env_universal_common.o] Error 1
src/complete.cpp: In member function 'bool completer_t::complete_param(const wcstring&, const wcstring&, const wcstring&, bool)':
src/complete.cpp:995:80: error: 'wcsncasecmp' was not declared in this scope
                 match_no_case = wcsncasecmp(str, whole_opt.c_str(), wcslen(str)) == 0;
                                                                                ^
src/builtin.cpp: In function 'int builtin_function(parser_t&, io_streams_t&, const wcstring_list_t&, const wcstring&, int, wcstring*)':
src/builtin.cpp:1626:69: error: 'wcscasecmp' was not declared in this scope
                 if ((opt == 'j') && (wcscasecmp(w.woptarg, L"caller") == 0)) {
                                                                     ^
src/complete.cpp: In member function 'bool completer_t::try_complete_user(const wcstring&)':
src/complete.cpp:1239:60: error: 'wcsncasecmp' was not declared in this scope
         } else if (wcsncasecmp(user_name, pw_name, name_len) == 0) {
                                                            ^
src/builtin.cpp: In function 'int builtin_read(parser_t&, io_streams_t&, wchar_t**)':
src/builtin.cpp:2018:32: warning: missing initializer for member '__mbstate_t::__filler' [-Wmissing-field-initializers]
             mbstate_t state = {};
                                ^
make: *** [Makefile:810: obj/highlight.o] Error 1
make: *** [Makefile:810: obj/builtin.o] Error 1

panosdim commented Dec 5, 2016

Still not working on SunOS edeacts0703 5.10 Generic_147147-26 sun4u sparc SUNW,SPARC-Enterprise Solaris

src/builtin.cpp:187:36: error: 'wcsdup' was not declared in this scope
     wchar_t *str = wcsdup(h.c_str());
                                    ^
make: *** [Makefile:810: obj/builtin_set.o] Error 1
src/builtin.cpp: In function 'int builtin_block(parser_t&, io_streams_t&, wchar_t**)':
src/builtin.cpp:676:32: warning: missing initializer for member 'event_blockage_t::typemask' [-Wmissing-field-initializers]
         event_blockage_t eb = {};
                                ^
make: *** [Makefile:810: obj/env_universal_common.o] Error 1
src/complete.cpp: In member function 'bool completer_t::complete_param(const wcstring&, const wcstring&, const wcstring&, bool)':
src/complete.cpp:995:80: error: 'wcsncasecmp' was not declared in this scope
                 match_no_case = wcsncasecmp(str, whole_opt.c_str(), wcslen(str)) == 0;
                                                                                ^
src/builtin.cpp: In function 'int builtin_function(parser_t&, io_streams_t&, const wcstring_list_t&, const wcstring&, int, wcstring*)':
src/builtin.cpp:1626:69: error: 'wcscasecmp' was not declared in this scope
                 if ((opt == 'j') && (wcscasecmp(w.woptarg, L"caller") == 0)) {
                                                                     ^
src/complete.cpp: In member function 'bool completer_t::try_complete_user(const wcstring&)':
src/complete.cpp:1239:60: error: 'wcsncasecmp' was not declared in this scope
         } else if (wcsncasecmp(user_name, pw_name, name_len) == 0) {
                                                            ^
src/builtin.cpp: In function 'int builtin_read(parser_t&, io_streams_t&, wchar_t**)':
src/builtin.cpp:2018:32: warning: missing initializer for member '__mbstate_t::__filler' [-Wmissing-field-initializers]
             mbstate_t state = {};
                                ^
make: *** [Makefile:810: obj/highlight.o] Error 1
make: *** [Makefile:810: obj/builtin.o] Error 1
@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Dec 5, 2016

Member

Right, it looks like those functions aren't available on Solaris 10. Can you try building from Git master? I am not sure that the GCC available on Solaris 10 is new enough to support C++11, so we might be SOL on that platform anyway.

Member

zanchey commented Dec 5, 2016

Right, it looks like those functions aren't available on Solaris 10. Can you try building from Git master? I am not sure that the GCC available on Solaris 10 is new enough to support C++11, so we might be SOL on that platform anyway.

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Dec 5, 2016

I build from master but same error. I have installed a newer version of GCC on Solaris 10.
gcc --version
gcc (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

panosdim commented Dec 5, 2016

I build from master but same error. I have installed a newer version of GCC on Solaris 10.
gcc --version
gcc (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Dec 5, 2016

Contributor

@panosdim: gcc 4.9.3 does support C++11 so that shouldn't be an issue for supporting Solaris 10. You only have three actual errors. It can't find wcsdup(), wcscasecmp() and wcsncasecmp(). Zanchey added using statements to the bottom of src/common.h to deal with the fact they're in the std:: namespace. But those are predicated on autoconf tests that might be returning the wrong result on your platform. What happens if you just make those using statements unconditional? Or change the places where they're used, such as src/builtin.cpp line 187, to say std::wcsdup()?

Contributor

krader1961 commented Dec 5, 2016

@panosdim: gcc 4.9.3 does support C++11 so that shouldn't be an issue for supporting Solaris 10. You only have three actual errors. It can't find wcsdup(), wcscasecmp() and wcsncasecmp(). Zanchey added using statements to the bottom of src/common.h to deal with the fact they're in the std:: namespace. But those are predicated on autoconf tests that might be returning the wrong result on your platform. What happens if you just make those using statements unconditional? Or change the places where they're used, such as src/builtin.cpp line 187, to say std::wcsdup()?

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Dec 6, 2016

Member

Alternatively, a copy of your config.log might be helpful.

Member

zanchey commented Dec 6, 2016

Alternatively, a copy of your config.log might be helpful.

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Dec 6, 2016

These functions are missing from solaris 10 (even the std::xxx functions) as you can see from the config.log. Can you declare it in source code?
config.log.txt

panosdim commented Dec 6, 2016

These functions are missing from solaris 10 (even the std::xxx functions) as you can see from the config.log. Can you declare it in source code?
config.log.txt

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Dec 6, 2016

Contributor

Can you declare it in source code?

Yes. In fact we already have fallback implementations. Look for wcsdup_fallback in src/fallback.cpp. You just need to figure out how to modify our automake scripts and source to recognize that those fallbacks are needed on Solaris 10.

Contributor

krader1961 commented Dec 6, 2016

Can you declare it in source code?

Yes. In fact we already have fallback implementations. Look for wcsdup_fallback in src/fallback.cpp. You just need to figure out how to modify our automake scripts and source to recognize that those fallbacks are needed on Solaris 10.

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Dec 7, 2016

I finally managed to compile in Solaris 10 using the attached patch.
Can someone apply the patch to master branch if it is not causing any problem to other platforms?
fish-shell-master-patch.txt

panosdim commented Dec 7, 2016

I finally managed to compile in Solaris 10 using the attached patch.
Can someone apply the patch to master branch if it is not causing any problem to other platforms?
fish-shell-master-patch.txt

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Dec 8, 2016

Contributor

Looks good to me. Tested on macOS, Ubuntu, and Cygwin on Windows 10.

If you run make style it will correct a couple whitespace nits. Do you want to create a pull-request @panosdim or do you want one of us to just merge your patch?

Contributor

krader1961 commented Dec 8, 2016

Looks good to me. Tested on macOS, Ubuntu, and Cygwin on Windows 10.

If you run make style it will correct a couple whitespace nits. Do you want to create a pull-request @panosdim or do you want one of us to just merge your patch?

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Dec 8, 2016

Member

I think this needs checking for 10.6 as well.

Member

zanchey commented Dec 8, 2016

I think this needs checking for 10.6 as well.

@panosdim

This comment has been minimized.

Show comment
Hide comment
@panosdim

panosdim Dec 8, 2016

@krader1961 It will be better if you can just merge the patch.

panosdim commented Dec 8, 2016

@krader1961 It will be better if you can just merge the patch.

@krader1961

This comment has been minimized.

Show comment
Hide comment
@krader1961

krader1961 Dec 9, 2016

Contributor

I think this needs checking for 10.6 as well.

The switch to require C++11 means we can no longer build fish on OS X 10.6 irrespective of this change. I confirmed this sad fact by starting up my VirtualBox OS X 10.6 instance, syncing the source, and running ./configure. It fails with several errors of the form

checking whether g++ supports C++11 features... no

I can't readily confirm but believe we are now limited to supporting OS X 10.8 or newer.

It will be better if you can just merge the patch.

Okay, I will do so in a few minutes.

Contributor

krader1961 commented Dec 9, 2016

I think this needs checking for 10.6 as well.

The switch to require C++11 means we can no longer build fish on OS X 10.6 irrespective of this change. I confirmed this sad fact by starting up my VirtualBox OS X 10.6 instance, syncing the source, and running ./configure. It fails with several errors of the form

checking whether g++ supports C++11 features... no

I can't readily confirm but believe we are now limited to supporting OS X 10.8 or newer.

It will be better if you can just merge the patch.

Okay, I will do so in a few minutes.

@krader1961 krader1961 closed this in 0019c12 Dec 9, 2016

@ridiculousfish

This comment has been minimized.

Show comment
Hide comment
@ridiculousfish

ridiculousfish Dec 9, 2016

Member

#3138 has the SnowLeopard plans. The upshot is the official packages can probably be made to work via a MacPorts install of libc++; if not, a MacPorts package can certainly be made to work. So SnowLeopard users won't be left out in the, err, cold.

Member

ridiculousfish commented Dec 9, 2016

#3138 has the SnowLeopard plans. The upshot is the official packages can probably be made to work via a MacPorts install of libc++; if not, a MacPorts package can certainly be made to work. So SnowLeopard users won't be left out in the, err, cold.

@krader1961 krader1961 added this to the fish 2.5.0 milestone Jan 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment