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

refactor: replace build_ios.sh with build_darwin.sh #91

Merged
merged 2 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.