Skip to content

Commit

Permalink
Remove src/bext submodule in favor of an explicitly stored SHA1
Browse files Browse the repository at this point in the history
Also, no longer deleting the cloned srcs and bext build from the BRL-CAD build
dir unless an option enabling that is explicitly set.  We still need it for CI,
since space is at a premium there and we need to clear the build outputs, but
otherwise removing these makes it more difficult to debug any problems.
  • Loading branch information
starseeker committed Feb 24, 2025
1 parent 44b46d1 commit 13eeb92
Show file tree
Hide file tree
Showing 13 changed files with 160 additions and 254 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cmake -S . -B build_lcov -DBRLCAD_ENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DBRLCAD_EXT_PARALLEL=1 -DBRLCAD_ENABLE_QT=ON
cmake -S . -B build_lcov -DBRLCAD_ENABLE_COVERAGE=ON -DCMAKE_BUILD_TYPE=Debug -DBRLCAD_EXT_PARALLEL=1 -DBRLCAD_ENABLE_QT=ON -DBRLCAD_BEXT_CLEANUP=ON
- name: Build
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -S . -B build_winstd -DBRLCAD_EXT_PARALLEL=1 -DBRLCAD_BUNDLED_LIBS=Bundled -DBRLCAD_ENABLE_QT=ON -DCMAKE_BUILD_TYPE=Release
cmake -S . -B build_winstd -DBRLCAD_EXT_PARALLEL=1 -DBRLCAD_BUNDLED_LIBS=Bundled -DBRLCAD_ENABLE_QT=ON -DCMAKE_BUILD_TYPE=Release -DBRLCAD_BEXT_CLEANUP=ON
- name: Build
shell: cmd
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
- name: Configure
run: |
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cmake -S . -G Ninja -B build_linux -DCMAKE_BUILD_TYPE=Release -DBRLCAD_EXT_PARALLEL=1 -DBRLCAD_ENABLE_QT=ON
cmake -S . -G Ninja -B build_linux -DCMAKE_BUILD_TYPE=Release -DBRLCAD_EXT_PARALLEL=1 -DBRLCAD_ENABLE_QT=ON -DBRLCAD_BEXT_CLEANUP=ON
- name: Build
run: |
Expand Down Expand Up @@ -297,6 +297,6 @@ jobs:
run: |
cmake -E make_directory ./build_archives
export PATH=$ENV{GITHUB_WORKSPACE}:$PATH
cmake -S . -B build_archives -DCMAKE_BUILD_TYPE=Release -DBRLCAD_EXT_PARALLEL=1 -DCPACK_INCLUDE_EXT=OFF
cmake -S . -B build_archives -DCMAKE_BUILD_TYPE=Release -DBRLCAD_EXT_PARALLEL=1 -DBRLCAD_BEXT_CLEANUP=ON
cmake --build build_archives --config Release --target distcheck-source_archives
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
[submodule "src/bext"]
path = src/bext
url = https://github.com/BRL-CAD/bext.git
branch = main
95 changes: 10 additions & 85 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,90 +206,16 @@ include(BRLCAD_Environment_Setup)
# an incorrect include directory for Eigen based on bext build info.
set(CMAKE_FIND_USE_PACKAGE_REGISTRY FALSE)

# Populate these early, even though their main use is in
# misc/CMake/BRLCAD_ExternalDeps.cmake - find_program and find_package calls
# may also make use of them, particularly BRLCAD_EXT_NOINSTALL_DIR
set(BRLCAD_EXT_DIR_ENV "$ENV{BRLCAD_EXT_DIR}")
if(BRLCAD_EXT_DIR_ENV AND NOT DEFINED BRLCAD_EXT_DIR)
set(BRLCAD_EXT_DIR ${BRLCAD_EXT_DIR_ENV})
endif(BRLCAD_EXT_DIR_ENV AND NOT DEFINED BRLCAD_EXT_DIR)

if(DEFINED BRLCAD_EXT_DIR)
# Make sure we cache the BRLCAD_EXT_DIR setting - if we don't, then a re-configure
# with CMake is going to ignore a previously specified directory
set(BRLCAD_EXT_DIR "${BRLCAD_EXT_DIR}" CACHE PATH "BRL-CAD external dependency sources")

if(NOT DEFINED BRLCAD_EXT_INSTALL_DIR AND EXISTS "${BRLCAD_EXT_DIR}/install")
set(BRLCAD_EXT_INSTALL_DIR "${BRLCAD_EXT_DIR}/install")
endif(NOT DEFINED BRLCAD_EXT_INSTALL_DIR AND EXISTS "${BRLCAD_EXT_DIR}/install")
# Need to handle the case where BRLCAD_EXT_DIR is a symlink - if it
# is, we need to expand the symlink in order for the tar tricks we use
# later for file copying to work...
if(DEFINED BRLCAD_EXT_INSTALL_DIR AND IS_SYMLINK ${BRLCAD_EXT_INSTALL_DIR})
file(REAL_PATH "${BRLCAD_EXT_INSTALL_DIR}" EXT_PATH)
set(BRLCAD_EXT_INSTALL_DIR "${EXT_PATH}")
endif(DEFINED BRLCAD_EXT_INSTALL_DIR AND IS_SYMLINK ${BRLCAD_EXT_INSTALL_DIR})

# For noinstall we don't need to worry about symlinks since we'll be using
# the contents in place.
if(NOT DEFINED BRLCAD_EXT_NOINSTALL_DIR AND EXISTS "${BRLCAD_EXT_DIR}/noinstall")
set(BRLCAD_EXT_NOINSTALL_DIR "${BRLCAD_EXT_DIR}/noinstall")
endif(NOT DEFINED BRLCAD_EXT_NOINSTALL_DIR AND EXISTS "${BRLCAD_EXT_DIR}/noinstall")
endif(DEFINED BRLCAD_EXT_DIR)

# If we're doing the non-src-other build, we've got to have bext for at least a
# few custom components no matter how many system packages are installed.
if(NOT DEFINED BRLCAD_EXT_NOINSTALL_DIR OR NOT DEFINED BRLCAD_EXT_INSTALL_DIR)
message(
WARNING
"External dependencies will be downloaded, configured, and built automatically as-needed. Set BRLCAD_EXT_DIR to specify instead."
)
message(
STATUS
"BRLCAD_EXT_DIR specifies prebuilt external dependencies directory\n"
"containing 'install' and 'noinstall' folders, outputs from installing\n"
"https://github.com/BRL-CAD/bext.\n"
)
endif(NOT DEFINED BRLCAD_EXT_NOINSTALL_DIR OR NOT DEFINED BRLCAD_EXT_INSTALL_DIR)

# By default, we don't bundle bext into the source tarball for performance
# reasons, but the support is there if the dev wants to pay the price in time
# and disk space.
if(NOT DEFINED CPACK_INCLUDE_EXT)
set(CPACK_INCLUDE_EXT OFF)
endif(NOT DEFINED CPACK_INCLUDE_EXT)

# Before we do a lot of configure work, check whether we've got a type mismatch
# between bext and the BRL-CAD build type. If not, on Windows at least, it's a
# fatal error.
#---------------------------------------------------------------------
# Prepare External dependencies (bext) repository management
include(BRLCAD_ExternalDeps)

# Sets the bext SHA1 hash. There are also some steps in this process that need
# to happen early to allow find_package and find_program to work as expected.
#
# NOTE: This test must come AFTER the inclusion of BRLCAD_Build_Types
if(CMAKE_BUILD_TYPE AND EXISTS "${BRLCAD_EXT_NOINSTALL_DIR}")
find_program(DUMPBIN_EXEC dumpbin)
set(TEST_BINFILE ${BRLCAD_EXT_NOINSTALL_DIR}/bin/strclear.exe)
if(DUMPBIN_EXEC AND EXISTS ${TEST_BINFILE})
# dumpbin doesn't like CMake style paths
file(TO_NATIVE_PATH "${TEST_BINFILE}" TBFN)
# https://stackoverflow.com/a/28304716/2037687
execute_process(COMMAND ${DUMPBIN_EXEC} /dependents ${TBFN} OUTPUT_VARIABLE DB_OUT ERROR_VARIABLE DB_OUT)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
if("${DB_OUT}" MATCHES ".*MSVCP[0-9]*d.dll.*" OR "${DB_OUT}" MATCHES ".*MSVCP[0-9]*D.dll.*")
message(
FATAL_ERROR
"Release build specified, but supplied bext binaries in ${BRLCAD_EXT_DIR} are compiled as Debug binaries."
)
endif("${DB_OUT}" MATCHES ".*MSVCP[0-9]*d.dll.*" OR "${DB_OUT}" MATCHES ".*MSVCP[0-9]*D.dll.*")
endif("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
if(NOT "${DB_OUT}" MATCHES ".*MSVCP[0-9]*d.dll.*" AND NOT "${DB_OUT}" MATCHES ".*MSVCP[0-9]*D.dll.*")
message(
FATAL_ERROR
"Debug build specified, but supplied bext binaries in ${BRLCAD_EXT_DIR} are compiled as Release binaries."
)
endif(NOT "${DB_OUT}" MATCHES ".*MSVCP[0-9]*d.dll.*" AND NOT "${DB_OUT}" MATCHES ".*MSVCP[0-9]*D.dll.*")
endif("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
endif(DUMPBIN_EXEC AND EXISTS ${TEST_BINFILE})
endif(CMAKE_BUILD_TYPE AND EXISTS "${BRLCAD_EXT_NOINSTALL_DIR}")
# If a pre-existing bext install directory is specified, we also check the
# types on platforms where bext and the main BRL-CAD's build type must align.
brlcad_bext_init()

#---------------------------------------------------------------------
# Define various utilities.
Expand Down Expand Up @@ -2167,8 +2093,7 @@ add_subdirectory(misc/tools)
include(${CMAKE_SOURCE_DIR}/src/source_dirs.cmake)

# Now we have the necessary info - trigger the primary management logic
include(BRLCAD_ExternalDeps)
brlcad_process_ext()
brlcad_bext_process()

# Define some Tcl related variables for libtclcad
if(BRLCAD_ITCL_BUILD)
Expand Down
12 changes: 3 additions & 9 deletions HACKING
Original file line number Diff line number Diff line change
Expand Up @@ -1380,17 +1380,11 @@ Release steps are as follows:

#####################################################################
# 08: Update the bext submodule in BRL-CAD's main repository.
(TODO - this can probably be scripted...)

rm -rf src/bext && git checkout -- src/bext
git submodule update --init
git submodule update --remote
git add src/bext
cd src/bext
BSHA1=$(git log -1 --pretty=format:"%h")
cd ../..
git commit -m "Update bext submodule to SHA1 $BSHA1"
# NON-AUTO: Update BEXT_SHA1 hash in misc/CMake/BRLCAD_EXT_Setup.cmake
git commit -m "Update bext submodule to SHA1 <hashval>"
git push
rm -rf src/bext && git checkout -- src/bext

#####################################################################
# 09: Update ChangeLog. Use the YYYY-MM-DD of previous NEWS entry.
Expand Down
13 changes: 0 additions & 13 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,6 @@ THESE TASKS SHOULD HAPPEN WITHIN TWO RELEASE ITERATIONS
THESE ARE UNSCHEDULED BACKLOG TASKS
-----------------------------------

* replace src/bext submodule with a SHA1 stored in the top level
CMakeLists.txt file. Having the submodule active is proving
a bit problematic. While it does allow for a recursive clone,
working with it has been challenging. The most critical feature
it provides is allowing git bisect to work, and we can achieve
that with a SHA1 stored in the top level. Will need to update
the cloning logic accordingly.

* adjust build logic to not delete the in-build-dir checkout and
build directories by default. Makes it too hard to debug when
something goes wrong. Update the CI system logic to explicitly
remove the outputs (where we need to for space reasons).

* calculate maximum/minimum presented area az/el for a given model

* optimize mged/libged init and exit performance. profiling shows
Expand Down
Loading

0 comments on commit 13eeb92

Please sign in to comment.