Skip to content

Commit

Permalink
Merge pull request #91 from doronz88/refactor/build_darwin
Browse files Browse the repository at this point in the history
refactor: replace build_ios.sh with build_darwin.sh
  • Loading branch information
doronz88 authored Feb 23, 2022
2 parents 58c7701 + feb43ce commit c19008e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
*.i*86
*.x86_64
*.hex
src/rpcserver/rpcserver
src/rpcserver_*
src/rpcserver/rpcserver_*

# Caches
__pycache__
Expand Down
20 changes: 0 additions & 20 deletions src/build_ios.sh

This file was deleted.

3 changes: 3 additions & 0 deletions src/rpcclient/tests/test_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_spawn_foreground_sanity(client, argv, expected_stdout, errorcode):
assert expected_stdout == stdout.read().strip()


@pytest.mark.local_only
@pytest.mark.parametrize('argv,expected_stdout,errorcode', [
[['/bin/sleep', '0'], '', 0],
[['/bin/echo', 'blat'], 'blat', 0],
Expand All @@ -46,6 +47,8 @@ def test_spawn_background_sanity(client):
client.processes.kill(spawn_result.pid)


@pytest.mark.local_only
@pytest.mark.local_only
def test_spawn_background_stress(client):
for i in range(1000):
test_spawn_background_sanity(client)
32 changes: 32 additions & 0 deletions src/rpcserver/build_darwin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

NC='\033[0m' # No Color
RED='\033[0;31m'
GREEN='\033[0;32m'

for i in iphoneos,arm64 macosx,x86_64
do
IFS=","
set -- $i;

echo "${GREEN}Building $1:$2 ${NC}"

SDK="$1"
ARCH="$2"
SYSROOT="$(xcrun --sdk $SDK --show-sdk-path)"
CC="$(xcrun -f --sdk $SDK clang)"
CFLAGS="-arch $ARCH --sysroot=$SYSROOT"

make clean
make all SERVER_CC="$CC" SERVER_CFLAGS="$CFLAGS"

server_binary=rpcserver_${SDK}_${ARCH}
cp rpcserver $server_binary

if test "$SDK" = 'iphoneos'; then
codesign -s - --entitlements ents.plist --generate-entitlement-der $server_binary
fi
done

# clean old binaries
make clean
File renamed without changes.

0 comments on commit c19008e

Please sign in to comment.