Skip to content
Closed
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
1 change: 1 addition & 0 deletions cpp/src/arrow/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const BuildInfo kBuildInfo = {
ARROW_GIT_ID,
ARROW_GIT_DESCRIPTION,
ARROW_PACKAGE_KIND,
ARROW_BUILD_TYPE,
// clang-format on
};

Expand Down
8 changes: 8 additions & 0 deletions cpp/src/arrow/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,20 @@ struct BuildInfo {
std::string version_string;
std::string so_version;
std::string full_so_version;

/// The CMake compiler identifier, e.g. "GNU"
std::string compiler_id;
std::string compiler_version;
std::string compiler_flags;

/// The git changeset id, if available
std::string git_id;
/// The git changeset description, if available
std::string git_description;
std::string package_kind;

/// The uppercase build type, e.g. "DEBUG" or "RELEASE"
std::string build_type;
};

struct RuntimeInfo {
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/arrow/util/config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#define ARROW_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@"
#define ARROW_CXX_COMPILER_FLAGS "@CMAKE_CXX_FLAGS@"

#define ARROW_BUILD_TYPE "@UPPERCASE_BUILD_TYPE@"

#define ARROW_GIT_ID "@ARROW_GIT_ID@"
#define ARROW_GIT_DESCRIPTION "@ARROW_GIT_DESCRIPTION@"

Expand Down
3 changes: 3 additions & 0 deletions dev/release/verify-release-candidate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,8 @@ test_csharp() {
test_python() {
pushd python

export PYARROW_PARALLEL=$NPROC

export PYARROW_WITH_DATASET=1
export PYARROW_WITH_PARQUET=1
export PYARROW_WITH_PLASMA=1
Expand Down Expand Up @@ -567,6 +569,7 @@ ensure_source_directory() {
export ARROW_DIR=$PWD
export ARROW_TEST_DATA=$PWD/testing/data
export PARQUET_TEST_DATA=$PWD/cpp/submodules/parquet-testing/data
export ARROW_GDB_SCRIPT=$PWD/cpp/gdb_arrow.py
popd
}

Expand Down
1 change: 0 additions & 1 deletion dev/tasks/python-wheels/github.osx.arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ env:
CXX: "clang++"
MACOSX_DEPLOYMENT_TARGET: "{{ macos_deployment_target }}"
PYARROW_BUILD_VERBOSE: 1
PYARROW_TEST_GDB: "OFF"
PYARROW_VERSION: "{{ arrow.no_rc_version }}"
PYTHON_VERSION: "{{ python_version }}"
PYTHON: "/Library/Frameworks/Python.framework/Versions/{{ python_version }}/bin/python{{ python_version }}"
Expand Down
1 change: 1 addition & 0 deletions python/pyarrow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def print_entry(label, value):
print_entry("Arrow C++ compiler flags", cpp_build_info.compiler_flags)
print_entry("Arrow C++ git revision", cpp_build_info.git_id)
print_entry("Arrow C++ git description", cpp_build_info.git_description)
print_entry("Arrow C++ build type", cpp_build_info.build_type)


def _module_is_available(module):
Expand Down
6 changes: 4 additions & 2 deletions python/pyarrow/config.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BuildInfo = namedtuple(
'BuildInfo',
('version', 'version_info', 'so_version', 'full_so_version',
'compiler_id', 'compiler_version', 'compiler_flags',
'git_id', 'git_description', 'package_kind'))
'git_id', 'git_description', 'package_kind', 'build_type'))

RuntimeInfo = namedtuple('RuntimeInfo',
('simd_level', 'detected_simd_level'))
Expand All @@ -48,7 +48,9 @@ cdef _build_info():
compiler_flags=frombytes(c_info.compiler_flags),
git_id=frombytes(c_info.git_id),
git_description=frombytes(c_info.git_description),
package_kind=frombytes(c_info.package_kind))
package_kind=frombytes(c_info.package_kind),
build_type=frombytes(c_info.build_type).lower(),
)


cpp_build_info = _build_info()
Expand Down
1 change: 1 addition & 0 deletions python/pyarrow/includes/libarrow.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ cdef extern from "arrow/config.h" namespace "arrow" nogil:
c_string git_id
c_string git_description
c_string package_kind
c_string build_type

const CBuildInfo& GetBuildInfo()

Expand Down
18 changes: 17 additions & 1 deletion python/pyarrow/tests/test_gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

import pytest

import pyarrow as pa


pytestmark = pytest.mark.gdb

Expand All @@ -40,8 +42,11 @@
@lru_cache()
def is_gdb_available():
try:
# Try to use the same arguments as in GdbSession so that the
# same error return gets propagated.
proc = subprocess.run(gdb_command + ["--version"],
stdin=subprocess.DEVNULL,
env={}, bufsize=0,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
except FileNotFoundError:
Expand Down Expand Up @@ -176,8 +181,19 @@ def gdb():

@pytest.fixture(scope='session')
def gdb_arrow(gdb):
if 'deb' not in pa.cpp_build_info.build_type:
pytest.skip("Arrow C++ debug symbols not available")

skip_if_gdb_script_unavailable()
gdb.run_command(f"source {gdb_script}")

lib_path_var = 'PATH' if sys.platform == 'win32' else 'LD_LIBRARY_PATH'
lib_path = os.environ.get(lib_path_var)
if lib_path:
# GDB starts the inferior process in a pristine shell, need
# to propagate the library search path to find the Arrow DLL
gdb.run_command(f"set env {lib_path_var} {lib_path}")

code = "from pyarrow.lib import _gdb_test_session; _gdb_test_session()"
out = gdb.run_command(f"run -c '{code}'")
assert ("Trace/breakpoint trap" in out or
Expand Down
3 changes: 3 additions & 0 deletions python/pyarrow/tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def test_build_info():
assert isinstance(pa.__version__, str)
assert pa.cpp_build_info.version_info == pa.cpp_version_info

assert pa.cpp_build_info.build_type in (
'debug', 'release', 'minsizerel', 'relwithdebinfo')

# assert pa.version == pa.__version__ # XXX currently false


Expand Down