realm / realm-dotnet

Realm is a mobile database: a replacement for SQLite & ORMs
https://realm.io
Apache License 2.0
1.25k stars 165 forks source link

Update the readme about building from source #1042

Closed sushihangover closed 7 years ago

sushihangover commented 7 years ago

Update and summary of tasks to be done under this issue:

Goal

Trying to build 0.81.0 from source on macOS via the README.md Building Realm section.

Expected Results

Successful cmd-line build and eventually to include the Realm/C# solution/project/source into a user code debugging session.

Actual Results

clang: error: no such file or directory: 
'/Users/sushi/code/github/realm-dotnet/wrappers/src/object-store/src/impl/realm_coordinator.cpp'

Steps & Code to Reproduce

foobar:realm-dotnet sushi$ git checkout 0.81.0
HEAD is now at 8528d88... Prepare for 0.81.0 (#1013)
foobar:realm-dotnet sushi$ cd wrappers/
foobar:wrappers sushi$ make clean
rm -fr build
rm -fr libs
rm -fr libs-dbg
rm -fr core
rm -fr core-android
rm -fr obj
foobar:wrappers sushi$ make all
tar xjf realm-sync-cocoa-1.0.0-BETA-5.0.tar.xz
touch core
xcodebuild -sdk iphoneos -configuration Release -target wrappers-sync EXTRA_PREPROCESSOR_DEFINITIONS=""REALM_ENABLE_SYNC=true""
Build settings from command line:
    EXTRA_PREPROCESSOR_DEFINITIONS = REALM_ENABLE_SYNC=true
    SDKROOT = iphoneos10.1

=== BUILD TARGET wrappers OF PROJECT wrappers WITH CONFIGURATION Release ===

Check dependencies

Write auxiliary files
/bin/mkdir -p /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/arm64
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/arm64/wrappers.LinkFileList
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-all-target-headers.hmap
/bin/mkdir -p /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/wrappers.LinkFileList
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-project-headers.hmap
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers.hmap
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-own-target-headers.hmap
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-all-non-framework-target-headers.hmap
/bin/mkdir -p /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7s
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7s/wrappers.LinkFileList
write-file /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-generated-files.hmap

CompileC build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/realm_coordinator.o src/object-store/src/impl/realm_coordinator.cpp normal armv7 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/sushi/code/github/realm-dotnet/wrappers
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode8.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode8.1.app/Contents/Developer/usr/bin:/Volumes/Code/android-sdk-macosx/tools:/Volumes/Code/android-sdk-macosx/platform-tools:/usr/bin:/Library/Frameworks/Mono.framework/Commands:/Applications/Xamarin Studio.app/Contents/Resources:/Applications/Xamarin Studio.app/Contents/MacOS:/usr/local/openssl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/sushi/.scripts"
    /Applications/Xcode8.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch armv7 -fmessage-length=90 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -std=gnu++1y -stdlib=libc++ -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DREALM_HAVE_CONFIG=1 -DREALM_USE_CF=0 -DREALM_ENABLE_SYNC=true -isysroot /Applications/Xcode8.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -miphoneos-version-min=7.1 -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -iquote /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-generated-files.hmap -I/Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-own-target-headers.hmap -I/Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-all-target-headers.hmap -iquote /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-project-headers.hmap -I/Users/sushi/code/github/realm-dotnet/wrappers/build/Release-iphoneos/include -Icore/include -Isrc/object-store/src -I/Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/DerivedSources/armv7 -I/Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/DerivedSources -F/Users/sushi/code/github/realm-dotnet/wrappers/build/Release-iphoneos -MMD -MT dependencies -MF /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/realm_coordinator.d --serialize-diagnostics /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/realm_coordinator.dia -c /Users/sushi/code/github/realm-dotnet/wrappers/src/object-store/src/impl/realm_coordinator.cpp -o /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/realm_coordinator.o
clang: error: no such file or directory: '/Users/sushi/code/github/realm-dotnet/wrappers/src/object-store/src/impl/realm_coordinator.cpp'
clang: error: no input files

CompileC build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/debug.o src/debug.cpp normal armv7 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/sushi/code/github/realm-dotnet/wrappers
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode8.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode8.1.app/Contents/Developer/usr/bin:/Volumes/Code/android-sdk-macosx/tools:/Volumes/Code/android-sdk-macosx/platform-tools:/usr/bin:/Library/Frameworks/Mono.framework/Commands:/Applications/Xamarin Studio.app/Contents/Resources:/Applications/Xamarin Studio.app/Contents/MacOS:/usr/local/openssl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/sushi/.scripts"
    /Applications/Xcode8.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch armv7 -fmessage-length=90 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -std=gnu++1y -stdlib=libc++ -Wno-trigraphs -fpascal-strings -Os -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DREALM_HAVE_CONFIG=1 -DREALM_USE_CF=0 -DREALM_ENABLE_SYNC=true -isysroot /Applications/Xcode8.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -miphoneos-version-min=7.1 -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -iquote /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-generated-files.hmap -I/Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-own-target-headers.hmap -I/Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-all-target-headers.hmap -iquote /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/wrappers-project-headers.hmap -I/Users/sushi/code/github/realm-dotnet/wrappers/build/Release-iphoneos/include -Icore/include -Isrc/object-store/src -I/Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/DerivedSources/armv7 -I/Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/DerivedSources -F/Users/sushi/code/github/realm-dotnet/wrappers/build/Release-iphoneos -MMD -MT dependencies -MF /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/debug.d --serialize-diagnostics /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/debug.dia -c /Users/sushi/code/github/realm-dotnet/wrappers/src/debug.cpp -o /Users/sushi/code/github/realm-dotnet/wrappers/build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/debug.o

** BUILD FAILED **

The following build commands failed:
    CompileC build/wrappers.build/Release-iphoneos/wrappers.build/Objects-normal/armv7/realm_coordinator.o src/object-store/src/impl/realm_coordinator.cpp normal armv7 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
make: *** [build/Release-iphoneos/libwrappers-sync.a] Error 65

Version of Realm and tooling

Realm version(s): Git tag 0.81.0 Which operating system version and device: macOS

nirinchev commented 7 years ago

That looks like a file from the object store submodule, did you do a "git submodule update"?

AndyDentFree commented 7 years ago

Note that the readme does not include checkout instructions for extra steps to get the submodules.

So anyone just simply following github's clone, especially if they download a zip, is missing that step.

I think if you looked at the situation with a downloaded zip before we moved to using submodules, it was a self-contained, buildable set of source.

sushihangover commented 7 years ago

This was a clone on another VM but I was not init'ing and updating the submodule.... dumb mistake, but as @AndyDentFree stated the README does not mention the submodule and and thus I cut/pasted the incomplete steps into the script, and I did not check submodule status.

Thanks, the VM is up, running and compiling now...

The README.md should read something like:

  1. Clone the repository and init/update the submodule(s)
  2. git submodule init
  3. git submdule update
  4. Assign the location of your android-ndk via the `NDK_ROOT env. var, i.e.
  5. export NDK_ROOT=/Volumes/Code/android-ndk/android-ndk-r11c
  6. cd wrappers
  7. make clean
  8. make all
  9. ~~~~~
nirinchev commented 7 years ago

Yes, the readme needs updating for sure! Thanks for bringing it up and glad that you're up and running now 👍

AndyDentFree commented 7 years ago

Occurred again today with someone who is building from source to play with sync.