Giter Site home page Giter Site logo

realmspmxcode's Introduction

RealmSPMXcode

[Xcode 11] swift package generate-xcodeproj with RealmSwift dependency does not build.

An Xcode 11 project which is generated from an executable-type Swift Package which has RealmSwift as a dependency does not build.

The following issues have been reported as SwiftPM bugs:

Log file: log-swift_build.txt, log-generation-xcode-build.txt

Configuration:

  • Xcode 11.2.1 (11B500)
  • Swift 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9)
  • swift-tools-version:5.1
  • macOS Mojave 10.14.6 (18G1012)

Steps:

  1. Setup an executable type Swift Package with RealmSwift as a dependency.

  2. Verify build from the command line on has only a few warnings.

swift build

# RealmSPMXcode/.build/checkouts/realm-cocoa/Realm/RLMRealm.mm:135:17: 
# warning: method definition for 'privilegesForRealm' not found [-Wincomplete-implementation]
# @implementation RLMRealm {

# RealmSPMXcode/.build/checkouts/realm-cocoa/include/Realm/RLMRealm.h:658:1: 
# note: method 'privilegesForRealm' declared here
# - (struct RLMRealmPrivileges)privilegesForRealm;

## ... snip ...

# warnings generated.
# [139/139] Linking RealmSPMXcode
  1. Generate an Xcode 11 project from the Swift Package.
swift package generate-xcodeproj 
# generated: ./RealmSPMXcode.xcodeproj
open RealmSPMXcode.xcodeproj/
  1. Build in Xcode with "My Mac" as the target.

Workaround: Edit RealmCore 5.23.5/realm/util/terminate.cpp to remove the REALM_VER_CHUNK expansion related error:

REALM_NORETURN void terminate(const char* message, const char* file, long line) noexcept
{
    std::stringstream ss;
    // ss << file << ":" << line << ": " REALM_VER_CHUNK " " << message << '\n'; // :BEFORE:
    ss << file << ":" << line << ": [realm-core-5.23.5] " << message << '\n';    // :AFTER:
    terminate_internal(ss);
}

After the about workaround more errors occur:

Notice that .build/checkouts/realm-cocoa/Realm/ObjectStore/src/impl/results_notifier.hpp and .build/checkouts/realm-cocoa/Realm/ObjectStore/src/impl/results_notifier.cpp are in the same directly.

Next attempted workaround ...

// #include "impl/results_notifier.hpp"
#include "results_notifier.hpp"

... leads to yet more errors:

realmspmxcode's People

Contributors

marc-medley avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.