Page 3 of 3
Re: Ported app silently fails to save on Linux x64
Posted: Fri Feb 13, 2015 12:13 am
by PhilHudson
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.
Re: Ported app silently fails to save on Linux x64
Posted: Fri Feb 13, 2015 12:14 am
by mwieder
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.
Re: Ported app silently fails to save on Linux x64
Posted: Fri Feb 13, 2015 1:02 am
by FourthWorld
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.
Re: Ported app silently fails to save on Linux x64
Posted: Fri Feb 13, 2015 10:13 am
by PhilHudson
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.
Re: Ported app silently fails to save on Linux x64
Posted: Fri Feb 13, 2015 5:39 pm
by FourthWorld
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:
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.
Re: Ported app silently fails to save on Linux x64
Posted: Fri Feb 13, 2015 9:39 pm
by PhilHudson
FourthWorld wrote:To save a stack, somewhere in your code you have something like this:
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.
Re: Ported app silently fails to save on Linux x64
Posted: Fri Feb 13, 2015 9:56 pm
by FourthWorld
PhilHudson wrote:FourthWorld wrote:To save a stack, somewhere in your code you have something like this:
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.
Re: Ported app silently fails to save on Linux x64
Posted: Sat Feb 14, 2015 2:16 am
by PhilHudson
FourthWorld wrote:PhilHudson wrote:FourthWorld wrote:To save a stack, somewhere in your code you have something like this:
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.
Re: Ported app silently fails to save on Linux x64
Posted: Sat Feb 14, 2015 2:52 am
by FourthWorld
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.
Re: Ported app silently fails to save on Linux x64
Posted: Sat Feb 14, 2015 6:20 pm
by PhilHudson
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"
Re: Ported app silently fails to save on Linux x64
Posted: Sat Feb 14, 2015 8:33 pm
by FourthWorld
Great work, Phil. Glad you got your standalone saving, and thanks for the bash script - very handy.
Re: Ported app silently fails to save on Linux x64
Posted: Sat Feb 14, 2015 10:19 pm
by jacque
Can you tell us more about what was wrong? Knowing the details would help others avoid some frustration. What did "the result" disclose?
Re: Ported app silently fails to save on Linux x64
Posted: Tue Feb 17, 2015 9:19 pm
by mwieder
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.