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

[bde] Updated to 3.117.0 #31644

Closed
wants to merge 7 commits into from
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
128 changes: 37 additions & 91 deletions ports/bde/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,133 +1,79 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
set(CONFIGURE_COMMON_ARGS ${CONFIGURE_COMMON_ARGS} --library-type=static)

set(BDE_VERSION 3.2.0.0)
set(BDE_TOOLS_VERSION 1.x)
set(BDE_VERSION 3.117.0.0)
set(BDE_TOOLS_VERSION 3.117.0.0)

# Paths used in build
set(SOURCE_PATH_DEBUG ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/bde-${BDE_VERSION})
set(SOURCE_PATH_RELEASE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bde-${BDE_VERSION})

# Acquire Python 2 and add it to PATH
vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON2_EXE_PATH ${PYTHON2} DIRECTORY)
# Acquire Python and add it to PATH
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_EXE_PATH ${PYTHON3} DIRECTORY)

# Acquire BDE Tools and add them to PATH
vcpkg_from_github(
OUT_SOURCE_PATH TOOLS_PATH
REPO "bloomberg/bde-tools"
REF d4b1a7670829228f4ec81ecdccc598ce03ae8e80
SHA512 80af734c080adb225d5369157301ae0af18e02b1912351e34d23f5f2ba4e19f9ae2b5a367923f036330c9f9afd11a90cdf12680eb3e59b4297a312a1b713f17f
HEAD_REF master
REF 3.117.0.0
SHA512 3c39da8d1ea40459e36e11ada93cc2821ae1b16a831f93cccab463996394a400cc08bb1654642eae1aa5187f139d7fb80c4729e464051eee182133eb8a74158d
HEAD_REF 3.117.0.0
)

message(STATUS "Configure bde-tools-v${BDE_TOOLS_VERSION}")
if(VCPKG_CMAKE_SYSTEM_NAME)
set(ENV{PATH} "$ENV{PATH}:${PYTHON2_EXE_PATH}")
set(ENV{PATH} "$ENV{PATH}:${PYTHON3_EXE_PATH}")
set(ENV{PATH} "$ENV{PATH}:${TOOLS_PATH}/bin")
else()
set(ENV{PATH} "$ENV{PATH};${PYTHON2_EXE_PATH}")
set(ENV{PATH} "$ENV{PATH};${PYTHON3_EXE_PATH}")
set(ENV{PATH} "$ENV{PATH};${TOOLS_PATH}/bin")
endif()

# Acquire BDE sources
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO "bloomberg/bde"
REF 3720d132d0879f19b9084cca62ebc75f1f24e1a3
SHA512 234ebb71997f5b7d3951584235ead10f977689cef323ae1c198629a6b1995b1481d8a1515d827c46df10209bdc66e1f3cc7780dafee9ca0ff4172be47c460d78
HEAD_REF master
REF 3.117.0.0
SHA512 810b4a06a08739dcd990751dd543aa7dc58355f9d64a7c96ef0cf45c81501946434db42ad5bcf5d16110d5a463586b587ce09a446136e824298f39a8a871b490
HEAD_REF 3.117.0.0
)

# Clean up previous builds
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)

# Identify waf executable and calculate configure args
if(VCPKG_CMAKE_SYSTEM_NAME)
set(WAF_COMMAND waf)
else()
set(WAF_COMMAND waf.bat)
endif()
set(CONFIGURE_COMMON_ARGS ${CONFIGURE_COMMON_ARGS} --use-flat-include-dir)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(CONFIGURE_COMMON_ARGS ${CONFIGURE_COMMON_ARGS} --abi-bits=32)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(CONFIGURE_COMMON_ARGS ${CONFIGURE_COMMON_ARGS} --abi-bits=64)
else()
message(FATAL_ERROR "Unsupported target architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
if(VCPKG_TARGET_IS_WINDOWS)
set(CONFIGURE_COMMON_ARGS ${CONFIGURE_COMMON_ARGS} --msvc-runtime-type=static)
else()
set(ENV{CFLAGS} "$ENV{CFLAGS} -Wno-error=implicit-function-declaration")
endif()

# Configure debug
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND ${WAF_COMMAND} configure ${CONFIGURE_COMMON_ARGS}
--prefix=${CURRENT_PACKAGES_DIR}/debug --out=${SOURCE_PATH_DEBUG}
--build-type=debug
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME configure-${TARGET_TRIPLET}--dbg
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
cxx17 BDE_USE_CXX17
)
message(STATUS "Configuring ${TARGET_TRIPLET}-dbg done")

# Build debug
message(STATUS "Building ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND ${WAF_COMMAND} build
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME build-${TARGET_TRIPLET}--dbg
)
message(STATUS "Building ${TARGET_TRIPLET}-dbg done")

# Install debug
message(STATUS "Installing ${TARGET_TRIPLET}-dbg")
vcpkg_execute_required_process(
COMMAND ${WAF_COMMAND} install
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME install-${TARGET_TRIPLET}--dbg
)
# Include files should not be duplicated
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# pkg-config files should point to correct include directory
file(GLOB PC_FILES "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/*.pc")
foreach(PC_FILE_NAME ${PC_FILES})
file(READ "${PC_FILE_NAME}" _contents)
string(REPLACE "includedir=\${prefix}/include" "includedir=\${prefix}/../include" _contents "${_contents}")
file(WRITE "${PC_FILE_NAME}" "${_contents}")
endforeach()
message(STATUS "Installing ${TARGET_TRIPLET}-dbg done")
if (BDE_USE_CXX17)
set(BDE_OPTIONS "-DBDE_BUILD_TARGET_CPP17=ON" "-DCMAKE_CXX_STANDARD=17" "-DCMAKE_CXX_STANDARD_REQUIRED=ON" "-DCMAKE_CXX_EXTENSIONS=OFF")
endif ()

