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

Incomplete instructions and build issues #7

Open
Simran-B opened this issue Apr 2, 2024 · 3 comments
Open

Incomplete instructions and build issues #7

Simran-B opened this issue Apr 2, 2024 · 3 comments

Comments

@Simran-B
Copy link

Simran-B commented Apr 2, 2024

Trying to compile following the README.md, I can into the following problems:

  • The git clone command shows the use of the SSH protocol. This results in a [email protected]: permission denied (publickey) error for me. Using git clone https://github.com/rive-app/rive-renderer works.
  • Using git clone --resurve-submodules https://... fails with the same error. Changing .gitmodules to url = https://github.com/rive-app/rive-cpp.git and then running git submodule update --init --recursive helped.
  • The Build GLFW step requires CMake. A standard Xcode installation does not come with a bundled CMake (at least not in v12.4), it needs to be installed separately and added to the PATH to avoid ./make_glfw.sh: line 24: cmake: command not found
  • The Call Premake & Build step doesn't mention at what path to run the commands. It can be deduced that it must be the rive-renderer folder, though.
  • Running the ... premake5 gmake2 ... command fails with Error: ...renderer/submodules/rive-cpp/build/rive_build_config.lua:323: attempts to concatenate a nil value (global 'iphoneos_sysroot'). I'm not familiar enough with Lua/premake but it seems strange that the code where the concatenation happens is executed despite filter({ 'system:ios', ... }). I worked around the problem by adding or '' in build/rive_build_config.lua where the sysroot variables are set.
  • path_fiddle is in the rive_renderer folder, not in out/release.
  • The metal utility is required, which means you need a full Xcode installation, not only the Command Line Tools for Xcode. I can't install Xcode on the device in question and I'm not even sure if the latest available Xcode for the outdated platform includes the metal utility so I cannot check for more issues with the compilation.

The system I tried the above on was a MacBook Air from 2014 running Catalina, Intel CPU. This may not be a representative device but I think all of the above papercuts equally apply to newer devices and OS versions.


On Windows, the first two bullet points apply as well. Other issues I encountered:

  • To run make make_glfw.sh, you can use Git Bash. But it doesn't have the touch command which is used in renderer/shaders/Makefile. I substituted @touch $(MINIFY_STAMP) with echo "" > $(MINIFY_STAMP).
  • The premake command needs to be different to use the Microsoft toolchain. The environment variable needs to be set differently - I used $Env:PREMAKE_PATH="C:/<some-path>/submodules/rive-cpp/build" in PowerShell. The generator needs to be set according to the installed Visual Studio version, e.g. premake5 vs2019 --toolset msc ... instead of premake gmake2 ....
  • There were issues with the path_fiddle target that I worked around by setting the C++ standard to C++20 and disabling to treat warnings as errors (/WX-) in Visual Studio for the rive.sln. Using vcvars64.bat, everything compiled successfully with msbuild .\rive.sln and the path_fiddle.exe works.

I'd appreciate it if you could share the commands you use to compile for Windows. Do you use MinGW?

@Voulz
Copy link
Collaborator

Voulz commented Apr 9, 2024

@Simran-B, I have used the commands below to successfully compile rive-renderer on Windows using Git Bash (after installing premake5 and the python library).
Once the rive-renderer and submodules are cloned, right click in the folder and use Git Bash Here, then run the following commands:

premake5 --scripts=submodules/rive-cpp/build --with_rive_text --config=release vs2022
## Then we need to build glfw
cd submodules/rive-cpp/skia/dependencies
sh make_glfw.sh
cd ../../../..
## might need to run the premake command again

You should then have a new folder out/release/ with a solution file rive.sln. Running path fiddle from VS works for me

@Simran-B
Copy link
Author

Simran-B commented Apr 9, 2024

It's possible that the C++20 issues are fixed in VS2022, I only have VS2019 installed at the moment and therefore only tried this version. Not sure about the touch command, it does appear to be available in Git Bash, but I definitely got an error saying that it is not available when it got called from the script. Maybe it's one of these odd shell script errors that are caused by Windows line endings (Git core.autocrlf true) - this does occasionally lead to strange errors like "... command not found" despite the command existing.

I did manage to compile Rive on Windows with my workarounds already but thanks for sharing what works for you!

@MickeyMiao7
Copy link

  • Running the ... premake5 gmake2 ... command fails with Error: ...renderer/submodules/rive-cpp/build/rive_build_config.lua:323: attempts to concatenate a nil value (global 'iphoneos_sysroot'). I'm not familiar enough with Lua/premake but it seems strange that the code where the concatenation happens is executed despite filter({ 'system:ios', ... }). I worked around the problem by adding or '' in build/rive_build_config.lua where the sysroot variables are set.

for the convenience of anyone potentially came into the same issue when trying to build river-renderer on Mac, I managed to solve this issue by installing XCode and then ran this command the shell:

sudo xcode-select --switch /Applications/Xcode.app;

It makes sure that the two variables get the value properly in the lua script:

iphoneos_sysroot = os.outputof('xcrun --sdk iphoneos --show-sdk-path')
iphonesimulator_sysroot = os.outputof('xcrun --sdk iphonesimulator --show-sdk-path')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants