Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

mbgl-test-runner fails to link in mapbox-gl-native-ios workspace #16259

Open
@1ec5

Description

@1ec5

The mapbox/mapbox-gl-native-ios repository’s make xproj command generates a macos.xcworkspace that includes various gl-native targets, including mbgl-test-runner. mbgl-test-runner fails to build with the following linker errors:

Showing All Messages
Ld /path/to/mapbox-gl-native-ios/build/macos/Debug/mbgl-test-runner normal x86_64 (in target 'mbgl-test-runner' from project 'Mapbox GL Native')
    cd /path/to/mapbox-gl-native-ios/vendor/mapbox-gl-native
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -target x86_64-apple-macos10.15 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -L/path/to/mapbox-gl-native-ios/build/macos/Debug -F/path/to/mapbox-gl-native-ios/build/macos/Debug -filelist /path/to/mapbox-gl-native-ios/build/macos/Mapbox\ GL\ Native.build/Debug/mbgl-test-runner.build/Objects-normal/x86_64/mbgl-test-runner.LinkFileList -Xlinker -object_path_lto -Xlinker /path/to/mapbox-gl-native-ios/build/macos/Mapbox\ GL\ Native.build/Debug/mbgl-test-runner.build/Objects-normal/x86_64/mbgl-test-runner_lto.o -Xlinker -no_deduplicate -Wl,-headerpad_max_install_names -Wl,-force_load /path/to/mapbox-gl-native-ios/build/macos/test/Debug/libmbgl-test.a /path/to/mapbox-gl-native-ios/build/macos/Debug/libmbgl-core.a /path/to/mapbox-gl-native-ios/build/macos/Debug/libmbgl-vendor-csscolorparser.a /path/to/mapbox-gl-native-ios/build/macos/Debug/libmbgl-vendor-parsedate.a /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/OpenGL.tbd -framework AppKit -framework CoreGraphics -framework CoreLocation -framework SystemConfiguration /path/to/mapbox-gl-native-ios/build/macos/Debug/libmbgl-vendor-icu.a -lsqlite3 -lz /path/to/mapbox-gl-native-ios/build/macos/test/Debug/libmbgl-vendor-googletest.a -Xlinker -dependency_info -Xlinker /path/to/mapbox-gl-native-ios/build/macos/Mapbox\ GL\ Native.build/Debug/mbgl-test-runner.build/Objects-normal/x86_64/mbgl-test-runner_dependency_info.dat -o /path/to/mapbox-gl-native-ios/build/macos/Debug/mbgl-test-runner

clang: error: no such file or directory: '/path/to/mapbox-gl-native-ios/build/macos/test/Debug/libmbgl-test.a'
clang: error: no such file or directory: '/path/to/mapbox-gl-native-ios/build/macos/test/Debug/libmbgl-vendor-googletest.a'
Command Ld failed with a nonzero exit code

This is the Debug configuration, but the same errors occur in the other configurations.

To work around this issue, I modified the mbgl-test-runner target’s OTHER_LDFLAGS build setting to remove test/ from the paths of libmbgl-test.a and libmbgl-vendor-googletest.a. The other paths are already correct. This is a trivial change inside Xcode, but it doesn’t persist because mbgl relies on CMake to generate Xcode projects on the fly. I’m not sure what CMake magic is required to fix these paths.

I think this issue would also affect any future iOS test runner that becomes buildable within Xcode. It’s very useful to be able to run these test runners as part of the overall map SDK workspace, so that we can more confidently make changes across repositories such as mapbox/mapbox-gl-native-ios#189 / #16253.

/ref #16253 (comment)
/cc @mapbox/gl-native @mapbox/maps-ios

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildiOSMapbox Maps SDK for iOSmacOSMapbox Maps SDK for macOS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions