Skip to content

cmake/xplatform builds using github/tox/conda workflows #187

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

sarnold
Copy link
Contributor

@sarnold sarnold commented Oct 10, 2022

  • add example workflows for CI and local development
  • enable cmake options for IPO, LLVM source coverage, really simple test
  • handles visibility a bit differently; see size of shared lib/executables with lto/ipo and namespace
  • builds on cmake PR Add 'pure' cmake build system #26 (includes commits and python update script)
  • demonstrates several toolchains/build methods across GH ci runners
  • includes some warning cleanup and edge-case build errors

Majority of changed files are new cmake files so it's fairly easy to see the actual source changes. I started this back when the cmake PR was fairly new, and then I got busy (so fresh rebase on current master).

From ubuntu-clang workflow:

-rwxr-xr-x 1 runner docker  16K Oct 10 19:23 ../staging/bin/abc
-rw-r--r-- 1 runner docker 5.0K Oct 10 19:15 ../staging/include/abc/abcapis.h
-rw-r--r-- 1 runner docker 3.4K Oct 10 19:15 ../staging/include/abc/abcapis_old.h
-rw-r--r-- 1 runner docker  826 Oct 10 19:16 ../staging/lib/cmake/abc/abcConfig-release.cmake
-rw-r--r-- 1 runner docker 4.8K Oct 10 19:16 ../staging/lib/cmake/abc/abcConfig.cmake
-rw-r--r-- 1 runner docker  13M Oct 10 19:23 ../staging/lib/libabc.so.1.1.0

set(make_env ${CMAKE_COMMAND} -E env SDKROOT=${CMAKE_OSX_SYSROOT})
endif()

# run make to extract compiler options, linker options and list of source files
Copy link
Contributor Author

@sarnold sarnold Oct 10, 2022

Choose a reason for hiding this comment

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

I'm not sure I understand the requirement driving this; can you elaborate a little bit here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, that ^^ question was in regards to cmake docs, where it says:

"... It is intended to be set locally by the user creating a build tree. "

https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_SYSROOT.html

@sarnold sarnold changed the title Github and tox workflows cmake/xplatform builds using github/tox/conda workflows Oct 19, 2022
@sarnold sarnold force-pushed the workflows branch 7 times, most recently from 91dae88 to 9a268ee Compare July 23, 2023 03:38
@sarnold
Copy link
Contributor Author

sarnold commented Jul 23, 2023

Fresh rebase-on-the-rebase with some cleanup and timespec fix.

@sarnold sarnold force-pushed the workflows branch 4 times, most recently from ba547b1 to d63c541 Compare July 23, 2023 19:27
@sarnold sarnold force-pushed the workflows branch 14 times, most recently from a029c8b to 2d82a9d Compare December 2, 2023 04:08
madebr and others added 29 commits April 1, 2025 14:31
The assert is disabled in release builds.
* define HAVE_STRUCT_TIMESPEC and _XKEYCHECK_H on msvc
* avoid LIBSTDCXX linking (msvc only), pass build config to all steps
* add optional lto support; note clang lto requires llvm-config and lld
* add llvm source-based coverage build, fix uninitialzed variable
* update cmake-posix workflow configure, bin path, emulate in tox
* add conda devenv file and workflow => use platform compilers and Ninja
* update build instructions in readme file, cleanup tox/ci files

Signed-off-by: Stephen L Arnold <nerdboy@gentoo.org>
* remove the linker optimization arg for gnu on macos
* remove GH workflow warning annotations, bump action versions

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* updates tox argument syntax on macos
* also restores missing OS list in conda-dev workflow

Signed-off-by: Stephen L Arnold <nerdboy@gentoo.org>
* win pthreads module tries to define timespec if HAVE_STRUCT_TIMESPEC
  is not defined except msys/mingw already defines it

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* use more specific if check for windows includes
* add missing win32 link library
* move extern Io_MvLoadFileBz2 to header, use hdr in cmd.c

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* msys/mingw has incomplete dirent so disable namespace
* refactor cmake config, update dirent pkg spec in conda env
* try cheap ENV hack to find dirent header in conda

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* update setup-miniconda config to get latest pkg versions
* add more workflow output, reset cache number
* list envs, revert to previous with some info output, back to v2

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* leave default PY_VER but do not specify version for action
* use proper activate command workflow in build step
* add some path and prefix introspection, try find/which
* bump windows ci runner version, list env, cat dirent.h
* do not use jinja compier templates, revert to py39/win2019 default

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* cleanup initial extern hacks and use ioAbc.h for missing symbol
* remove superfluous dirent dep on windows

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* apparently macos also needs gtest includes

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
…ctory

