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

Support platform macosx/arm64 #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
20 changes: 10 additions & 10 deletions .github/workflows/build-be.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,25 @@ jobs:
uses: actions/checkout@v2
- name: Configure paths
run: |
mkdir -p artifacts/{verbose,release,debug}/x64
mkdir -p artifacts/{verbose,release,debug}/universal
- name: Build Release
run: |
./build.sh
cp build/macosx/x86_64/release/libdoorstop.dylib artifacts/release/x64/libdoorstop.dylib
cp build/macosx/x86_64/release/.doorstop_version artifacts/release/x64/.doorstop_version
cp assets/nix/run.sh artifacts/release/x64/run.sh
cp build/macosx/universal/release/libdoorstop.dylib artifacts/release/universal/libdoorstop.dylib
cp build/macosx/universal/release/.doorstop_version artifacts/release/universal/.doorstop_version
cp assets/nix/run.sh artifacts/release/universal/run.sh
- name: Build Verbose
run: |
./build.sh -with_logging
cp build/macosx/x86_64/release/libdoorstop.dylib artifacts/verbose/x64/libdoorstop.dylib
cp build/macosx/x86_64/release/.doorstop_version artifacts/verbose/x64/.doorstop_version
cp assets/nix/run.sh artifacts/verbose/x64/run.sh
cp build/macosx/universal/release/libdoorstop.dylib artifacts/verbose/universal/libdoorstop.dylib
cp build/macosx/universal/release/.doorstop_version artifacts/verbose/universal/.doorstop_version
cp assets/nix/run.sh artifacts/verbose/universal/run.sh
- name: Build Debug
run: |
./build.sh -with_logging -debug
cp build/macosx/x86_64/debug/libdoorstop.dylib artifacts/debug/x64/libdoorstop.dylib
cp build/macosx/x86_64/debug/.doorstop_version artifacts/debug/x64/.doorstop_version
cp assets/nix/run.sh artifacts/debug/x64/run.sh
cp build/macosx/universal/debug/libdoorstop.dylib artifacts/debug/universal/libdoorstop.dylib
cp build/macosx/universal/debug/.doorstop_version artifacts/debug/universal/.doorstop_version
cp assets/nix/run.sh artifacts/debug/universal/run.sh
- name: Upload Release
uses: actions/upload-artifact@v2
with:
Expand Down
22 changes: 14 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ if [[ ! -d "$XMAKE_DIR" ]] || [[ ! -x "$xmake" ]]; then
curl -fSL "https://github.com/xmake-io/xmake/releases/download/v$XMAKE_VERSION/xmake-v$XMAKE_VERSION.$pack.run" > "$TOOLS_DIR/xmake.run"
log-8601-local "Downloading xmake maybe..."
sh "$TOOLS_DIR/xmake.run" --noexec --target "$XMAKE_BUILD_DIR"
log-8601-local "Buinding and installing xmake..."
log-8601-local "Building and installing xmake..."
if (cd "$XMAKE_BUILD_DIR" && ./configure && DESTDIR="$TOOLS_DIR" PREFIX="xmake" $make install); then
msg-success "xmake installed successfully"
else
Expand All @@ -248,10 +248,16 @@ if [[ ! -d "$XMAKE_DIR" ]] || [[ ! -x "$xmake" ]]; then
fi
fi

# Build projects for each arch
for arch in "${ARCHS[@]}"
do
log-8601-local "Building for $arch..."
"$xmake" f -a $arch -m $PROFILE --include_logging=$WITH_LOGGING
"$xmake" "$@"
done
if [[ "$(uname)" == "Darwin" ]]; then
log-8601-local "Building for macOS universal binary..."
"$xmake" f -m $PROFILE --include_logging=$WITH_LOGGING
"$xmake" "$@"
else
# Build projects for each arch
for arch in "${ARCHS[@]}"
do
log-8601-local "Building for $arch..."
"$xmake" f -a $arch -m $PROFILE --include_logging=$WITH_LOGGING
"$xmake" "$@"
done
fi
15 changes: 15 additions & 0 deletions src/nix/config.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "../config/config.h"
#include "../util/logging.h"
#include "../crt.h"

void get_env_bool(const char_t *name, bool_t *target) {
Expand Down Expand Up @@ -43,4 +44,18 @@ void load_config() {
get_env_path("DOORSTOP_CLR_RUNTIME_CORECLR_PATH",
&config.clr_runtime_coreclr_path);
get_env_path("DOORSTOP_CLR_CORLIB_DIR", &config.clr_corlib_dir);

//Print out all the relevant configuration settings using LOG()
LOG("DOORSTOP_ENABLED: %d", config.enabled);
LOG("DOORSTOP_REDIRECT_OUTPUT_LOG: %d", config.redirect_output_log);
LOG("DOORSTOP_IGNORE_DISABLED_ENV: %d", config.ignore_disabled_env);
LOG("DOORSTOP_MONO_DEBUG_ENABLED: %d", config.mono_debug_enabled);
LOG("DOORSTOP_MONO_DEBUG_SUSPEND: %d", config.mono_debug_suspend);
LOG("DOORSTOP_MONO_DEBUG_ADDRESS: %s", config.mono_debug_address);
LOG("DOORSTOP_TARGET_ASSEMBLY: %s", config.target_assembly);
LOG("DOORSTOP_BOOT_CONFIG_OVERRIDE: %s", config.boot_config_override);
LOG("DOORSTOP_MONO_DLL_SEARCH_PATH_OVERRIDE: %s",
config.mono_dll_search_path_override);
LOG("DOORSTOP_CLR_RUNTIME_CORECLR_PATH: %s", config.clr_runtime_coreclr_path);
LOG("DOORSTOP_CLR_CORLIB_DIR: %s", config.clr_corlib_dir);
}
2 changes: 1 addition & 1 deletion src/nix/entrypoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ __attribute__((constructor)) void doorstop_ctor() {
void *mono_handle = plthook_handle_by_name("libmono");

if (plthook_replace(hook, "mono_jit_init_version", &init_mono, NULL) != 0)
printf("Failed to hook jit_init_version, ignoring it. Error: %s\n",
printf("Failed to hook jit_init_version, ignoring it. This is probably fine unless you see other errors. Error: %s\n",
plthook_error());
else if (mono_handle)
load_mono_funcs(mono_handle);
Expand Down
Loading
Loading