# Configure release
message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${WAF_COMMAND} configure ${CONFIGURE_COMMON_ARGS}
--prefix=${CURRENT_PACKAGES_DIR} --out=${SOURCE_PATH_RELEASE}
--build-type=release
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME configure-${TARGET_TRIPLET}--rel
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
list(APPEND BDE_OPTIONS "-DBDE_BUILD_TARGET_OPT=1")
else()
list(APPEND BDE_OPTIONS "-DBDE_BUILD_TARGET_DBG=1")
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
WINDOWS_USE_MSBUILD
OPTIONS
${BDE_OPTIONS}
-DBBS_BUILD_SYSTEM=1
-DBdeBuildSystem_DIR:PATH=${TOOLS_PATH}/BdeBuildSystem
)
message(STATUS "Configuring ${TARGET_TRIPLET}-rel done")

# Build release
message(STATUS "Building ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${WAF_COMMAND} build
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME build-${TARGET_TRIPLET}--rel
)
message(STATUS "Building ${TARGET_TRIPLET}-rel done")
vcpkg_cmake_build()

# Install release
message(STATUS "Installing ${TARGET_TRIPLET}-rel")
vcpkg_execute_required_process(
COMMAND ${WAF_COMMAND} install
WORKING_DIRECTORY ${SOURCE_PATH}
LOGNAME install-${TARGET_TRIPLET}--rel
)
message(STATUS "Installing ${TARGET_TRIPLET}-rel done")
vcpkg_cmake_install()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE
Expand Down
20 changes: 17 additions & 3 deletions ports/bde/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
{
"name": "bde",
"version": "3.2.0.0",
"port-version": 5,
"version": "3.117.0.0",
"description": "Basic Development Environment - a set of foundational C++ libraries used at Bloomberg.",
"supports": "!windows & !arm"
"supports": "!windows & !arm & !android",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"cxx17": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an 'alternative'; is it possible for downstream customers to be agnostic about this setting?

See https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#do-not-use-features-to-implement-alternatives

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good question. I think the idea was to follow the abseil pattern here (maybe they're following something else which came before it).

There's definite trickiness around this setting and consuming the library - the header files of this library generally need to be built with a c++ standard identical to the static library linked against. I'm not sure what alternatives exist here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good question. I think the idea was to follow the abseil pattern here (maybe they're following something else which came before it).

Abseil does not follow such a pattern though, because they namespace all their polyfills. That is, customer code can be written always naming absl::stuff and it will work regardless of this setting.

There's definite trickiness around this setting and consuming the library - the header files of this library generally need to be built with a c++ standard identical to the static library linked against. I'm not sure what alternatives exist here

That's also something abseil doesn't do; there is a feature there but it bakes the 'polyfills or not' setting directly into the bits so that downstream C++ version need not agree.

In general we do not expect a given program to only ever be built with a consistent C++ version.

I think the correct think to do here is thus to turn on the setting and say "vcpkg's bde says you are using c++17+; if you want something else you must use overlays".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation - and time taken so far to consider this PR! 🙂. I might be misunderstanding your description since I haven't used abseil, but I think bde is in a similar situation wrt to polyfills - everything is namespaced.

In general we do not expect a given program to only ever be built with a consistent C++ version.
Makes sense, although as I'm sure you've realised - bde does expect that ~all usages of it's header files are linked against a version of the library which has been built with the same C++ standard version.

I think your suggestion is workable but could make it difficult to change the standard in future. I'll need to discuss internally to figure out what's feasible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the exception we carved out specifically for what abseil was doing:

https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#a-feature-may-replace-polyfills-with-aliases-provided-that-replacement-is-baked-into-the-installed-tree

In particular, the requirement to bake the feature answer into the resulting installed tree. bde[core] needs to use the polyfills even if downstream someone uses a C++17 compiler.

Unfortunately the C++ ecosystem writ large does not choose a consistent language version at any given time, so we require things indexed in our curated registry to deal with that situation.

"description": "Enable compiler C++17."
}
}
}
3 changes: 0 additions & 3 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ azure-identity-cpp:x64-android=fail
backward-cpp:arm-neon-android=fail
backward-cpp:arm64-android=fail
backward-cpp:x64-android=fail
bde:x64-android=fail
# broken when `python` is python3, https://github.com/microsoft/vcpkg/issues/18937
bde:x64-linux=fail
bento4:arm-neon-android=fail
berkeleydb:arm-neon-android=fail
berkeleydb:arm64-android=fail
Expand Down
5 changes: 5 additions & 0 deletions versions/b-/bde.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "4e2c03aa72390fcf5365824064f5276c855a3787",
"version": "3.117.0.0",
"port-version": 0
},
{
"git-tree": "7ce72f2854f44eee806e6e5f3e97d29897549787",
"version": "3.2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,8 @@
"port-version": 0
},
"bde": {
"baseline": "3.2.0.0",
"port-version": 5
"baseline": "3.117.0.0",
"port-version": 0
},
"bdwgc": {
"baseline": "8.2.2",
Expand Down