* update gia_test source with language property
* update conda-dev env file and matrix xcode version
* update workflows with push branches and less generic job names

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* fix adhoc test command arg file path, remove redundant test
* remove previous test path hacks, set xcode to Debug
* update conda build step and environment file, add core gtest deps

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* use includes from source dir when using VENDOR_GTEST
* be sure and link against both gtest libs with either option

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* follow modern guidelines summarized in [1]
* set default visibility and visibility-inlines to hidden when
  using C++ namespace
* MSVC is hidden by default, so set GNU, LLVM, and AppleClang the same way
* use abc header defines to apply visibility rules on non-win32 platforms
* remove parallel args from tox Makefile commands in favor of posargs
  eg, ``tox -e abc -- -j4``

[1] https://gist.github.com/ax3l/ba17f4bb1edb5885a6bd01f58de4d542

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
gia_test cmd fails with exit code and no useful traceback::

  FAILED: test/gia/gia_test.exe test/gia/gia_test[1]_tests.cmake D:/a/abc-fork/abc-fork/build/test/gia/gia_test[1]_tests.cmake
  C:\Windows\system32\cmd.exe /C "cd . && C:\mingw64\bin\c++.exe -g  test/gia/CMakeFiles/gia_test.dir/gia_test.cc.obj -o test\gia\gia_test.exe -Wl,--out-implib,test\gia\libgia_test.dll.a -Wl,--major-image-version,0,--minor-image-version,0  libabc.dll.a  lib/libgtest_main.dll.a  -lm  -lshlwapi  lib/libgtest.dll.a  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && C:\Windows\system32\cmd.exe /C "cd /D D:\a\abc-fork\abc-fork\build\test\gia && C:\Miniconda\envs\abc-test\Library\bin\cmake.exe -D TEST_TARGET=gia_test -D TEST_EXECUTABLE=D:/a/abc-fork/abc-fork/build/test/gia/gia_test.exe -D TEST_EXECUTOR= -D TEST_WORKING_DIR=D:/a/abc-fork/abc-fork/build/test/gia -D TEST_EXTRA_ARGS= -D TEST_PROPERTIES= -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=gia_test_TESTS -D CTEST_FILE=D:/a/abc-fork/abc-fork/build/test/gia/gia_test[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_DISCOVERY_EXTRA_ARGS= -D TEST_XML_OUTPUT_DIR= -P C:/Miniconda/envs/abc-test/Library/share/cmake-3.31/Modules/GoogleTestAddTests.cmake""
  CMake Error at C:/Miniconda/envs/abc-test/Library/share/cmake-3.31/Modules/GoogleTestAddTests.cmake:132 (message):
    Error running test executable.

      Path: 'D:/a/abc-fork/abc-fork/build/test/gia/gia_test.exe'
      Working directory: 'D:/a/abc-fork/abc-fork/build/test/gia'
      Result: Exit code 0xc0000135

      Output:

  Call Stack (most recent call first):
    C:/Miniconda/envs/abc-test/Library/share/cmake-3.31/Modules/GoogleTestAddTests.cmake:275 (gtest_discover_tests_impl)

  ninja: build stopped: subcommand failed.
* generate and add CMake for latest upstream module bits
* cleanup platform includes

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* give find_package a hint for finding the correct versioned LLVM dir
* use LLVM_VER_DIR to set major llvm version path (mainly for CI)
* set default in tox (github workflows get /usr/lib/ prepended)

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* disable pthreads when using msvc compiler
* fix build errors on windows, including the following:
  missing symbols, non-const, designated initializers, and
  non-standard explicit type conversions
* uncork sys/stat.h and add missing win32 define for S_ISDIR
* add clang++ flag to get errors on c++20 initializers and set C99 std

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
* correct the cadical usage of __USE_MINGW_ANSI_STDIO
* cleanup more win32/mingw32 defines in cadical
* add tox cmd descriptions, run tox list to see them

Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
Signed-off-by: Stephen L Arnold <sarnold@vctlabs.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants