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

Realm doesn't build when using Swift on Linux #8590

Closed
xit0c opened this issue May 16, 2024 · 3 comments
Closed

Realm doesn't build when using Swift on Linux #8590

xit0c opened this issue May 16, 2024 · 3 comments

Comments

@xit0c
Copy link

xit0c commented May 16, 2024

How frequently does the bug occur?

Always

Description

First of all, I'm not sure if this library is intended to be used outside of the Xcode/iOS/macOS environment so, if it's not, feel free to close this issue immediately.

That said, the issue is actually pretty straightforward: adding realm-swift to a Swift project on Linux breaks the build.

Stacktrace & log output

~/realm-demo$ swift build

Building for debugging...

In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/util/math/mathlimits.cc:6:
~/realm-demo/.build/checkouts/realm-core/src/external/s2/util/math/mathlimits.h:18:10: fatal error: 'cfloat' file not found
#include <cfloat>
         ^~~~~~~~
1 error generated.
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/util/math/mathutil.cc:10:
~/realm-demo/.build/checkouts/realm-core/src/external/s2/util/math/mathlimits.h:18:10: fatal error: 'cfloat' file not found
#include <cfloat>
         ^~~~~~~~
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2latlng.cc:2:
~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2.h:10:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2r2rect.cc:3:
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2r2rect.h:6:
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/base/basictypes.h:9:
~/realm-demo/.build/checkouts/realm-core/src/external/s2/base/casts.h:16:10: fatal error: 'typeinfo' file not found
#include <typeinfo>         // for enumeration casts and tests
         ^~~~~~~~~~
~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2polyline.cc:3:10: fatal error: 'set' file not found
#include <set>
         ^~~~~
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2polygonbuilder.cc:3:
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2polygonbuilder.h:7:
~/realm-demo/.build/checkouts/realm-core/src/external/s2/hash.h:4:10: fatal error: 'unordered_map' file not found
#include <unordered_map>
         ^~~~~~~~~~~~~~~
~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2loop.cc:3:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2pointregion.cc:3:
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2pointregion.h:6:
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/base/logging.h:17:
In file included from ~/realm-demo/.build/checkouts/realm-core/src/realm/util/assert.hpp:23:
~/realm-demo/.build/checkouts/realm-core/src/realm/util/terminate.hpp:22:10: fatal error: 'cstdlib' file not found
#include <cstdlib>
         ^~~~~~~~~
~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2latlngrect.cc:3:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2region.cc:3:
In file included from ~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2region.h:6:
~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2.h:10:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~
~/realm-demo/.build/checkouts/realm-core/src/external/s2/s2polygon.cc:3:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~

Can you reproduce the bug?

Always

Reproduction Steps

  1. Install Swift (Linux installation instructions here, I used the tarball option)
  2. Init a Swift project with
mkdir RealmDemo
cd RealmDemo
swift package init --name RealmDemo
  1. Add the realm-swift dependency in Package.swift
  2. Run swift build to build the project

Version

10.50.0

What Atlas Services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

Linux Mint 19.3 (Ubuntu 22.04)

Build environment

Swift: 5.10

Copy link

sync-by-unito bot commented May 16, 2024

➤ PM Bot commented:

Jira ticket: RCOCOA-2362

@xit0c
Copy link
Author

xit0c commented May 16, 2024

This is happening also with Swift on Windows

@nirinchev
Copy link
Member

Per my comment on the other issue, only Apple platforms are currently supported. We do have long-term plans to create a pure Swift SDK that can run anywhere, but we're still very far from that future and there's no certainty it will ever arrive.

@nirinchev nirinchev closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants