Skip to content
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

[Android build] Abort on errors make all scripts to fail #9

Closed
BlisterB opened this issue Aug 8, 2016 · 17 comments
Closed

[Android build] Abort on errors make all scripts to fail #9

BlisterB opened this issue Aug 8, 2016 · 17 comments

Comments

@BlisterB
Copy link
Member

BlisterB commented Aug 8, 2016

Someone put thoses lines on every files related to Android building:

# abort on errors
set -e

It breaks all the building script : if just one line return a non success code, it ends. A lot of line return a non success code if the script is used a second time.

@Ghabry
Copy link
Member

Ghabry commented Aug 8, 2016

That is by design. Rerunning is only supported after using the clean up script

@BlisterB
Copy link
Member Author

BlisterB commented Aug 9, 2016

Okay, but where is this clean up script?

@Ghabry
Copy link
Member

Ghabry commented Aug 9, 2016

Hmmmm. At the end of Script 2.
In the other toolchains we did this different and had a seperate script instead of putting it at the end:

https://github.com/EasyRPG/buildscripts/blob/master/3ds/3_cleanup.sh

@carstene1ns
Copy link
Member

Yeah, this will be refactored anyway. Also, you do not need to run the library script anyway if you have a working toolchain.

@BlisterB
Copy link
Member Author

BlisterB commented Aug 9, 2016

Yeah, this will be refactored anyway.

Do you mean that the current buildscript isn't updated?
Because it failed at 3_build_liblcf from a scratch folder.

You sometimes needs to run again the scripts, for example when you want to update the Player, but I think I will stop to do that ^^".

@carstene1ns
Copy link
Member

If you would tell me what fails exactly, I could provide a quick solution...

@BlisterB
Copy link
Member Author

BlisterB commented Aug 9, 2016

I provided you an information (eg a specific script didn't worked), but you didn't (in this case, telling me if scripts are updated, to know if it worthfull to spend some time to know from where the problem came).
I'm sure it would have take the same amount of time to answer the question instead of formatting the word "would" and "could" in italic to make me feel like an idiot.

In this case, I was rebuilding all the thing, redirecting the error output to make it more easy to read for you... Nevermind.

@carstene1ns
Copy link
Member

I assume it is too much to copy over the terminal output of the script that fails so badly?
If so, nevermind, I am not going to try helping you anymore (and yes, using italics is much easier as trying to figure out the exactly error you having - the script is not just one line and it could fail at any).

@BlisterB
Copy link
Member Author

BlisterB commented Aug 9, 2016

Did you just read my message?
As you probably already know, those scripts produces too many output to be simply copy/paste from the terminal, I didn't have all the ouput of the execution of the 3_* file, and as often with this buildscript, a single warning line from the 2_* file could be the origin of the problem. I was currently doing the job to help you find easily the problem, it just take a lot of time with a student internet connection.

I hate to act like a drama queen but this is not the first time you post those kind of ironic messages and it become annoying when it's related to a buildscript that I fixed or help to fix several times to work on the project.

@carstene1ns
Copy link
Member

Well, ok. I will stop being ironic, if you give any meaningful hint where and what fails exactly.
The scripts have set -e because it makes them fail when anything is wrong.
That means: It will abort just at the point where the error occurs.
Unfortunately it is missing in the 0_*.sh one, so it still tries to build Player even when liblcf failed.
What I ask now is, why do you use this script to overwrite all anyway? As said you will not need to update the libraries that often.
So, try executing ...liblcf....sh and then upload the log to a pastebin (http://pastie.org) or tell us (it is not just me here) what it outputs and where the error is.

Honestly, if you not provide any more information, nobody can help you.

@BlisterB
Copy link
Member Author

BlisterB commented Aug 9, 2016

Thank you Carstene1ns for your answer.

I understand the idea of the new paradigm (build just one time) and I agree with it.
Imho it just should be mentioned in the README to not disturb futur developers because some command such as the patch in the 2_* file return a non zero code at the second execution and stop the script at its beginning. Which could be confusing without an explanation.

To answer to the question « why recompiling everything » : I’m currently trying to resolve a problem in the Android port with the Preferences refactoring.
When I exit a running game, an exception is thrown talking about a null reference in the new PreferenceManager. But it doesn’t make any sense since the variable supposed to be null is set at startup and never assigned to null.
With the Android debugging tool I found that the crasg comes during the execution of the native function endGame( ) (why the stacktrace talk about PreferencesManager? Absolutely no idea for the moment.). But the Android debugger doesn’t seem to work well with native function and doesn’t give me any relevant explanation about the freeze.

The curious thing is that the IDE compiler complained about not being able to resolve JNI function endGame( ) :
Cannot resolve corresponding JNI function Java_org_easyrpg_player_player_EasyRpgPlayerActivity_endGame

Even weirded : it does the same thing for toggleFPS, but the function works well in game. This is why in needed to rebuild the build chains : to know if the problem comes from it or not.

Now, here are the outputs of the execution of 3_* and 4* :
Please note that the last lines of the liblcf build file seems to give a hint (make has no rules):
3_build_liblcf.sh : http://pastie.org/10933719
4_build_android_port.sh : http://pastie.org/10933720
Those scripts has been executed in order, in a freshly git cloned buildscript folder.

If someone wants the output of the first and second script, I can upload it (~5mo each one, not suitable for pastie).

@carstene1ns
Copy link
Member

Okay, this seems like a problem with your homebrew install (Homebrew/legacy-homebrew#43874), gnu sed is not found.
Therefore Makefile.in is not created and so configure and make fail. Can you try setting the SED environment variable as said in the bugreport I linked above (or reinstall libtool) and see how it goes?

About endGame and ToggleFPS: they are called from Java, but are C++ ("native") code, so the debugger will likely not be able to make use of them. We had problems with crashes on Android when exiting earlier, but solved them by calling exit (0); just before closing the Player (https://github.com/EasyRPG/Player/blob/master/src/player.cpp#L378).

@BlisterB
Copy link
Member Author

BlisterB commented Aug 9, 2016

Thank you for the instructions, I will execute them tomorrow.
I just want to react about the endGame( ) part : in fact I should be able to just close the Player Activity (just like any Activity) from the Android code.
It could be an effective solution if it's compatible with SDL, avoiding some unnecessary calls to native function seems to be a good idea.

@Ghabry
Copy link
Member

Ghabry commented Aug 9, 2016

Mixed mode debugging is awful in android, Inever got this to work. Last time I had to debug on android i used the commandline gdb. Maybe android studio makes it less awful.

The jni functions are declared here: https://github.com/EasyRPG/Player/blob/master/builds/android/app/src/main/jni/src/org_easyrpg_player_player_EasyRpgPlayerActivity.cpp
As you can see endgame just sets the exit_flag. The player frees all resources and then reaches that exit (0). You could try removing that exit0, maybe it doesnt crash anymore.

@BlisterB
Copy link
Member Author

Firstly, thank you for the hint about brew. It seemed that my brew configuration has been broken at many levels after an update.
I re-install all the program and start again to build the buildscript but I encountered problems with 2_* file which seems to be linked with ldconfig.

Here is a link with a file containing the ouput :
https://drive.google.com/open?id=0BzyFBzg6Eyy5RzhMUk15RUJRVTg

@carstene1ns
Copy link
Member

The error you are hitting now is an oversight from our side, I intend to fix it in #10.

@BlisterB
Copy link
Member Author

Okay, thank you.

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

No branches or pull requests

3 participants