-
Notifications
You must be signed in to change notification settings - Fork 515
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
Portable mac builds #2463
Merged
Merged
Portable mac builds #2463
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
00eed2f
Portable mac builds
bkase 90d8ab5
Correct snarky
bkase 2892fb1
Temporarily try builds on older macs
bkase 0f12571
Revert "Temporarily try builds on older macs"
bkase a9c4267
Requested changes
bkase aeffd45
Requested changes
bkase 2507764
Snarky back to master
bkase ad0425f
Merge branch 'master' into 'test-dist-ci'
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# ONLY USED FOR DEBUGGING | ||
# Use this script to verify that dist builds build on other machines | ||
# | ||
|
||
# Change to whatever dist.zip you stick on s3 | ||
DIST_ZIP="" | ||
BUCKET="" | ||
|
||
curl "https://s3-us-west-2.amazonaws.com/$BUCKET/$DIST_ZIP" > "$DIST_ZIP" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to hardcode the region name? Also, isn't this URL scheme deprecated? |
||
|
||
unzip "$DIST_ZIP" -d dist | ||
|
||
cd dist | ||
|
||
system_profiler SPSoftwareDataType | ||
sysctl -n machdep.cpu.brand_string | ||
|
||
echo "=========" | ||
echo "== Verify static initilization works" | ||
echo "=========" | ||
CODA_KADEMLIA_PATH=$PWD/kademlia ./coda.exe -help | ||
|
||
# Re-enable if you want to debug illegal instructions | ||
# lldb -o run ./coda.exe transaction-snark-profiler | ||
|
||
echo "=========" | ||
echo "== Verify snarks work" | ||
echo "=========" | ||
./coda.exe transaction-snark-profiler | ||
|
||
rm -rf ~/.coda-config | ||
|
||
echo "=========" | ||
echo "== Verify full test" | ||
echo "=========" | ||
CODA_KADEMLIA_PATH=$PWD/kademlia ./coda.exe integration-tests full-test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/bash | ||
|
||
# Create a portable Coda build by rewriting the dynamic library loading to look | ||
# in the current working directory. | ||
|
||
set -eou pipefail | ||
|
||
if [[ $# -ne 3 ]]; then | ||
echo "Usage: $0 <path-to-coda.exe> <path-to-kademlia-binary> <outdir>" | ||
exit 1 | ||
fi | ||
|
||
LOCAL_CODA_EXE="$(basename "$1")" | ||
LOCAL_KADEMLIA="$(basename "$2")" | ||
DIST_DIR="$3" | ||
|
||
mkdir -p "$DIST_DIR" | ||
|
||
cp "$1" "$DIST_DIR/$LOCAL_CODA_EXE" | ||
cp "$2" "$DIST_DIR/$LOCAL_KADEMLIA" | ||
chmod +w "$DIST_DIR/$LOCAL_KADEMLIA" | ||
|
||
pushd "$DIST_DIR" | ||
|
||
# Set of libraries and binaries we've already rewritten the tables | ||
SEEN=("") | ||
|
||
# `containsElement e array` returns 0 iff e is in the array | ||
# from https://stackoverflow.com/questions/3685970/check-if-a-bash-array-contains-a-value | ||
containsElement () { | ||
local e match="$1" | ||
shift | ||
for e; do [[ "$e" == "$match" ]] && return 0; done | ||
return 1 | ||
} | ||
|
||
# Rewrite the libraries' and binaries' dylib names | ||
fixup() { | ||
local BIN="$1" | ||
|
||
local LIBS=$(otool -l "$BIN" | grep -E '\s+name' | grep -E '/local' | awk '{print $2}') | ||
|
||
echo "$LIBS" | while read lib; do | ||
local LOCAL_LIB="$(basename $lib)" | ||
if ! containsElement "$LOCAL_LIB" "${SEEN[@]}"; then | ||
echo "Moving and rewriting $lib" | ||
cp -n "$lib" "$LOCAL_LIB" # no clobber in case we've already moved this lib | ||
chmod +w "$LOCAL_LIB" | ||
install_name_tool -change "$lib" "@executable_path/$(basename $lib)" "$BIN" || exit 1 | ||
# Add to our seen set, by adding to the array and then filtering dupes | ||
SEEN+=("$BIN") | ||
SEEN=($(for v in "${SEEN[@]}"; do echo "$v";done | sort | uniq | xargs)) | ||
# Recursively call for this lib | ||
fixup "$LOCAL_LIB" | ||
fi | ||
done | ||
} | ||
|
||
# Start with coda.exe | ||
fixup "$LOCAL_CODA_EXE" | ||
|
||
# Fixup kademlia | ||
K_LIBS=$(otool -l kademlia | grep -E '\s+name' | grep '/nix' | grep -v '\-osx\-' | awk '{print $2}') | ||
echo "$K_LIBS" | while read lib; do | ||
# we already have all the libs from coda.exe thankfully | ||
install_name_tool -change "$lib" "@executable_path/$(basename $lib)" "$LOCAL_KADEMLIA" | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule snarky
updated
2 files
+0 −1 | src/camlsnark_c/camlsnark_linker_flags_gen.ml | |
+9 −3 | src/camlsnark_c/dune |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
second build should be "work"