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

[libosmscout] Add new port #14485

Merged
merged 7 commits into from
Nov 11, 2020
Merged

[libosmscout] Add new port #14485

merged 7 commits into from
Nov 11, 2020

Conversation

OgreTransporter
Copy link
Contributor

This is a new port of libosmscout (https://github.com/Framstag/libosmscout).

@ghost
Copy link

ghost commented Nov 9, 2020

CLA assistant check
All CLA requirements met.

@NancyLi1013 NancyLi1013 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Nov 10, 2020
@PhoebeHui
Copy link
Contributor

PhoebeHui commented Nov 10, 2020

@OgreTransporter, could your format the vcpkg.json file? See https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#manifests for solution.

I also suggest to rename the port to 'framstag-libosmscout', I noticed there is also another package named to libosmscout. https://repology.org/project/libosmscout/versions

Thanks for your contribution!

@OgreTransporter
Copy link
Contributor Author

@OgreTransporter, could your format the vcpkg.json file? See https://github.com/microsoft/vcpkg/blob/master/docs/maintainers/maintainer-guide.md#manifests for solution.

I would be happy about a reasonable error message.

The formatting of the manifest files didn't match our expectation.

is not very helpful. Of course I used vcpkg.exe format-manifest --all before. What else is wrong?

I also suggest to rename the port to 'framstag-libosmscout', I noticed there is also another package named to libosmscout. https://repology.org/project/libosmscout/versions

I am against renaming the port. If the name is changed, repology probably cannot recognize the vcpkg package. For example, cairo is also called cairo everywhere. The listed packages have also not been maintained for years and are very outdated.

C:\dev\vcpkg>vcpkg.exe format-manifest --all
Succeeded in formatting the manifest files.

C:\dev\vcpkg>vcpkg.exe install libosmscout[cairo,directx,gdi,svg]:x64-windows
Computing installation plan...
The following packages will be built and installed:
    libosmscout[cairo,core,directx,gdi,svg]:x64-windows
Detecting compiler hash for triplet x64-windows...
Starting package 1/1: libosmscout:x64-windows
Building package libosmscout[cairo,core,directx,gdi,svg]:x64-windows...
Could not locate cached archive: C:\Users\IEUser\AppData\Local\vcpkg\archives\97\97a62f29ccc6aa6ac88f947eaada27885c0c6b48.zip
-- Using cached C:/dev/vcpkg/downloads/Framstag-libosmscout-c81e1d9a0f69cc5b93588dbe330b2af587162c5f.tar.gz
-- Cleaning sources at C:/dev/vcpkg/buildtrees/libosmscout/src/f587162c5f-4dbef76e40.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/dev/vcpkg/downloads/Framstag-libosmscout-c81e1d9a0f69cc5b93588dbe330b2af587162c5f.tar.gz
-- Using source at C:/dev/vcpkg/buildtrees/libosmscout/src/f587162c5f-4dbef76e40.clean
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Installing: C:/dev/vcpkg/packages/libosmscout_x64-windows/share/libosmscout/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: C:\Users\IEUser\AppData\Local\vcpkg\archives\97\97a62f29ccc6aa6ac88f947eaada27885c0c6b48.zip
Building package libosmscout[cairo,core,directx,gdi,svg]:x64-windows... done
Installing package libosmscout[cairo,core,directx,gdi,svg]:x64-windows...
Installing package libosmscout[cairo,core,directx,gdi,svg]:x64-windows... done
Elapsed time for package libosmscout:x64-windows: 19.09 min

Total elapsed time: 19.17 min

The package libosmscout:x64-windows provides CMake targets:

    find_package(libosmscout CONFIG REQUIRED)
    target_link_libraries(main PRIVATE OSMScout::OSMScout)


C:\dev\vcpkg>

@PhoebeHui
Copy link
Contributor

PhoebeHui commented Nov 10, 2020

For the name issue, @strega-nil, could you help confirm if it's okay in vcpkg?

Here is CI test failures, @OgreTransporter, could you confirm if it supports uwp and arm? let me know if you need full logs.
arm64-windows/arm-uwp:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.27.29110\include\xmmintrin.h(31,1): fatal error C1189: #error:  This header is specific to X86 and X64 targets 

x64-uwp:

C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(486,5): error MSB4181: The "CompileXaml" task returned false but did not log an error. [D:\buildtrees\libosmscout\x64-uwp-dbg\libosmscout\OSMScout.vcxproj]

    D:\buildtrees\libosmscout\src\f587162c5f-4dbef76e40.clean\libosmscout\src\osmscout\util\File.cpp(157,46): error C2664: 'DWORD GetFileAttributesW(LPCWSTR)': cannot convert argument 1 from 'const _Elem *' to 'LPCWSTR' [D:\buildtrees\libosmscout\x64-uwp-dbg\libosmscout\OSMScout.vcxproj]
         D:\buildtrees\libosmscout\src\f587162c5f-4dbef76e40.clean\libosmscout\src\osmscout\util\File.cpp(169,56): error C2664: 'DWORD GetFileAttributesW(LPCWSTR)': cannot convert argument 1 from 'const _Elem *' to 'LPCWSTR' [D:\buildtrees\libosmscout\x64-uwp-dbg\libosmscout\OSMScout.vcxproj]

x64-windows-static:

CMake Error:
  Error evaluating generator expression:
    $<TARGET_PDB_FILE:OSMScout>
  TARGET_PDB_FILE is allowed only for targets with linker created artifacts.

CMake Error:
  Error evaluating generator expression:
    $<TARGET_PDB_FILE:OSMScoutImport>
  TARGET_PDB_FILE is allowed only for targets with linker created artifacts.

CMake Error:
  Error evaluating generator expression:
    $<TARGET_PDB_FILE:OSMScoutGPX>
  TARGET_PDB_FILE is allowed only for targets with linker created artifacts.

CMake Error:
  Error evaluating generator expression:
    $<TARGET_PDB_FILE:OSMScoutMap>
  TARGET_PDB_FILE is allowed only for targets with linker created artifacts.

CMake Error:
  Error evaluating generator expression:
    $<TARGET_PDB_FILE:OSMScoutMapDirectX>
  TARGET_PDB_FILE is allowed only for targets with linker created artifacts.
CMake Error:
  Error evaluating generator expression:
    $<TARGET_PDB_FILE:OSMScoutMapGDI>
  TARGET_PDB_FILE is allowed only for targets with linker created artifacts.
CMake Error:
  Error evaluating generator expression:
    $<TARGET_PDB_FILE:OSMScoutMapSVG>
  TARGET_PDB_FILE is allowed only for targets with linker created artifacts.

x64-linux:

FAILED: BasemapImport/BasemapImport-1.1.1 
: && /usr/bin/c++ -fPIC -fvisibility=hidden -fopenmp -Wall -Winit-self -Wno-overloaded-virtual -Wcast-qual -Wwrite-strings -Wextra -Wno-long-long -Wno-unused-but-set-parameter -g  BasemapImport/CMakeFiles/BasemapImport.dir/src/BasemapImport.cpp.o -o BasemapImport/BasemapImport-1.1.1  libosmscout-import/libosmscout_importd.a  libosmscout/libosmscoutd.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libxml2.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblzmad.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libz.a  -lm  -ldl  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libprotobufd.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/liblzmad.a  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libz.a  -lm  -ldl  /mnt/vcpkg-ci/installed/x64-linux/debug/lib/libprotobufd.a  -lpthread  /usr/lib/x86_64-linux-gnu/libc.a && :
/usr/lib/x86_64-linux-gnu/libc.a(abort.o): In function `abort':
(.text+0x1e4): undefined reference to `__sigaction'
/usr/lib/x86_64-linux-gnu/libc.a(profil.o): In function `__profil':
(.text+0xbb): undefined reference to `__sigaction'
(.text+0x134): undefined reference to `__sigaction'
(.text+0x1d6): undefined reference to `__sigaction'
/usr/bin/ld: BasemapImport/BasemapImport-1.1.1: hidden symbol `__sigaction' isn't defined
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

@OgreTransporter
Copy link
Contributor Author

@PhoebeHui Thanks a lot for your help! I find it strange that the Linux build fails because the CI (https://ci.appveyor.com/project/Framstag/libosmscout/builds/36178606) of libosmscout works. What kind of Linux and which settings were used? static-windows I have fixed, UWP and ARM I will probably disable.

@OgreTransporter
Copy link
Contributor Author

I can build libsomscout statically with CMake and my own libraries, but not with vcpkg:

Building package glib[core]:x64-windows-static...
Could not locate cached archive: C:\Users\IEUser\AppData\Local\vcpkg\archives\b0\b0d4ff0d5c509e12b835275d1b95cfd508ff88b1.zip
-- Note: glib only supports dynamic library linkage. Building dynamic library.
CMake Error at scripts/cmake/vcpkg_check_linkage.cmake:42 (message):
  Refusing to build unexpected dynamic library against the static CRT.  If
  this is desired, please configure your triplet to directly request this
  configuration.
Call Stack (most recent call first):
  ports/glib/portfile.cmake:6 (vcpkg_check_linkage)
  scripts/ports.cmake:135 (include)


Error: Building package glib:x64-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: glib:x64-windows-static
  Vcpkg version: 2020.06.15-nohash

Additionally, attach any relevant sections from the log files above.

If the bug #12094 is fixed, I activate it again.

@PhoebeHui
Copy link
Contributor

@OgreTransporter, for linux, the CI test machine using ubuntu 18.04 with gnu 7.5.0, this issue could repro locally in my vm. I attached the full log:
failure logs for x64-linux (1).zip

For CI test machine deployment in linux, see https://github.com/microsoft/vcpkg/blob/master/scripts/azure-pipelines/linux/provision-image.sh

Noted that the linux passed in CI testing now since you add '!static' in supports, it actually skipped.

@PhoebeHui
Copy link
Contributor

All features test passed with x64-windows.

@OgreTransporter
Copy link
Contributor Author

When I found the Linux error I will activate it again. The CIs of libosmscout work under Ubuntu 18.04:

Windows static does not work for me because glib (dependency of a dependency) cannot be built. So, the package is only available as Windows DLLs for now. Later I can update it.

@OgreTransporter
Copy link
Contributor Author

I still do not understand the renaming. The ports of many libraries are named the same as the packages on different systems, like boost, bzip2, cairo, cgal, curl, etc. Isn't it also the sense that you can find a known library by its name again? But why should libosmscout be renamed?

@PhoebeHui
Copy link
Contributor

There is 2 packages named to libosmscout, and users may confused with the names, see doc

https://github.com/Framstag/libosmscout
https://github.com/OpenMandrivaAssociation/libosmscout

@OgreTransporter
Copy link
Contributor Author

Both are the same library, except that the Open Mandriva Association directory is outdated and https://github.com/Framstag/libosmscout is the official repository. The Mandriva directory is just an outdated build script like a vcpkg port.

@strega-nil
Copy link
Contributor

Confirmed that libosmscout is the correct name.

@strega-nil strega-nil merged commit 5746100 into microsoft:master Nov 11, 2020
@PhoebeHui PhoebeHui added info:reviewed Pull Request changes follow basic guidelines and removed requires:author-response labels Nov 12, 2020
@OgreTransporter OgreTransporter deleted the new-port-libosmscout branch November 12, 2020 08:54
@OgreTransporter
Copy link
Contributor Author

Many thanks for your help.

@strega-nil
Copy link
Contributor

Thank you @OgreTransporter ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants