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

chore(deps): bump pypa/cibuildwheel from 2.22.0 to 2.23.0 #147

Merged
merged 5 commits into from
Mar 3, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
run: echo "CONAN_HOME=/host${HOME}/.conan2" >> $GITHUB_ENV

- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
uses: pypa/cibuildwheel@v2.23.0
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
CIBW_BUILD: ${{ matrix.python-tag }}-${{ matrix.platform }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-portable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: lukka/get-cmake@latest

- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
uses: pypa/cibuildwheel@v2.23.0
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
CIBW_BUILD: cp312-win_amd64
Expand Down
5 changes: 5 additions & 0 deletions endstone/_internal/bootstrap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import os
import platform
import shutil
import subprocess
import sys
import tempfile
Expand All @@ -12,6 +13,7 @@

import click
import requests
import sentry_crashpad
from packaging.version import Version
from rich.progress import BarColumn, DownloadColumn, Progress, TextColumn, TimeRemainingColumn

Expand Down Expand Up @@ -135,6 +137,9 @@ def _download(self, dst: Union[str, os.PathLike]) -> None:

def _prepare(self) -> None:
self.plugin_path.mkdir(parents=True, exist_ok=True)
shutil.copytree(
Path(sentry_crashpad._get_executable("crashpad_handler")).parent, self.server_path, dirs_exist_ok=True
)

def _install(self) -> None:
"""
Expand Down
1 change: 1 addition & 0 deletions endstone/_internal/bootstrap/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def _prepare(self) -> None:
super()._prepare()
st = os.stat(self.executable_path)
os.chmod(self.executable_path, st.st_mode | stat.S_IEXEC)
os.chmod(self.server_path / "crashpad_handler", st.st_mode | stat.S_IEXEC)

def _create_process(self, *args, **kwargs) -> None:
env = os.environ.copy()
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies = [
"pyyaml",
"requests",
"rich",
"sentry-crashpad==0.7.17.1",
"tomlkit",
"typing-extensions",
]
Expand All @@ -57,7 +58,7 @@ endstone = "endstone._internal.bootstrap:cli"
[tool.scikit-build]
build-dir = "build/{wheel_tag}"
cmake.args = ["-G Ninja"]
cmake.build-type = "Release"
cmake.build-type = "RelWithDebInfo"
cmake.define = { BUILD_TESTING = "OFF" }
wheel.packages = ["endstone"]
wheel.license-files = ["LICENSE"]
Expand Down
14 changes: 0 additions & 14 deletions src/endstone/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,9 @@ if (DEFINED SKBUILD_PROJECT_VERSION_FULL)
target_compile_definitions(endstone_core PUBLIC ENDSTONE_VERSION="${SKBUILD_PROJECT_VERSION_FULL}")
endif ()

# The crashpad handler executable must be shipped alongside our shared library
add_custom_target(
copy_crashpad_handler
ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${sentry_INCLUDE_DIRS}/../bin/ ${CMAKE_BINARY_DIR}/crashpad
COMMENT "Copying crashpad_handler${CMAKE_EXECUTABLE_SUFFIX}"
)
add_dependencies(copy_crashpad_handler endstone_runtime)

include(GNUInstallDirs)
install(TARGETS endstone_core
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY ${CMAKE_BINARY_DIR}/crashpad/ DESTINATION "endstone/_internal/" COMPONENT endstone_wheel OPTIONAL
FILE_PERMISSIONS
OWNER_READ OWNER_EXECUTE OWNER_WRITE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
16 changes: 2 additions & 14 deletions src/endstone/core/crash_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ struct exception_slot {
const char *description;
};

#define EXCEPTION_DEF(code, desc) \
{ \
code, #code, desc \
}
#define EXCEPTION_DEF(code, desc) {code, #code, desc}

const exception_slot EXCEPTION_DEFINITIONS[] = {
EXCEPTION_DEF(EXCEPTION_ACCESS_VIOLATION, "AccessViolation"),
Expand Down Expand Up @@ -83,10 +80,7 @@ struct signal_slot {
const char *description;
};

#define SIGNAL_DEF(sig, desc) \
{ \
sig, #sig, desc \
}
#define SIGNAL_DEF(sig, desc) {sig, #sig, desc}

const signal_slot SIGNAL_DEFINITIONS[] = {SIGNAL_DEF(SIGILL, "IllegalInstruction"),
SIGNAL_DEF(SIGTRAP, "Trap"),
Expand Down Expand Up @@ -199,18 +193,12 @@ CrashHandler::CrashHandler()
{
constexpr auto dsn =
"https://69c28eeaef4651abcf0bbeace6a1175c@o4508553519431680.ingest.de.sentry.io/4508569040519248";
#ifdef _WIN32
fs::path handler_path = (fs::path{detail::get_module_pathname()}.parent_path()) / "crashpad_handler.exe";
#else
fs::path handler_path = (fs::path{detail::get_module_pathname()}.parent_path()) / "crashpad_handler";
#endif
constexpr std::string_view release = "endstone@" ENDSTONE_VERSION;
constexpr bool is_dev = release.find("dev") != std::string_view::npos;

sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, dsn);
sentry_options_set_database_path(options, ".sentry-native");
sentry_options_set_handler_path(options, handler_path.string().c_str());
sentry_options_set_release(options, std::string(release).c_str());
sentry_options_set_on_crash(options, on_crash, nullptr);
sentry_options_set_environment(options, is_dev ? "development" : "production");
Expand Down
8 changes: 1 addition & 7 deletions src/endstone/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ project(endstone_python LANGUAGES CXX)
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
find_package(pybind11 REQUIRED)

add_library(endstone_python MODULE
pybind11_add_module(endstone_python MODULE
actor.cpp
ban.cpp
block.cpp
Expand All @@ -25,15 +25,9 @@ add_library(endstone_python MODULE
util.cpp
)
target_link_libraries(endstone_python PRIVATE endstone::endstone pybind11::module)
pybind11_extension(endstone_python)
set_target_properties(endstone_python PROPERTIES CXX_VISIBILITY_PRESET "hidden")
target_compile_definitions(endstone_python PUBLIC PYBIND11_DETAILED_ERROR_MESSAGES)
if (NOT DEFINED CMAKE_INTERPROCEDURAL_OPTIMIZATION)
target_link_libraries(endstone_python PRIVATE pybind11::lto)
endif ()

if (MSVC)
target_link_libraries(endstone_python PRIVATE pybind11::windows_extras)
target_link_options(endstone_python PRIVATE /DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF)
target_compile_options(endstone_python PRIVATE /O2 /DNDEBUG /Zi /Gy)
endif ()
Expand Down
Loading