aliens

Author Topic: Converting OXCE to rapidyaml  (Read 6436 times)

Offline Yankes

  • Global Moderator
  • Commander
  • ***
  • Posts: 3350
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #135 on: November 22, 2024, 03:41:48 pm »
My idea was find what is exactly is in `<vector>` when we compile android.
This would answer what go wrong with this.
This could even give us fix for "upstream" to support this specific library in rapidyaml itself.

Online Delian

  • Commander
  • *****
  • Posts: 507
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #136 on: November 22, 2024, 04:02:36 pm »
In one of the c4core issues they get the same error, and they mention that _LIBCPP_ABI_NAMESPACE was only introduced with Clang 8.0.0-rc1.

You're using... NDK 18?
NDK r17 uses GCC
NDK r18 uses Clang 7.0.2
NDK r19 uses Clang 8.0.2
NDK r20 uses Clang 8.0.7
NDK r21 uses Clang 9.0.3

So, only NDK r18 is the issue because they don't use GCC anymore, and the _LIBCPP_ABI_NAMESPACE isn't introduced yet in Clang. How unlucky is that lol
« Last Edit: November 22, 2024, 07:26:43 pm by Delian »

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 9101
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #137 on: November 22, 2024, 05:24:19 pm »
yes, using Clang 7.0.2 on NDK r18b

NDK r19 wasn't compatible when we tried some years ago... project compiled, but the game just crashed.

I can try NDK r20, r21, maybe it's still relatively easy to upgrade...

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 9101
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #138 on: November 22, 2024, 10:44:11 pm »
I was able to use r19c, r20b and r21e.
(r22 and higher have some other structure and didn't work.)

All 3 versions I tried compiled without problems (and without any change in rapidyaml code).

However, none of them worked.
When I tried to run them on my phone (2-year old Samsung), all I got was a black screen :(


I'm pretty sure it's not a problem of those newer NDKs, or at least it is not caused only by them, because other people already compiled for example with r23b: https://github.com/MeridianOXC/openxcom-android/pull/3

...but until somebody gives me an idiot-proof guideline how to compile a working version with a newer SDK/NDK, I'm stuck with r18b, which is the only version that works for me.

"Custom library fix" is indeed annoying, but I'm willing to live with this one until there's a better solution.

Online Delian

  • Commander
  • *****
  • Posts: 507
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #139 on: November 22, 2024, 11:08:34 pm »
Might avoid the custom library fix if you just manually defined _LIBCPP_ABI_NAMESPACE in one of our files in the android branch.
But yeah, sorry, I don't know much about building and testing android apps. If r22+ has a different structure, then how were they able to compile with r23b? Also, have you tried running their build on your phone?
« Last Edit: November 22, 2024, 11:23:46 pm by Delian »

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 9101
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #140 on: November 23, 2024, 05:59:26 pm »
But yeah, sorry, I don't know much about building and testing android apps. If r22+ has a different structure, then how were they able to compile with r23b? Also, have you tried running their build on your phone?

They used a different SDK and modified the build files too, and also used a newer build plugin.
(might have even built it in Android Studio directly, instead of console, not sure)
I don't have their build result (APK file), so I cannot test it.

Eventually, I'll ask some colleague(s) from work to help me upgrade, but not now.

Ah, sorry, didn't read documentation carefully enough. As for making a suggestion, I can't, because I'm not a modder and it's not a QoL suggestion.

Congratulations, you've been added to the whitelist: https://openxcom.org/forum/index.php?topic=11631.msg166226#msg166226
Enjoy the new benefits (in moderation pls).

Online Delian

  • Commander
  • *****
  • Posts: 507
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #141 on: November 23, 2024, 07:43:17 pm »


Maybe, after this, we'll be able to afford 1ms to always have "discovered" and "autoSales" vectors sorted in the sav files. It's been super annoying testing round trips due to randomization of those two sections on every save.

Online Meridian

  • Global Moderator
  • Commander
  • ***
  • Posts: 9101
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #142 on: Today at 12:19:54 am »
If a yaml line contains any (trailing) tabs, they need to be removed
"  - a: 1         " is bad
"  - a: 1         #comment" is bad
"  - a: 1" is good
"  - a: 1 #comment" is good

I don't seem to get errors like this. (VS build)
Has something changed? (I use your last commit 78eab29)
Which file/line in the xcom1 ruleset could I use as an example to add a trailing tab?

Online Delian

  • Commander
  • *****
  • Posts: 507
    • View Profile
Re: Converting OXCE to rapidyaml
« Reply #143 on: Today at 12:49:53 am »
Hmm. Oh, it only applies to flow-style lines. Not "a: 1" but "{a: 1}" or "[1, 2]"
You can try changing options.cfg, first mapping from
  - active: true
    id: piratez
to
 - {active: true, id: piratez} tab tab

Also, to mapping or sequence start:
mods: tab tab
  - active: true
This will also crash. However, I don't think this occurred in any of the mods.
« Last Edit: Today at 01:03:42 am by Delian »