Ported app silently fails to save on Linux x64
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 20
- Joined: Thu Feb 05, 2015 12:38 am
Re: Ported app silently fails to save on Linux x64
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.
http://hudson-it.ddns.net/wlml-msw.txz
It's just under 1MB.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Ported app silently fails to save on Linux x64
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.
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.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Ported app silently fails to save on Linux x64
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.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.
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 20
- Joined: Thu Feb 05, 2015 12:38 am
Re: Ported app silently fails to save on Linux x64
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.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.
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.
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Ported app silently fails to save on Linux x64
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:
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.
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"
Code: Select all
save stack "StackName"
if the result is not empty then
answer the result && "(" & sysError() &")"
end if
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 20
- Joined: Thu Feb 05, 2015 12:38 am
Re: Ported app silently fails to save on Linux x64
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.FourthWorld wrote:To save a stack, somewhere in your code you have something like this:Code: Select all
save stack "StackName"
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Ported app silently fails to save on Linux x64
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.PhilHudson wrote: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.FourthWorld wrote:To save a stack, somewhere in your code you have something like this:Code: Select all
save stack "StackName"
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 20
- Joined: Thu Feb 05, 2015 12:38 am
Re: Ported app silently fails to save on Linux x64
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.FourthWorld wrote: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.PhilHudson wrote: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.FourthWorld wrote:To save a stack, somewhere in your code you have something like this:Code: Select all
save stack "StackName"
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Ported app silently fails to save on Linux x64
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.
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 20
- Joined: Thu Feb 05, 2015 12:38 am
Re: Ported app silently fails to save on Linux x64
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:
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.
-
- VIP Livecode Opensource Backer
- Posts: 9842
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Ported app silently fails to save on Linux x64
Great work, Phil. Glad you got your standalone saving, and thanks for the bash script - very handy.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 7238
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Ported app silently fails to save on Linux x64
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
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: Ported app silently fails to save on Linux x64
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.
Thanks for the shell script... that's quite clever.
And yes, please do enlighten the rest of us as to what was going on.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev