version 2022.01.15-3-android fails to build if there is no .git directory #1862

Open
opened 2022-01-15 21:27:51 +00:00 by fgaz · 7 comments
fgaz commented 2022-01-15 21:27:51 +00:00 (Migrated from github.com)

I'm getting this error when trying to build 2022.01.15-3-android:

[337/395] Building CXX object generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o0_cxx.cxx.o
FAILED: generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o 
/nix/store/7wn7xx8faqirzkvh5iwj26b024jzg09p-gcc-wrapper-10.3.0/bin/g++ -DGFLAGS_IS_A_DLL=0 -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DRELEASE -DUCONFIG_USE_LOCAL -DUSE_FILE32API -I/build/source -I/build/source/3party/boost -I/build/source/3party/expat/expat/lib -I/build/source/build/3party/expat/expat -I/build/source/3party/icu/. -I/build/source/3party/icu/icu/icu4c/source/common -I/build/source/3party/icu/icu/icu4c/source/i18n -I/build/source/3party/liboauthcpp/include -I/build/source/3party/protobuf/protobuf/src -I/build/source/3party/opening_hours/. -I/build/source/build/3party/gflags/include -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/include/QtCore -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/./mkspecs/linux-g++ -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/include/QtNetwork -O3 -DNDEBUG -fPIE -fdiagnostics-color=always -ffast-math -Ofast -Wall -Wextra -Wno-unused-parameter -fPIC -std=c++17 -MD -MT generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o -MF generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o.d -o generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o -c /build/source/build/generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx
In file included from /build/source/build/generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx:3:
/build/source/generator/complex_generator/complex_generator.cpp:15:1: warning: multi-line comment [-Wcomment]
   15 | // $ ./complex_generator --maps_build_path=path/to/maps_build \
      | ^
In file included from /build/source/generator/complex_generator/complex_generator.cpp:45,
                 from /build/source/build/generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx:3:
/build/source/build_version.hpp:7:28: error: expected primary-expression before ';' token
    7 | constexpr uint64_t kCode = ;
      |                            ^
[338/395] Building CXX object generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o
FAILED: generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o 
/nix/store/7wn7xx8faqirzkvh5iwj26b024jzg09p-gcc-wrapper-10.3.0/bin/g++ -DGFLAGS_IS_A_DLL=0 -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DRELEASE -DUCONFIG_USE_LOCAL -DUSE_FILE32API -I/build/source -I/build/source/3party/boost -I/build/source/3party/expat/expat/lib -I/build/source/build/3party/expat/expat -I/build/source/3party/icu/. -I/build/source/3party/icu/icu/icu4c/source/common -I/build/source/3party/icu/icu/icu4c/source/i18n -I/build/source/3party/liboauthcpp/include -I/build/source/3party/protobuf/protobuf/src -I/build/source/3party/opening_hours/. -I/build/source/build/3party/gflags/include -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/include/QtCore -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/./mkspecs/linux-g++ -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/include/QtNetwork -O3 -DNDEBUG -fPIE -fdiagnostics-color=always -ffast-math -Ofast -Wall -Wextra -Wno-unused-parameter -fPIC -std=c++17 -MD -MT generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o -MF generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o.d -o generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o -c /build/source/build/generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx
In file included from /build/source/generator/generator_tool/generator_tool.cpp:73,
                 from /build/source/build/generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx:3:
/build/source/build_version.hpp:7:28: error: expected primary-expression before ';' token
    7 | constexpr uint64_t kCode = ;
      |                            ^
[339/395] Building CXX object generator/generator_tests/CMakeFiles/generator_tests.dir/Unity/unity_0_cxx.cxx.o
In file included from /build/source/generator/generator_tests/affiliation_tests.cpp:1,
                 from /build/source/build/generator/generator_tests/CMakeFiles/generator_tests.dir/Unity/unity_0_cxx.cxx:3:
/build/source/testing/testing.hpp:18:10: warning: 'UnitClass_CitiesIdsTest_BuildCitiesIds' has a base '{anonymous}::CitiesIdsTest' whose type uses the anonymous namespace [-Wsubobject-linkage]
   18 |   struct UnitClass_##CLASS##_##NAME : public CLASS \
      |          ^~~~~~~~~~
/build/source/generator/generator_tests/cities_ids_tests.cpp:67:1: note: in expansion of macro 'UNIT_CLASS_TEST'
   67 | UNIT_CLASS_TEST(CitiesIdsTest, BuildCitiesIds)
      | ^~~~~~~~~~~~~~~
In file included from /build/source/build/generator/generator_tests/CMakeFiles/generator_tests.dir/Unity/unity_0_cxx.cxx:73:
/build/source/generator/generator_tests/place_processor_tests.cpp:133:7: warning: 'generator_tests::TestPlaceProcessor' has a field 'generator_tests::TestPlaceProcessor::m_loader' whose type uses the anonymous namespace [-Wsubobject-linkage]
  133 | class TestPlaceProcessor
      |       ^~~~~~~~~~~~~~~~~~
In file included from /build/source/base/thread.hpp:5,
                 from /build/source/base/logging.hpp:6,
                 from /build/source/base/exception.hpp:4,
                 from /build/source/testing/testing.hpp:5,
                 from /build/source/generator/generator_tests/affiliation_tests.cpp:1,
                 from /build/source/build/generator/generator_tests/CMakeFiles/generator_tests.dir/Unity/unity_0_cxx.cxx:3:
/build/source/generator/generator_tests/cross_mwm_osm_ways_collector_tests.cpp: In constructor 'cross_mwm_osm_ways_collector_tests::CrossMwmWayCollectorTest::CrossMwmWayCollectorTest()':
/build/source/generator/generator_tests/cross_mwm_osm_ways_collector_tests.cpp:51:33: warning: ignoring return value of 'static Platform::EError Platform::MkDir(const string&)' declared with attribute 'warn_unused_result' [-Wunused-result]
   51 |     UNUSED_VALUE(Platform::MkDir(intermediateDir));
      |                  ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/build/source/base/macros.hpp:36:43: note: in definition of macro 'UNUSED_VALUE'
   36 | #define UNUSED_VALUE(x) static_cast<void>(x)
      |                                           ^
ninja: build stopped: subcommand failed.

I'm on NixOS linux, gcc 10.3.0, and I'm trying to update the version of the package i made

I'm getting this error when trying to build 2022.01.15-3-android: ``` [337/395] Building CXX object generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o0_cxx.cxx.o FAILED: generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o /nix/store/7wn7xx8faqirzkvh5iwj26b024jzg09p-gcc-wrapper-10.3.0/bin/g++ -DGFLAGS_IS_A_DLL=0 -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DRELEASE -DUCONFIG_USE_LOCAL -DUSE_FILE32API -I/build/source -I/build/source/3party/boost -I/build/source/3party/expat/expat/lib -I/build/source/build/3party/expat/expat -I/build/source/3party/icu/. -I/build/source/3party/icu/icu/icu4c/source/common -I/build/source/3party/icu/icu/icu4c/source/i18n -I/build/source/3party/liboauthcpp/include -I/build/source/3party/protobuf/protobuf/src -I/build/source/3party/opening_hours/. -I/build/source/build/3party/gflags/include -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/include/QtCore -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/./mkspecs/linux-g++ -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/include/QtNetwork -O3 -DNDEBUG -fPIE -fdiagnostics-color=always -ffast-math -Ofast -Wall -Wextra -Wno-unused-parameter -fPIC -std=c++17 -MD -MT generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o -MF generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o.d -o generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx.o -c /build/source/build/generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx In file included from /build/source/build/generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx:3: /build/source/generator/complex_generator/complex_generator.cpp:15:1: warning: multi-line comment [-Wcomment] 15 | // $ ./complex_generator --maps_build_path=path/to/maps_build \ | ^ In file included from /build/source/generator/complex_generator/complex_generator.cpp:45, from /build/source/build/generator/complex_generator/CMakeFiles/complex_generator.dir/Unity/unity_0_cxx.cxx:3: /build/source/build_version.hpp:7:28: error: expected primary-expression before ';' token 7 | constexpr uint64_t kCode = ; | ^ [338/395] Building CXX object generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o FAILED: generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o /nix/store/7wn7xx8faqirzkvh5iwj26b024jzg09p-gcc-wrapper-10.3.0/bin/g++ -DGFLAGS_IS_A_DLL=0 -DQT_CORE_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DRELEASE -DUCONFIG_USE_LOCAL -DUSE_FILE32API -I/build/source -I/build/source/3party/boost -I/build/source/3party/expat/expat/lib -I/build/source/build/3party/expat/expat -I/build/source/3party/icu/. -I/build/source/3party/icu/icu/icu4c/source/common -I/build/source/3party/icu/icu/icu4c/source/i18n -I/build/source/3party/liboauthcpp/include -I/build/source/3party/protobuf/protobuf/src -I/build/source/3party/opening_hours/. -I/build/source/build/3party/gflags/include -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/include/QtCore -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/./mkspecs/linux-g++ -isystem /nix/store/ihwd7nsmdwhrpz9h6qsxlaaqpj9dp545-qtbase-5.15.3-dev/include/QtNetwork -O3 -DNDEBUG -fPIE -fdiagnostics-color=always -ffast-math -Ofast -Wall -Wextra -Wno-unused-parameter -fPIC -std=c++17 -MD -MT generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o -MF generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o.d -o generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx.o -c /build/source/build/generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx In file included from /build/source/generator/generator_tool/generator_tool.cpp:73, from /build/source/build/generator/generator_tool/CMakeFiles/generator_tool.dir/Unity/unity_0_cxx.cxx:3: /build/source/build_version.hpp:7:28: error: expected primary-expression before ';' token 7 | constexpr uint64_t kCode = ; | ^ [339/395] Building CXX object generator/generator_tests/CMakeFiles/generator_tests.dir/Unity/unity_0_cxx.cxx.o In file included from /build/source/generator/generator_tests/affiliation_tests.cpp:1, from /build/source/build/generator/generator_tests/CMakeFiles/generator_tests.dir/Unity/unity_0_cxx.cxx:3: /build/source/testing/testing.hpp:18:10: warning: 'UnitClass_CitiesIdsTest_BuildCitiesIds' has a base '{anonymous}::CitiesIdsTest' whose type uses the anonymous namespace [-Wsubobject-linkage] 18 | struct UnitClass_##CLASS##_##NAME : public CLASS \ | ^~~~~~~~~~ /build/source/generator/generator_tests/cities_ids_tests.cpp:67:1: note: in expansion of macro 'UNIT_CLASS_TEST' 67 | UNIT_CLASS_TEST(CitiesIdsTest, BuildCitiesIds) | ^~~~~~~~~~~~~~~ In file included from /build/source/build/generator/generator_tests/CMakeFiles/generator_tests.dir/Unity/unity_0_cxx.cxx:73: /build/source/generator/generator_tests/place_processor_tests.cpp:133:7: warning: 'generator_tests::TestPlaceProcessor' has a field 'generator_tests::TestPlaceProcessor::m_loader' whose type uses the anonymous namespace [-Wsubobject-linkage] 133 | class TestPlaceProcessor | ^~~~~~~~~~~~~~~~~~ In file included from /build/source/base/thread.hpp:5, from /build/source/base/logging.hpp:6, from /build/source/base/exception.hpp:4, from /build/source/testing/testing.hpp:5, from /build/source/generator/generator_tests/affiliation_tests.cpp:1, from /build/source/build/generator/generator_tests/CMakeFiles/generator_tests.dir/Unity/unity_0_cxx.cxx:3: /build/source/generator/generator_tests/cross_mwm_osm_ways_collector_tests.cpp: In constructor 'cross_mwm_osm_ways_collector_tests::CrossMwmWayCollectorTest::CrossMwmWayCollectorTest()': /build/source/generator/generator_tests/cross_mwm_osm_ways_collector_tests.cpp:51:33: warning: ignoring return value of 'static Platform::EError Platform::MkDir(const string&)' declared with attribute 'warn_unused_result' [-Wunused-result] 51 | UNUSED_VALUE(Platform::MkDir(intermediateDir)); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /build/source/base/macros.hpp:36:43: note: in definition of macro 'UNUSED_VALUE' 36 | #define UNUSED_VALUE(x) static_cast<void>(x) | ^ ninja: build stopped: subcommand failed. ``` I'm on NixOS linux, gcc 10.3.0, and I'm trying to update the version of [the package i made](https://github.com/NixOS/nixpkgs/pull/123259)
biodranik commented 2022-01-15 21:36:05 +00:00 (Migrated from github.com)

Did you do a full git repo checkout or just downloaded an archive without a git? There is a tools/unix/version.sh script that fails for some reason in your case. It would be great to find the reason and properly fix it.

Did you do a full git repo checkout or just downloaded an archive without a git? There is a tools/unix/version.sh script that fails for some reason in your case. It would be great to find the reason and properly fix it.
fgaz commented 2022-01-15 21:47:32 +00:00 (Migrated from github.com)

We do a full recursive checkout, but the .git directory gets removed due to reproducibility and size concerns, so I guess that's why it fails, thanks for the pointer!

I can set it to save the .git directory too, though that's not ideal. Would it be possible to set the version externally? Would it be too disruptive if I patch version.sh and build_version.hpp.in to just print out " (NixOS)" or similar?

We do a full recursive checkout, but the .git directory gets removed due to reproducibility and size concerns, so I guess that's why it fails, thanks for the pointer! I can set it to save the .git directory too, though that's not ideal. Would it be possible to set the version externally? Would it be too disruptive if I patch version.sh and build_version.hpp.in to just print out "<git tag> (NixOS)" or similar?
biodranik commented 2022-01-16 22:45:31 +00:00 (Migrated from github.com)

Does shallow clone with depth 1 fix this issue?

version.sh should be updated to handle this issue, probably by grepping the version from data/countries.txt and always using a zero build.

Does shallow clone with depth 1 fix this issue? version.sh should be updated to handle this issue, probably by grepping the version from data/countries.txt and always using a zero build.
biodranik commented 2022-01-17 13:59:41 +00:00 (Migrated from github.com)

There is another possible solution: to grep version from android/src/fdroid/play/version.yaml

There is another possible solution: to grep version from android/src/fdroid/play/version.yaml
PureTryOut commented 2022-06-28 09:56:09 +00:00 (Migrated from github.com)

https://github.com/organicmaps/organicmaps/blob/master/tools/unix/version.sh#L10 breaks when building without a git repository. It would be great if packaging could just pass the version to the build. I suppose for now I can just sed that script manually.

https://github.com/organicmaps/organicmaps/blob/master/tools/unix/version.sh#L10 breaks when building without a git repository. It would be great if packaging could just pass the version to the build. I suppose for now I can just sed that script manually.
biodranik commented 2022-06-28 16:29:39 +00:00 (Migrated from github.com)

@PureTryOut do you also build a desktop version from sources without git?

@PureTryOut do you also build a desktop version from sources without git?
PureTryOut commented 2022-06-28 17:48:57 +00:00 (Migrated from github.com)

Yeah, and I just succeeded. It's interesting to package though, will need some changes to get most Linux distributions to like this.
I'm packaging it with the intention to run it on phones running postmarketOS, so I'm packaging this for Alpine Linux.

I'll make PR's and issues where I can for it though.

For now my build script does the following to workaround that script not working without git:

pkgver=2022.06.18.2
_pkgver="${pkgver%.*}-${pkgver##*.}-android"
cp build_version.hpp.in build_version.hpp
_date=${pkgver%.*}
_date=${_date//./}
_version=${_pkgver/-android/}

($_pkgver is needed because most packaging systems, including Alpine's, doesn't like stuff like -android and having dot notations and - notations mixed and doesn't allow using 2022.06.18-2-android as the package version)

Yeah, and I just succeeded. It's interesting to package though, will need some changes to get most Linux distributions to like this. I'm packaging it with the intention to run it on phones running postmarketOS, so I'm packaging this for Alpine Linux. I'll make PR's and issues where I can for it though. For now my build script does the following to workaround that script not working without git: ``` pkgver=2022.06.18.2 _pkgver="${pkgver%.*}-${pkgver##*.}-android" cp build_version.hpp.in build_version.hpp _date=${pkgver%.*} _date=${_date//./} _version=${_pkgver/-android/} ``` (`$_pkgver` is needed because most packaging systems, including Alpine's, doesn't like stuff like `-android` and having dot notations _and_ `-` notations mixed and doesn't allow using 2022.06.18-2-android as the package version)
This repo is archived. You cannot comment on issues.
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#1862
No description provided.