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

OS/X build failure #134

Closed
xipmix opened this Issue Jan 17, 2016 · 12 comments

Comments

Projects
None yet
2 participants
@xipmix

xipmix commented Jan 17, 2016

Trying to build on 10.11.2 (el capitan) with homebrew and Xcode 7.2. This may not be a supported platform....
I read the README.md and installed all the dependencies (patch to follow).
I am hitting an issue with malloc vs valloc. Have I missed a library

make
g++ -I/usr/local/Cellar/lua/5.2.4_2/include -std=c++0x -Wall -Werror  -I/usr/local/Cellar/pcre/8.38/include -I/usr/local/opt/ncurses/include/ncursesw -I/usr/local/opt/ncurses/include/ncursesw/.. -DLUMAIL_VERSION="\"1fc6-dirty\"" -D_REENTRANT -I/usr/local/Cellar/gmime/2.6.20/include/gmime-2.6 -I/usr/local/Cellar/glib/2.46.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -O2 -c src/attachment_view.cc -o obj.release/attachment_view.o
g++ -I/usr/local/Cellar/lua/5.2.4_2/include -std=c++0x -Wall -Werror  -I/usr/local/Cellar/pcre/8.38/include -I/usr/local/opt/ncurses/include/ncursesw -I/usr/local/opt/ncurses/include/ncursesw/.. -DLUMAIL_VERSION="\"1fc6-dirty\"" -D_REENTRANT -I/usr/local/Cellar/gmime/2.6.20/include/gmime-2.6 -I/usr/local/Cellar/glib/2.46.2/include/glib-2.0 -I/usr/local/Cellar/glib/2.46.2/lib/glib-2.0/include -I/usr/local/opt/gettext/include -O2 -c src/config.cc -o obj.release/config.o
src/config.cc:88:5: error: use of undeclared identifier 'free'
    free(tmp);
    ^
src/config.cc:138:40: error: use of undeclared identifier 'malloc'; did you mean
      'valloc'?
    CConfigEntry *x = (CConfigEntry *) malloc(sizeof(CConfigEntry));
                                       ^~~~~~
                                       valloc
/usr/include/unistd.h:712:7: note: 'valloc' declared here
void    *valloc(size_t);                        
         ^
src/config.cc:179:40: error: use of undeclared identifier 'malloc'; did you mean
      'valloc'?
    CConfigEntry *x = (CConfigEntry *) malloc(sizeof(CConfigEntry));
                                       ^~~~~~
                                       valloc
/usr/include/unistd.h:712:7: note: 'valloc' declared here
void    *valloc(size_t);                        
         ^
src/config.cc:220:40: error: use of undeclared identifier 'malloc'; did you mean
      'valloc'?
    CConfigEntry *x = (CConfigEntry *) malloc(sizeof(CConfigEntry));
                                       ^~~~~~
                                       valloc
/usr/include/unistd.h:712:7: note: 'valloc' declared here
void    *valloc(size_t);                        
         ^
4 errors generated.
make: *** [obj.release/config.o] Error 1
@xipmix

This comment has been minimized.

Show comment
Hide comment
@xipmix

xipmix Jan 17, 2016

Found the issue, a missing include. Hacked onward until I got to here

$ git diff
diff --git a/src/config.h b/src/config.h
index abd2612..b8500df 100644
--- a/src/config.h
+++ b/src/config.h
@@ -24,6 +24,7 @@

 #include "observer.h"
 #include "singleton.h"
