D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Sharaf Zaman
sh-zam abandoned this revision.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Sharaf Zaman
sh-zam added a comment.


  I tested it against Android NDK's toolchain and it built fine. So, probably 
an issue with `ECM/toolchain/Android.cmake`

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Volker Krause
vkrause added a comment.


  Are you sure? pwd.h of the NDK contains the following here:
  
#if __ANDROID_API__ >= 26
struct passwd* getpwent(void) __INTRODUCED_IN(26);

void setpwent(void) __INTRODUCED_IN(26);
void endpwent(void) __INTRODUCED_IN(26);
#endif /* __ANDROID_API__ >= 26 */
  
  So we should not need any declarations in our code for API >= 26 I think, 
which matches exactly the behavior I observe here when trying to compile 
kcoreaddons with different API levels.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Sharaf Zaman
sh-zam added a comment.


  When using `API >= 26`, it doesn't find the enclosed functions, so we will 
have to make them non-static in that case.
  
  PS: Making them non-static doesn't  break tests.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Volker Krause
vkrause added a comment.


  I can reproduce with -DCMAKE_ANDROID_API=26 here, while anything below builds 
fine. This seems to fix it:
  
diff --git a/src/lib/util/kuser_unix.cpp b/src/lib/util/kuser_unix.cpp
index c42ea99..216dfb7 100644
--- a/src/lib/util/kuser_unix.cpp
+++ b/src/lib/util/kuser_unix.cpp
@@ -36,7 +36,7 @@
 #include   // std::find
 #include  // std::function
 
-#if defined(__BIONIC__)
+#if defined(__BIONIC__) && __ANDROID_API__ < 26
 static inline struct passwd * getpwent() { return nullptr; }
 inline void setpwent() { }
 static inline void setgrent() { }

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Sharaf Zaman
sh-zam added a comment.


  Yes, that is confusing. I tried recreating the CI system, but it still 
doesn't compile.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Volker Krause
vkrause added a comment.


  The CI is building this successfully though, with API level 21: 
https://build.kde.org/job/Frameworks/job/kcoreaddons/job/kf5-qt5%20AndroidQt5.12/

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Sharaf Zaman
sh-zam added a comment.


  Removing them doesn't help either.
  
  We could use conditionals, but then I was using API 21 

 and it failed with that.

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-12 Thread Volker Krause
vkrause added a comment.


  Are we sure this doesn't need to be conditional on the API level? Ie. only 
have those dummy declarations available on API levels before they were 
introduced on Android?

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: vkrause, apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-11 Thread Aleix Pol Gonzalez
apol added a comment.


  Maybe it would make more sense to remove them instead?

REPOSITORY
  R244 KCoreAddons

REVISION DETAIL
  https://phabricator.kde.org/D19697

To: sh-zam
Cc: apol, kde-frameworks-devel, michaelh, ngraham, bruns


D19697: Fixes the build failure when using ECM Android toolchain

2019-03-11 Thread Sharaf Zaman
sh-zam created this revision.
Herald added a project: Frameworks.
sh-zam requested review of this revision.

REVISION SUMMARY
  ECM Android toolchain: 
https://phabricator.kde.org/source/extra-cmake-modules/browse/master/toolchain/Android.cmake
  Build failure log: https://paste.ubuntu.com/p/NBjfYXjXKx/

REPOSITORY
  R244 KCoreAddons

BRANCH
  android-bug-fix (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D19697

AFFECTED FILES
  src/lib/util/kuser_unix.cpp

To: sh-zam
Cc: kde-frameworks-devel, michaelh, ngraham, bruns