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

Fails to build for emscripten with REALM_ENABLE_SYNC=ON, assignment to const #7752

Closed
dg0yt opened this issue May 30, 2024 · 6 comments
Closed
Assignees

Comments

@dg0yt
Copy link

dg0yt commented May 30, 2024

Expected results

I'm updating the vcpkg port, and testing locally with emscripten.

Actual Results

Build failure in src/realm/object-store/sync/app.cpp:244, trying to assign to const.

/emsdk/upstream/emscripten/em++ -DREALM_APP_SERVICES=1 -DREALM_DEBUG=1 -DREALM_ENABLE_SYNC=1 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D_POSIX_C_SOURCE=200112L -I/vcpkg/buildtrees/realm-core/src/14.8.0-73529db997.clean/src -I/vcpkg/buildtrees/realm-core/wasm32-emscripten-dbg/src -I/vcpkg/buildtrees/realm-core/src/14.8.0-73529db997.clean/external/json -isystem /vcpkg/installed/wasm32-emscripten/include -g -std=c++17 -fPIC -fvisibility=hidden -Wall -Wextra -Wempty-body -Wparentheses -Wunknown-pragmas -Wunreachable-code -Wunused-parameter -Wno-missing-field-initializers -Wshorten-64-to-32 -Wconditional-uninitialized -Wextra-semi -Wno-nested-anon-types -Wdocumentation -Wthread-safety -Wthread-safety-negative -Wmissing-prototypes -Wno-psabi -Wpartial-availability -Wno-redundant-move -fdiagnostics-color -fwasm-exceptions -MD -MT src/realm/object-store/CMakeFiles/ObjectStore.dir/sync/app.cpp.o -MF src/realm/object-store/CMakeFiles/ObjectStore.dir/sync/app.cpp.o.d -o src/realm/object-store/CMakeFiles/ObjectStore.dir/sync/app.cpp.o -c /vcpkg/buildtrees/realm-core/src/14.8.0-73529db997.clean/src/realm/object-store/sync/app.cpp
/vcpkg/buildtrees/realm-core/src/14.8.0-73529db997.clean/src/realm/object-store/sync/app.cpp:244:28: error: no viable overloaded '='
        m_config.transport = std::make_shared<_impl::EmscriptenNetworkTransport>();
        ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:706:22: note: candidate function not viable: 'this' argument has type 'const std::shared_ptr<GenericNetworkTransport>', but method is not marked const
    shared_ptr<_Tp>& operator=(const shared_ptr& __r) _NOEXCEPT
                     ^
/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:714:22: note: candidate function template not viable: 'this' argument has type 'const std::shared_ptr<GenericNetworkTransport>', but method is not marked const
    shared_ptr<_Tp>& operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT
                     ^
/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:721:22: note: candidate function not viable: 'this' argument has type 'const std::shared_ptr<GenericNetworkTransport>', but method is not marked const
    shared_ptr<_Tp>& operator=(shared_ptr&& __r) _NOEXCEPT
                     ^
/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:729:22: note: candidate function template not viable: 'this' argument has type 'const std::shared_ptr<GenericNetworkTransport>', but method is not marked const
    shared_ptr<_Tp>& operator=(shared_ptr<_Yp>&& __r)
                     ^
/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__memory/shared_ptr.h:752:22: note: candidate template ignored: could not match 'unique_ptr' against 'shared_ptr'
    shared_ptr<_Tp>& operator=(unique_ptr<_Yp, _Dp>&& __r)
                     ^
1 error generated.

Steps & Code to Reproduce

vcpkg install realm-core:wasm32-emscripten with updated recipe for 14.8.0 and using openssl to provide hash algorithms.
= microsoft/vcpkg#39043 minus REALM_ENABLE_SYNC=OFF

Core version

Core version: 14.8.0

Copy link

sync-by-unito bot commented May 30, 2024

➤ PM Bot commented:

Jira ticket: RCORE-2147

@fealebenpae
Copy link
Member

Hey @dg0yt,

Emscripten is unfortunately not an officially supported code path (it's experimental at the preview stage right now) and it looks like it's regressed. Only the JavaScript language binding has been ever built with Emscripten, and it's likely that none of the other language bindings would work without some effort. It's possible that even if the compile errors you encountered are fixed you would still get a dud at runtime. My recommendation would be to not test the realm ports against the wasm triplets. Is there a way we could mark the port incompatible with them?

@dg0yt
Copy link
Author

dg0yt commented May 30, 2024

Is there a way we could mark the port incompatible with them?

Yes. Is there an official reference to back this limitation?

@fealebenpae
Copy link
Member

I don't believe we have it explicitly spelled out for realm-core anywhere, but we only test realm-core on the platforms that the Atlas Device SDKs run on and Emscripten is definitely not on the list. In any case, I am the original author of the Emscripten code path in realm-core, so please take my word for how limited it is.

@jbreams
Copy link
Contributor

jbreams commented Jul 31, 2024

@dg0yt, is there more to do here? I don't know when more work on supporting sync in emscripten will be scheduled, but this is not a supported configuration for now.

@dg0yt
Copy link
Author

dg0yt commented Jul 31, 2024

No. You may close the issue if you want.

@sync-by-unito sync-by-unito bot closed this as completed Jul 31, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 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

3 participants