+#include "stdlib.h"

 /**
  * The CConfig class holds configuration values, these values
diff --git a/src/message_part.h b/src/message_part.h
index 9b2b671..9567259 100644
--- a/src/message_part.h
+++ b/src/message_part.h
@@ -23,6 +23,7 @@
 #include <string>
 #include <vector>

+#include "stdlib.h"

 /**
  * This is the C++ object which represents a MIME-part from a message.
diff --git a/src/util.h b/src/util.h
index bc95881..9dfd659 100644
--- a/src/util.h
+++ b/src/util.h
@@ -21,6 +21,7 @@

 #include <algorithm>
 #include <sstream>
+#include <vector>


 /**

$ make
Package panelw was not found in the pkg-config search path.
Perhaps you should add the directory containing `panelw.pc'
to the PKG_CONFIG_PATH environment variable
No package 'panelw' found
g++ -o lumail2  obj.release/attachment_view.o obj.release/config.o obj.release/config_lua.o obj.release/directory.o obj.release/directory_lua.o obj.release/file.o obj.release/file_lua.o obj.release/global_state.o obj.release/global_state_lua.o obj.release/history.o obj.release/index_view.o obj.release/input_queue.o obj.release/jsoncpp.o obj.release/logfile.o obj.release/logfile_lua.o obj.release/lua.o obj.release/lua_view.o obj.release/lumail2.o obj.release/maildir.o obj.release/maildir_lua.o obj.release/maildir_view.o obj.release/message.o obj.release/message_lua.o obj.release/message_part.o obj.release/message_part_lua.o obj.release/message_view.o obj.release/mime.o obj.release/mime_lua.o obj.release/net_lua.o obj.release/panel_lua.o obj.release/regexp_lua.o obj.release/screen.o obj.release/screen_lua.o obj.release/util.o -L/usr/local/Cellar/lua/5.2.4_2/lib -llua -lm -L/usr/local/opt/ncurses/lib -lncurses  -lpcrecpp -lmagic -ldl -L/usr/local/Cellar/gmime/2.6.20/lib -L/usr/local/Cellar/glib/2.46.2/lib -L/usr/local/opt/gettext/lib -lgmime-2.6 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
Undefined symbols for architecture x86_64:
  "_del_panel", referenced from:
      CScreen::status_panel_height(int) in screen.o
  "_hide_panel", referenced from:
      CScreen::status_panel_hide() in screen.o
      CScreen::status_panel_toggle() in screen.o
  "_new_panel", referenced from:
      CScreen::status_panel_init() in screen.o
      CScreen::status_panel_height(int) in screen.o
  "_set_panel_userptr", referenced from:
      CScreen::status_panel_init() in screen.o
      CScreen::status_panel_height(int) in screen.o
  "_show_panel", referenced from:
      CScreen::status_panel_init() in screen.o
      CScreen::status_panel_show() in screen.o
      CScreen::status_panel_toggle() in screen.o
  "_update_panels", referenced from:
      CScreen::run_main_loop() in screen.o
      CScreen::clear(bool) in screen.o
      CScreen::get_line(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in screen.o
      CScreen::prompt_chars(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in screen.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lumail2] Error 1

This one has me stumped, my pkgconfig-fu is nonexistent. I don't understand where the clang reference is coming from either.

xipmix commented Jan 17, 2016

Found the issue, a missing include. Hacked onward until I got to here

$ git diff
diff --git a/src/config.h b/src/config.h
index abd2612..b8500df 100644
--- a/src/config.h
+++ b/src/config.h
@@ -24,6 +24,7 @@

 #include "observer.h"
 #include "singleton.h"
+#include "stdlib.h"

 /**
  * The CConfig class holds configuration values, these values
diff --git a/src/message_part.h b/src/message_part.h
index 9b2b671..9567259 100644
--- a/src/message_part.h
+++ b/src/message_part.h
@@ -23,6 +23,7 @@
 #include <string>
 #include <vector>

+#include "stdlib.h"

 /**
  * This is the C++ object which represents a MIME-part from a message.
diff --git a/src/util.h b/src/util.h
index bc95881..9dfd659 100644
--- a/src/util.h
+++ b/src/util.h
@@ -21,6 +21,7 @@

 #include <algorithm>
 #include <sstream>
+#include <vector>


 /**

$ make
Package panelw was not found in the pkg-config search path.
Perhaps you should add the directory containing `panelw.pc'
to the PKG_CONFIG_PATH environment variable
No package 'panelw' found
g++ -o lumail2  obj.release/attachment_view.o obj.release/config.o obj.release/config_lua.o obj.release/directory.o obj.release/directory_lua.o obj.release/file.o obj.release/file_lua.o obj.release/global_state.o obj.release/global_state_lua.o obj.release/history.o obj.release/index_view.o obj.release/input_queue.o obj.release/jsoncpp.o obj.release/logfile.o obj.release/logfile_lua.o obj.release/lua.o obj.release/lua_view.o obj.release/lumail2.o obj.release/maildir.o obj.release/maildir_lua.o obj.release/maildir_view.o obj.release/message.o obj.release/message_lua.o obj.release/message_part.o obj.release/message_part_lua.o obj.release/message_view.o obj.release/mime.o obj.release/mime_lua.o obj.release/net_lua.o obj.release/panel_lua.o obj.release/regexp_lua.o obj.release/screen.o obj.release/screen_lua.o obj.release/util.o -L/usr/local/Cellar/lua/5.2.4_2/lib -llua -lm -L/usr/local/opt/ncurses/lib -lncurses  -lpcrecpp -lmagic -ldl -L/usr/local/Cellar/gmime/2.6.20/lib -L/usr/local/Cellar/glib/2.46.2/lib -L/usr/local/opt/gettext/lib -lgmime-2.6 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
Undefined symbols for architecture x86_64:
  "_del_panel", referenced from:
      CScreen::status_panel_height(int) in screen.o
  "_hide_panel", referenced from:
      CScreen::status_panel_hide() in screen.o
      CScreen::status_panel_toggle() in screen.o
  "_new_panel", referenced from:
      CScreen::status_panel_init() in screen.o
      CScreen::status_panel_height(int) in screen.o
  "_set_panel_userptr", referenced from:
      CScreen::status_panel_init() in screen.o
      CScreen::status_panel_height(int) in screen.o
  "_show_panel", referenced from:
      CScreen::status_panel_init() in screen.o
      CScreen::status_panel_show() in screen.o
      CScreen::status_panel_toggle() in screen.o
  "_update_panels", referenced from:
      CScreen::run_main_loop() in screen.o
      CScreen::clear(bool) in screen.o
      CScreen::get_line(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in screen.o
      CScreen::prompt_chars(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >) in screen.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lumail2] Error 1

This one has me stumped, my pkgconfig-fu is nonexistent. I don't understand where the clang reference is coming from either.

@skx

This comment has been minimized.

Show comment
Hide comment
@skx

skx Jul 7, 2016

Contributor

Really sorry I managed to not see this - it wasn't in the list at all I swear when I looked before.

I think this should be part of your solution:

  $ brew install pkg-config
  $ brew install ncurses

But that's just a guess based on google searches. panelw is part of ncurses, so it should be present if the curses library is. Otherwise it might come down to your PKG_CONFIG_PATH setting.

I'm basing this off the following issue, and similar:

Contributor

skx commented Jul 7, 2016

Really sorry I managed to not see this - it wasn't in the list at all I swear when I looked before.

I think this should be part of your solution:

  $ brew install pkg-config
  $ brew install ncurses

But that's just a guess based on google searches. panelw is part of ncurses, so it should be present if the curses library is. Otherwise it might come down to your PKG_CONFIG_PATH setting.

I'm basing this off the following issue, and similar:

skx added a commit that referenced this issue Jul 7, 2016

@xipmix

This comment has been minimized.

Show comment
Hide comment
@xipmix

xipmix Jul 7, 2016

On Wed, Jul 06, 2016 at 07:12:11PM -0700, Steve Kemp wrote:

Really sorry I managed to not see this - it wasn't in the list at
all I swear when I looked before.

No problem. Github decided I was a robot. I don't use it frequently
and forgot until today to ask them to flip the human bit.
Thanks for the advice!

xipmix commented Jul 7, 2016

On Wed, Jul 06, 2016 at 07:12:11PM -0700, Steve Kemp wrote:

Really sorry I managed to not see this - it wasn't in the list at
all I swear when I looked before.

No problem. Github decided I was a robot. I don't use it frequently
and forgot until today to ask them to flip the human bit.
Thanks for the advice!

@xipmix

This comment has been minimized.

Show comment
Hide comment
@xipmix

xipmix Jul 7, 2016

It builds! Current diff below. Have not tried running yet.
I added -Wno-deprecated-declarations because the compiler balked
over tmpname() being used instead of mkstemp().

diff --git a/Makefile b/Makefile
index aee8029..53f7b4a 100644
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,15 @@ DEBUG_OBJDIR   = obj.debug
 #
 CC?=g++
 LINKER=$(CC) -o
-
+ifeq ($(UNAME),Darwin)
+   C=clang
+   CC=clang++
+endif
+# To ensure make finds the ncursesw.h header file,
+# you may need to invoke it like this:
+#   PKG_CONFIG_PATH=/usr/local/Cellar/ncurses/6.0_1/lib/pkgconfig make
+# PKG_CONFIG_PATH should point to a directory containing a file
+# named ncursesw.pc)


 #
@@ -57,6 +65,9 @@ LINKER=$(CC) -o
 #
 CPPFLAGS+=${LUA_FLAGS} -std=c++0x -Wall -Werror  $(shell pcre-config --cflags) $(shell pkg-config --cflags ncursesw) -DLUMAIL_VERSION="\"${VERSION}\""
 LDLIBS+=${LUA_LIBS} $(shell pkg-config --libs ncursesw) $(shell pkg-config --libs panelw) -lpcrecpp -lmagic -ldl -lstdc++
+ifeq ($(UNAME),Darwin)
+   CPPFLAGS+=${LUA_FLAGS} -std=c++0x -Wall -Werror -Wno-deprecated-declarations $(shell pcre-config --cflags) $(shell pkg-config --cflags ncursesw) -DLUMAIL_VERSION="\"${VERSION}\""
+endif

 #
 #  GMime is used for MIME handling.
diff --git a/src/colour_string_test.cc b/src/colour_string_test.cc
index c38a3c7..d64e3aa 100644
--- a/src/colour_string_test.cc
+++ b/src/colour_string_test.cc
@@ -20,7 +20,6 @@

 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>

 #include "colour_string.h"
 #include "CuTest.h"
diff --git a/src/config_test.cc b/src/config_test.cc
index 5d3e452..82ff3f8 100644
--- a/src/config_test.cc
+++ b/src/config_test.cc
@@ -20,7 +20,6 @@

 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>

 #include "config.h"
 #include "CuTest.h"
diff --git a/src/message_part.h b/src/message_part.h
index 9b2b671..d825ca9 100644
--- a/src/message_part.h
+++ b/src/message_part.h
@@ -22,7 +22,7 @@
 #include <memory>
 #include <string>
 #include <vector>
-
+#include "stdlib.h"

 /**
  * This is the C++ object which represents a MIME-part from a message.

xipmix commented Jul 7, 2016

It builds! Current diff below. Have not tried running yet.
I added -Wno-deprecated-declarations because the compiler balked
over tmpname() being used instead of mkstemp().

diff --git a/Makefile b/Makefile
index aee8029..53f7b4a 100644
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,15 @@ DEBUG_OBJDIR   = obj.debug
 #
 CC?=g++
 LINKER=$(CC) -o
-
+ifeq ($(UNAME),Darwin)
+   C=clang
+   CC=clang++
+endif
+# To ensure make finds the ncursesw.h header file,
+# you may need to invoke it like this:
+#   PKG_CONFIG_PATH=/usr/local/Cellar/ncurses/6.0_1/lib/pkgconfig make
+# PKG_CONFIG_PATH should point to a directory containing a file
+# named ncursesw.pc)


 #
@@ -57,6 +65,9 @@ LINKER=$(CC) -o
 #
 CPPFLAGS+=${LUA_FLAGS} -std=c++0x -Wall -Werror  $(shell pcre-config --cflags) $(shell pkg-config --cflags ncursesw) -DLUMAIL_VERSION="\"${VERSION}\""
 LDLIBS+=${LUA_LIBS} $(shell pkg-config --libs ncursesw) $(shell pkg-config --libs panelw) -lpcrecpp -lmagic -ldl -lstdc++
+ifeq ($(UNAME),Darwin)
+   CPPFLAGS+=${LUA_FLAGS} -std=c++0x -Wall -Werror -Wno-deprecated-declarations $(shell pcre-config --cflags) $(shell pkg-config --cflags ncursesw) -DLUMAIL_VERSION="\"${VERSION}\""
+endif

 #
 #  GMime is used for MIME handling.
diff --git a/src/colour_string_test.cc b/src/colour_string_test.cc
index c38a3c7..d64e3aa 100644
--- a/src/colour_string_test.cc
+++ b/src/colour_string_test.cc
@@ -20,7 +20,6 @@

 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>

 #include "colour_string.h"
 #include "CuTest.h"
diff --git a/src/config_test.cc b/src/config_test.cc
index 5d3e452..82ff3f8 100644
--- a/src/config_test.cc
+++ b/src/config_test.cc
@@ -20,7 +20,6 @@

 #include <stdlib.h>
 #include <string.h>
-#include <malloc.h>

 #include "config.h"
 #include "CuTest.h"
diff --git a/src/message_part.h b/src/message_part.h
index 9b2b671..d825ca9 100644
--- a/src/message_part.h
+++ b/src/message_part.h
@@ -22,7 +22,7 @@
 #include <memory>
 #include <string>
 #include <vector>
-
+#include "stdlib.h"

 /**
  * This is the C++ object which represents a MIME-part from a message.
@skx

This comment has been minimized.

Show comment
Hide comment
@skx

skx Jul 7, 2016

Contributor

Thanks. If you confirm it runs I'll commit something similar.

PS. The tmpnam thing is a real pain, it's used because I need to generate random filenames for testing the CFile:copy(), and CFile:move() primitives. But the warning does look bad. I guess I could just disable those specific tests unless running make lumail2-debug.

Contributor

skx commented Jul 7, 2016

Thanks. If you confirm it runs I'll commit something similar.

PS. The tmpnam thing is a real pain, it's used because I need to generate random filenames for testing the CFile:copy(), and CFile:move() primitives. But the warning does look bad. I guess I could just disable those specific tests unless running make lumail2-debug.

@xipmix

This comment has been minimized.

Show comment
Hide comment
@xipmix

xipmix Jul 7, 2016

(osx)$ PKG_CONFIG_PATH=/usr/local/Cellar/ncurses/6.0_1/lib/pkgconfig make test
./lumail2 --test
.............F......F.........

There were 2 failures:
1) TestFileDirectory: src/file_test.cc:279: assert failed
2) TestLogfile: src/logfile_test.cc:88: expected <31> but was <-1>

!!!FAILURES!!!
Runs: 30 Passes: 28 Fails: 2

I tried to just run it from the build directory and it starts fine but does not respond to 'Q' to quit, or any other keypress except ^C. Same when I install it. So - not quite there yet, best to hold off on that commit. Happy to dig further if you have time to shepherd me along.

A note on installation. I tried /usr/bin but OSX seems to have made that immutable. I wrought further hackage on the Makefile that starts like this:
@@ -163,23 +163,30 @@ test: lumail2
#
# Install the binary, and our luarocks.d directory
#
+BINDIR=/usr/bin
+ETCDIR=/etc/lumail2
+ifeq ($(UNAME),Darwin)
+ BINDIR=/usr/local/bin
+ ETCDIR=/usr/local/etc/lumail2
+endif

and goes downhill from there, but it did install and run.
I should mention the OS version is up to 10.11.5, and clang is 7.0.2 (clang-700.1.81).

xipmix commented Jul 7, 2016

(osx)$ PKG_CONFIG_PATH=/usr/local/Cellar/ncurses/6.0_1/lib/pkgconfig make test
./lumail2 --test
.............F......F.........

There were 2 failures:
1) TestFileDirectory: src/file_test.cc:279: assert failed
2) TestLogfile: src/logfile_test.cc:88: expected <31> but was <-1>

!!!FAILURES!!!
Runs: 30 Passes: 28 Fails: 2

I tried to just run it from the build directory and it starts fine but does not respond to 'Q' to quit, or any other keypress except ^C. Same when I install it. So - not quite there yet, best to hold off on that commit. Happy to dig further if you have time to shepherd me along.

A note on installation. I tried /usr/bin but OSX seems to have made that immutable. I wrought further hackage on the Makefile that starts like this:
@@ -163,23 +163,30 @@ test: lumail2
#
# Install the binary, and our luarocks.d directory
#
+BINDIR=/usr/bin
+ETCDIR=/etc/lumail2
+ifeq ($(UNAME),Darwin)
+ BINDIR=/usr/local/bin
+ ETCDIR=/usr/local/etc/lumail2
+endif

and goes downhill from there, but it did install and run.
I should mention the OS version is up to 10.11.5, and clang is 7.0.2 (clang-700.1.81).

@skx

This comment has been minimized.

Show comment
Hide comment
@skx

skx Jul 7, 2016

Contributor

If you run it from within the src tree, like so, does it run?:

 ./lumail2 --load-file ./lumail2.lua

If you've installed it globally you should have these files in place:

 /etc/lumail2/lib/*.lua
 /etc/lumail2/lumail2.lua

With those you should be able to launch the binary, with no arguments, from any directory - except the source tree.

Contributor

skx commented Jul 7, 2016

If you run it from within the src tree, like so, does it run?:

 ./lumail2 --load-file ./lumail2.lua

If you've installed it globally you should have these files in place:

 /etc/lumail2/lib/*.lua
 /etc/lumail2/lumail2.lua

With those you should be able to launch the binary, with no arguments, from any directory - except the source tree.

@skx

This comment has been minimized.

Show comment
Hide comment
@skx

skx Jul 7, 2016

Contributor

Keybindings are setup in lib/keymap.lua which is what makes me think there is no config-file being loaded, or similar.

Contributor

skx commented Jul 7, 2016

Keybindings are setup in lib/keymap.lua which is what makes me think there is no config-file being loaded, or similar.

skx added a commit that referenced this issue Jul 7, 2016

skx added a commit that referenced this issue Jul 7, 2016

@skx

This comment has been minimized.

Show comment
Hide comment
@skx

skx Jul 7, 2016

Contributor

Should build from master now. I hope the previous comment(s) help you make it run.

If we can make progress that'd be great, it should work, I just don't have the experience to help much.

This is now the only thing holding up the new release, in #196.

Contributor

skx commented Jul 7, 2016

Should build from master now. I hope the previous comment(s) help you make it run.

If we can make progress that'd be great, it should work, I just don't have the experience to help much.

This is now the only thing holding up the new release, in #196.

@xipmix

This comment has been minimized.

Show comment
Hide comment
@xipmix

xipmix Jul 7, 2016

On Thu, Jul 07, 2016 at 08:13:49AM -0700, Steve Kemp wrote:

If you run it from within the src tree, like so, does it run:

 ./lumail2 --load-file ./lumail2.lua

Yes, it does. I see a 'there are no visible folders' message
and the status bar at the bottom explains I am running from a
git checkout. 'Q' works correctly.

If you've installed it globally you should have these files in place:

 /etc/lumail2/lib/*.lua
 /etc/lumail2/lumail2.lua

With those you should be able to launch the binary, with no
arguments, from any directory - except the source tree.

Tests below done from my home dir, ie outside the checkout.

My initial install placed the files in /usr/local/etc/lumail2.
The program started but 'Q' was not working - I surmise that the
keybindings were not being loaded.
I also tried with --load-file and got this:

$ lumail2 --load-file /usr/local/etc/lumail2/lumail2.lua 
ERROR /usr/local/etc/lumail2/lumail2.lua:104: module 'cache' not found:
    no field package.preload['cache']
    no file '/usr/local/share/lua/5.2/cache.lua'
    no file '/usr/local/share/lua/5.2/cache/init.lua'
    no file '/usr/local/lib/lua/5.2/cache.lua'
    no file '/usr/local/lib/lua/5.2/cache/init.lua'
    no file './cache.lua'
    no file '/etc/lumail2/lib/cache.lua'
    no file '//Users/me/.lumail2/lib/cache.lua'
    no file '/usr/local/lib/lua/5.2/cache.so'
    no file '/usr/local/lib/lua/5.2/loadall.so'
    no file './cache.so'

When I installed them to /etc/lumail2 the program started properly,
showed the 'no visible folders' message, and the 'Q' key worked.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#134 (comment)

xipmix commented Jul 7, 2016

On Thu, Jul 07, 2016 at 08:13:49AM -0700, Steve Kemp wrote:

If you run it from within the src tree, like so, does it run:

 ./lumail2 --load-file ./lumail2.lua

Yes, it does. I see a 'there are no visible folders' message
and the status bar at the bottom explains I am running from a
git checkout. 'Q' works correctly.

If you've installed it globally you should have these files in place:

 /etc/lumail2/lib/*.lua
 /etc/lumail2/lumail2.lua

With those you should be able to launch the binary, with no
arguments, from any directory - except the source tree.

Tests below done from my home dir, ie outside the checkout.

My initial install placed the files in /usr/local/etc/lumail2.
The program started but 'Q' was not working - I surmise that the
keybindings were not being loaded.
I also tried with --load-file and got this:

$ lumail2 --load-file /usr/local/etc/lumail2/lumail2.lua 
ERROR /usr/local/etc/lumail2/lumail2.lua:104: module 'cache' not found:
    no field package.preload['cache']
    no file '/usr/local/share/lua/5.2/cache.lua'
    no file '/usr/local/share/lua/5.2/cache/init.lua'
    no file '/usr/local/lib/lua/5.2/cache.lua'
    no file '/usr/local/lib/lua/5.2/cache/init.lua'
    no file './cache.lua'
    no file '/etc/lumail2/lib/cache.lua'
    no file '//Users/me/.lumail2/lib/cache.lua'
    no file '/usr/local/lib/lua/5.2/cache.so'
    no file '/usr/local/lib/lua/5.2/loadall.so'
    no file './cache.so'

When I installed them to /etc/lumail2 the program started properly,
showed the 'no visible folders' message, and the 'Q' key worked.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#134 (comment)

@xipmix

This comment has been minimized.

Show comment
Hide comment
@xipmix

xipmix Jul 8, 2016

On Thu, Jul 07, 2016 at 08:53:17AM -0700, Steve Kemp wrote:

Should build from master now. I hope the previous comment(s)
help you make it run.

You've been a great help. The build is not quite there though,
it is choking on #include <malloc.h>. There are a few malloc.h
files on the system to choose from, I think this is the best option:

diff --git a/Makefile b/Makefile
index bb9f418..7d41f20 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,7 @@ endif
 ifeq ($(UNAME),Darwin)
    C=clang
    CC=clang++
+   CPPFLAGS+=-I /usr/include/malloc
 endif

The other option is in /usr/include/sys but it is much shorter
and lumail2 does not actually build.

$ ls -l /usr/include/{malloc,sys}/malloc.h
-rw-r--r--  1 root  wheel  13706 10 Dec  2015 /usr/include/malloc/malloc.h
-r--r--r--  1 root  wheel   3696 27 Feb 17:07 /usr/include/sys/malloc.h

If we can make progress that'd be great, it should work, I just
don't have the experience to help much.

This is now the only thing holding up the new release, in #196.

Hopefully you are good to go now. Cheers!


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#134 (comment)

xipmix commented Jul 8, 2016

On Thu, Jul 07, 2016 at 08:53:17AM -0700, Steve Kemp wrote:

Should build from master now. I hope the previous comment(s)
help you make it run.

You've been a great help. The build is not quite there though,
it is choking on #include <malloc.h>. There are a few malloc.h
files on the system to choose from, I think this is the best option:

diff --git a/Makefile b/Makefile
index bb9f418..7d41f20 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,7 @@ endif
 ifeq ($(UNAME),Darwin)
    C=clang
    CC=clang++
+   CPPFLAGS+=-I /usr/include/malloc
 endif

The other option is in /usr/include/sys but it is much shorter
and lumail2 does not actually build.

$ ls -l /usr/include/{malloc,sys}/malloc.h
-rw-r--r--  1 root  wheel  13706 10 Dec  2015 /usr/include/malloc/malloc.h
-r--r--r--  1 root  wheel   3696 27 Feb 17:07 /usr/include/sys/malloc.h

If we can make progress that'd be great, it should work, I just
don't have the experience to help much.

This is now the only thing holding up the new release, in #196.

Hopefully you are good to go now. Cheers!


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#134 (comment)

@skx

This comment has been minimized.

Show comment
Hide comment
@skx

skx Jul 8, 2016

Contributor

When I installed them to /etc/lumail2 the program started properly, showed the 'no visible folders' message, and the 'Q' key worked.

Awesome - Try "Ctrl-l" if you want to celebrate!

Contributor

skx commented Jul 8, 2016

When I installed them to /etc/lumail2 the program started properly, showed the 'no visible folders' message, and the 'Q' key worked.

Awesome - Try "Ctrl-l" if you want to celebrate!

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