Skip to content

Commit

Permalink
Pushing merge, resolved using upstream.\n\n message=update mono to ke…
Browse files Browse the repository at this point in the history
…ep details in commit and not pr

gonna double check it and merge it...

previous job failed on hte pr message, probably too complex

https://github.com/rive-app/rive/actions/runs/7929209375/job/21648989390

```
+ gh pr create --fill --title 'There have been merge conflicts' --body 'diff --cc .github/workflows/tests.yml
index 76659125,e20119eb..00000000
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@@ -58,8 -58,9 +58,12 @@@ jobs
          run: |
            cd dev/test
            C:\premake5.exe --scripts=..\..\build vs2022
++<<<<<<< ours
++=======
+           cd out/debug
++>>>>>>> theirs
            MSBuild rive.sln
-           build\bin\debug\tests.exe
+           tests.exe

    build-macos:
      runs-on: macOS-latest'
pull request create failed: GraphQL: Something went wrong while executing your query. Please include `16C0:22C1:77BF52E:7B4322F:65CF3854` when reporting this issue.
```

Diffs=
6059f744d update mono to keep details in commit and not pr (#6637)
a394393a0 update mono scripts to be able to create "fixing" pr (#6636)
2277c08fc Apply same changes as downstream (#6634)
faf6ea317 Option to build harfbuzz with renames to avoid static lib collision. (#6630)
c51bda03e Fix downstream windows tests. (#6632)

Co-authored-by: Luigi Rosso <[email protected]>
Co-authored-by: Maxwell Talbot <[email protected]> diff=\n\ndiff --cc .github/workflows/tests.yml
index 76659125,e20119eb..00000000
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@@ -58,8 -58,9 +58,12 @@@ jobs
          run: |
            cd dev/test
            C:\premake5.exe --scripts=..\..\build vs2022
++<<<<<<< ours
++=======
+           cd out/debug
++>>>>>>> theirs
            MSBuild rive.sln
-           build\bin\debug\tests.exe
+           tests.exe

    build-macos:
      runs-on: macOS-latest
  • Loading branch information
mjtalbot authored and mjtalbot committed Feb 16, 2024
1 parent d708426 commit c9a52af
Show file tree
Hide file tree
Showing 8 changed files with 912 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ jobs:
run: |
cd dev/test
C:\premake5.exe --scripts=..\..\build vs2022
cd out/debug
MSBuild rive.sln
build\bin\debug\tests.exe
tests.exe
build-macos:
runs-on: macOS-latest
Expand Down
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
34fff8ea44e3d30fb68912af71d35a808a2f8332
6059f744d9225938a1463ab66c965ecba7ec0dd3
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,19 @@ rive-cpp uses clang-format, you can install it with brew on MacOS: ```brew insta

## Memory Checks
Note that if you're on MacOS you'll want to install valgrind, which is somewhat complicated these days. This is the easiest solution (please PR a better one when it becomes available).

```
brew tap LouisBrunner/valgrind
brew install --HEAD LouisBrunner/valgrind/valgrind
```

You can now run the all the tests through valgrind by running ```test.sh memory```.

## Disassembly Explorer
If you want to examine the generated assembly code per cpp file, install [Disassembly Explorer](https://marketplace.visualstudio.com/items?itemName=dseight.disasexpl) in VSCode.

A ```disassemble``` task is provided to compile and preview the generated assembly. You can reach it via the Tasks: Run Task command palette or you can bind it to a shortcut by editing your VSCode keybindings.json:

```
[
{
Expand All @@ -75,4 +78,4 @@ A ```disassemble``` task is provided to compile and preview the generated assemb
"args": "disassemble"
}
]
```
```
28 changes: 28 additions & 0 deletions dependencies/gen_harfbuzz_renames/gen_header.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'dart:collection';
import 'dart:io';

var skip = HashSet.from(
[
'hb_color_get_alpha',
'hb_color_get_green',
'hb_color_get_blue',
'hb_color_get_red',
'hb_glyph_info_get_glyph_flags',
],
);

void main() {
var header = StringBuffer();
header.writeln('// clang-format off');
var contents = File('harfbuzz_names.txt').readAsStringSync();
RegExp exp = RegExp(r'\s_(hb_([a-zA-Z0-9_]*))$', multiLine: true);
Iterable<RegExpMatch> matches = exp.allMatches(contents);
for (final m in matches) {
var symbolName = m[1];
if (skip.contains(symbolName)) {
continue;
}
header.writeln('#define $symbolName rive_$symbolName');
}
File('../rive_harfbuzz_renames.h').writeAsStringSync(header.toString());
}
56 changes: 56 additions & 0 deletions dependencies/gen_harfbuzz_renames/gen_renames.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash
set -e

# This script should be called on a Mac!

if [[ ! -f "dependencies/bin/premake5" ]]; then
mkdir -p dependencies/bin
pushd dependencies
# v5.0.0-beta2 doesn't support apple silicon properly, update the branch
# once a stable one is avaialble that supports it
git clone --depth 1 --branch master https://github.com/premake/premake-core.git
pushd premake-core
if [[ $LOCAL_ARCH == "arm64" ]]; then
PREMAKE_MAKE_ARCH=ARM
else
PREMAKE_MAKE_ARCH=x86
fi
make -f Bootstrap.mak osx PLATFORM=$PREMAKE_MAKE_ARCH
cp bin/release/* ../bin
popd
popd
fi

export PREMAKE=$PWD/dependencies/bin/premake5

for var in "$@"; do
if [[ $var = "clean" ]]; then
echo 'Cleaning...'
rm -fR out
fi
done

mkdir -p out
mkdir -p out_with_renames

pushd ../../../
PACKAGES=$PWD
popd
export PREMAKE_PATH="dependencies/export-compile-commands":"$PACKAGES/runtime_unity/native_plugin/platform":"$PACKAGES/runtime/build":"$PREMAKE_PATH"

$PREMAKE gmake2 --file=../premake5_harfbuzz_v2.lua --out=out --no-harfbuzz-renames
pushd out
make -j$(($(sysctl -n hw.physicalcpu) + 1))
popd

nm out/librive_harfbuzz.a --demangle &>harfbuzz_names.txt

dart gen_header.dart

# make with renames just to examine the exported symbols...
$PREMAKE gmake2 --file=../premake5_harfbuzz_v2.lua --out=out_with_renames
pushd out_with_renames
make -j$(($(sysctl -n hw.physicalcpu) + 1))
popd

nm out_with_renames/librive_harfbuzz.a --demangle &>harfbuzz_renames.txt
11 changes: 11 additions & 0 deletions dependencies/premake5_harfbuzz_v2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ dofile('rive_build_config.lua')
local dependency = require('dependency')
harfbuzz = dependency.github('harfbuzz/harfbuzz', '6.0.0')

newoption({
trigger = 'no-harfbuzz-renames',
description = 'don\'t rename harfbuzz symbols',
})

project('rive_harfbuzz')
do
kind('StaticLib')
Expand Down Expand Up @@ -232,4 +237,10 @@ do
do
optimize('Size')
end

filter({ 'options:not no-harfbuzz-renames' })
do
includedirs({ './' })
forceincludes({ 'rive_harfbuzz_renames.h' })
end
end
Loading

0 comments on commit c9a52af

Please sign in to comment.