Ported app silently fails to save on Linux x64

Deploying to Linux? Get penguinated here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Re: Ported app silently fails to save on Linux x64

Postby PhilHudson » Fri Feb 13, 2015 12:13 am

Here's the actual deployed Windows app, with about 500 books added, in an xz-compressed tar archive:

http://hudson-it.ddns.net/wlml-msw.txz

It's just under 1MB.
PhilHudson
 
Posts: 20
Joined: Thu Feb 05, 2015 12:38 am

Re: Ported app silently fails to save on Linux x64

Postby mwieder » Fri Feb 13, 2015 12:14 am

Phil- (sorry about the name thing - I was replying to 'Wally' earlier in another thread) in your development stack, is the data stack a substack of your mainstack or is it a completely separate stack? If it's a substack, then make sure that the 'Move substacks into individual stackfiles' option is checked in the Stacks section of the standalone builder settings. If not then the substack(s) will be incorporated into the binary executable. That's what looks like is happening with your linux build.

That said, I just built a 64-bit linux executable with LiveCode 7.0rc2 on a mac air running OSX 10 and it looks quite correct: a single executable file with separate files for the substacks and external data stacks.

Richard- I think you missed the point the the Windows version does save properly into the data stack, which is external to the app. So it is building and executing and saving data properly on Windows, which means it's constructed correctly for saving data into an external stack. Cross-compiling for linux on a mac *should* not change this, so that's a bit worrisome.
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2561
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US

Re: Ported app silently fails to save on Linux x64

Postby FourthWorld » Fri Feb 13, 2015 1:02 am

mwieder wrote:Richard- I think you missed the point the the Windows version does save properly into the data stack, which is external to the app. So it is building and executing and saving data properly on Windows, which means it's constructed correctly for saving data into an external stack. Cross-compiling for linux on a mac *should* not change this, so that's a bit worrisome.

I get that, but like you suggest the difference isn't the OS or the language, but with something in how his app was build on each platform.

With my last two questions unanswered it remains unknown if he can still build as he wants on Windows, or what he's getting when he checks "the result" after attempting "save".

That information would seem useful to understanding what's happening.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5305
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Ported app silently fails to save on Linux x64

Postby PhilHudson » Fri Feb 13, 2015 10:13 am

FourthWorld wrote:With my last two questions unanswered it remains unknown if he can still build as he wants on Windows, or what he's getting when he checks "the result" after attempting "save".

That information would seem useful to understanding what's happening.


There has never been any issue with building or running on Windows, but neither I nor my mother have a Windows box to try anything on any more.

I don't see how I can check "the result" -- or anything else at the Livetalk level -- in a deployed standalone that AFAICT never displays the message box.
PhilHudson
 
Posts: 20
Joined: Thu Feb 05, 2015 12:38 am

Re: Ported app silently fails to save on Linux x64

Postby FourthWorld » Fri Feb 13, 2015 5:39 pm

Yes, to add code to an application you would need to do that in the IDE, and then build a fresh copy of the standalone.

The Message Box won't reveal anything meaningful from the result function; the result must be checked immediately after the command you're interested in:
http://livecode.com/developers/api/6.0. ... on/result/

To save a stack, somewhere in your code you have something like this:
Code: Select all
save stack "StackName"

To check what's happening with that, you would query the result immediately afterward:
Code: Select all
save stack "StackName"
if the result is not empty then
  answer the result && "(" & sysError() &")"
end if

I added a call to sysError there since it's sometimes useful for obtaining specifics about file I/O, returning the OS error code when something doesn't work as expected.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5305
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Ported app silently fails to save on Linux x64

Postby PhilHudson » Fri Feb 13, 2015 9:39 pm

FourthWorld wrote:To save a stack, somewhere in your code you have something like this:
Code: Select all
save stack "StackName"



My app has been correctly saving changes for many months. It stopped doing so when rebuilt for Linux. Whatever is at issue here, it is not my code.
PhilHudson
 
Posts: 20
Joined: Thu Feb 05, 2015 12:38 am

Re: Ported app silently fails to save on Linux x64

Postby FourthWorld » Fri Feb 13, 2015 9:56 pm

PhilHudson wrote:
FourthWorld wrote:To save a stack, somewhere in your code you have something like this:
Code: Select all
save stack "StackName"



My app has been correctly saving changes for many months. It stopped doing so when rebuilt for Linux. Whatever is at issue here, it is not my code.

I've expressed no opinion about your code. All I suggested was adding one line to obtain diagnostic info which may help you find out why your save command isn't saving.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5305
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Ported app silently fails to save on Linux x64

Postby PhilHudson » Sat Feb 14, 2015 2:16 am

FourthWorld wrote:
PhilHudson wrote:
FourthWorld wrote:To save a stack, somewhere in your code you have something like this:
Code: Select all
save stack "StackName"



My app has been correctly saving changes for many months. It stopped doing so when rebuilt for Linux. Whatever is at issue here, it is not my code.

I've expressed no opinion about your code. All I suggested was adding one line to obtain diagnostic info which may help you find out why your save command isn't saving.


Sorry, I'm not handling this well. Of course that's what you're suggesting. I really am grateful for the help. Thanks for your patience. I'll try that and get back with the output.
PhilHudson
 
Posts: 20
Joined: Thu Feb 05, 2015 12:38 am

Re: Ported app silently fails to save on Linux x64

Postby FourthWorld » Sat Feb 14, 2015 2:52 am

No problem, Phil. I like to see folks having a good time with LiveCode, so I'm almost as anxious to have this resolved as you are.

One thing to look for as you diagnose this: is the stack file you're saving to in a user-writable folder? Linux can get somewhat finicky about permissions.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5305
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Ported app silently fails to save on Linux x64

Postby PhilHudson » Sat Feb 14, 2015 6:20 pm

Well, I've finally got it working, with a properly built multi-stack deployment. Three stacks, not two, for some reason: one .livecode, one .rev, one with no suffix. Thanks for all the help. Adding some diagnostic 'answer the result' calls did help narrow things down.

In case anyone is interested, I've also taken the opportunity to build myself a simple but robust equivalent of the old HyperCard 'print report' command using a script-generated HTML file containing the "report" as a single HTML table and a shell script that uses the shell 'wkhtmltopdf' converter and the shell 'lp' print command. It should work on OS X too with a package manager like Fink/Macports/Homebrew. The shell script is simple enough to paste here:

Code: Select all
#!/usr/bin/env bash

# $1: Full pathname of HTML file to print
# $2 (optional): PDF file 'title' attribute

PDFFILE="${1}.pdf"
if [ -z "$2" ]; then
    wkhtmltopdf --quiet --orientation Portrait --page-size A4 "$1" "$PDFFILE"
else
    wkhtmltopdf --quiet --orientation Portrait --page-size A4 --title "$2" "$1" "$PDFFILE"
fi
lp -s "$PDFFILE"
Last edited by PhilHudson on Sat Feb 14, 2015 8:45 pm, edited 1 time in total.
PhilHudson
 
Posts: 20
Joined: Thu Feb 05, 2015 12:38 am

Re: Ported app silently fails to save on Linux x64

Postby FourthWorld » Sat Feb 14, 2015 8:33 pm

Great work, Phil. Glad you got your standalone saving, and thanks for the bash script - very handy.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 5305
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles

Re: Ported app silently fails to save on Linux x64

Postby jacque » Sat Feb 14, 2015 10:19 pm

Can you tell us more about what was wrong? Knowing the details would help others avoid some frustration. What did "the result" disclose?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 3796
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN

Re: Ported app silently fails to save on Linux x64

Postby mwieder » Tue Feb 17, 2015 9:19 pm

Phil-

Thanks for the shell script... that's quite clever.
And yes, please do enlighten the rest of us as to what was going on.
mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
 
Posts: 2561
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US

Previous

Return to Linux

Who is online

Users browsing this forum: No registered users and 1 guest

cron