Code Monkey home page Code Monkey logo

externpro's Introduction

externpro

externpro is a collection of scripts, docker-related files, and cmake that provide foundational support for any project wishing to leverage public buildpro images and third-party development packages built using externpro

Table of Contents

using externpro

optimally externpro is added to any project as a submodule to the path .devcontainer

git submodule add https://github.com/externpro/externpro .devcontainer

symbolic links can be added to point to the compose.*.[sh|yml] file pair suitable for the project

ln -s .devcontainer/compose.bld.sh docker-compose.sh
ln -s .devcontainer/compose.bld.yml docker-compose.yml

./docker-compose.sh -h displays a help message showing usage and options

foundations

externpro makes heavy use of cmake's ExternalProject module -- see Building External Projects with CMake 2.8 for a good overview of the module when it was first introduced

legacy externpro

there is a legacy externpro project at smanders/externpro that creates a bundled package of several third-party projects in tar.xz releases -- smanders/externpro will eventually be phased out and archived as work is done to move these projects to build standalone and host their devel packages as github release assets

notes

networks

  • compose.vantage.yml creates a user-defined bridge network with suffix bpnet
    $ docker network ls
    NETWORK ID     NAME             DRIVER    SCOPE
    643087dbdb12   bridge           bridge    local
    3827d410c2f9   buildpro_bpnet   bridge    local
    49e8e437e86b   host             host      local
    9c91da65ca0b   none             null      local
    
  • from https://docs.docker.com/network/

    User-defined bridge networks are best when you need multiple containers to communicate on the same Docker host

  • other benefits and differences bewteen user-defined bridges and the default bridge are detailed in the docker docs https://docs.docker.com/network/bridge/
    • user-defined bridges provide automatic DNS resolution between containers
    • user-defined bridges provide better isolation
    • containers can be attached and detached from user-defined networks on the fly
    • each user-defined network creates a configurable bridge

X11 forwarding

  • if you're running ./docker-compose.sh on a remote system you've connected to via ssh -X or ssh -Y the denv.sh script should automatically detect this case and will do additional configuration and populate environment variables so that X display from the running container will (hopefully) work as expected
  • NOTE: the -bld images include the xeyes package, which can be run ($ xeyes &) from the container to verify X11 forwarding is working as expected
  • TIP: if you get a "can't open display" error trying to run X applications, you may need to change the X11UseLocalhost option in /etc/ssh/sshd_config to no (and restart sshd)

network performance tuning

  • with /etc/sysctl.conf you can configure various linux kernel networking settings
  • some of these settings are required to be modified for Autotest (in the runtime container) to succeed
  • some --sysctl settings can be applied to a container, but I found that none of the required changes could be done this way (or at least in my attempts with Docker version 18.09.7) https://docs.docker.com/engine/reference/commandline/run/#configure-namespaced-kernel-parameters-sysctls-at-runtime
  • these settings need to be applied to the host, then the docker container (which shares the host kernel) will have the required settings
  • https://unix.stackexchange.com/questions/404387/how-to-sysctl-net-related-config-in-docker-container/455193
  • the /etc/sysctl.d/README explains the directory's relation to /etc/sysctl.conf and mentions

    After making any changes, please run "service procps start"

    • I believe they meant restart instead of start
  • the script check-bpnet-perform.sh will help to check the values before applying the changes in 90-bpnet-perform.conf -- in case you'd like to ever go back to the original, default values
    $ ./check-bpnet-perform.sh
    net.core.rmem_max = 212992
    net.core.wmem_max = 212992
    net.core.rmem_default = 212992
    net.core.wmem_default = 212992
    net.ipv4.tcp_rmem = 4096	87380	6291456
    net.ipv4.tcp_wmem = 4096	16384	4194304
    net.ipv4.tcp_mem = 383520	511360	767040
    net.ipv4.udp_rmem_min = 4096
    net.ipv4.udp_wmem_min = 4096
    net.ipv4.udp_mem = 767040	1022720	1534080
    
    $ sudo cp 90-bpnet-perform.conf /etc/sysctl.d/
    $ sudo service procps restart
    
    $ ./check-bpnet-perform.sh
    net.core.rmem_max = 8388608
    net.core.wmem_max = 8388608
    net.core.rmem_default = 8388608
    net.core.wmem_default = 8388608
    net.ipv4.tcp_rmem = 94096	987380	8388608
    net.ipv4.tcp_wmem = 94096	987380	8388608
    net.ipv4.tcp_mem = 8388608	8388608	8388608
    net.ipv4.udp_rmem_min = 8388608
    net.ipv4.udp_wmem_min = 8388608
    net.ipv4.udp_mem = 8388608	8388608	8388608
    
  • the bash function runreq in funcs.sh attempts to automate this

database

externpro's People

Contributors

smanders avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

grahamaj camerbam

externpro's Issues

exclude /usr/lib/.build-id from RPM

with the move to Rocky 8 from CentOS 7, it appears rpm-build now embeds debug info in /usr/lib/.build-id/

Links with info (credit @grahamaj for digging into this one!)

testers were reporting conflicts with files from different microservice packages
https://isrhub.usurf.usu.edu/Vantage/UserService/discussions/176#discussioncomment-1140

cmake update fallout

with the buildpro update to cmake 3.28.3 externpro/buildpro#63 there are issues that need to be addressed in cmake of this repo and smanders/externpro that helps build externpro projects

xpSourceListAppend: remove obsolete options

remove format custom target (make format)

  • CRTool clfmt . -f is the preferred way now of running clang-format across the entire repo
  • target wasn't available on Windows because it can't handle passing very many files to clang-format
  • projects should no longer have reason to find the clang-format executable

remove XP_CSCOPE cmake option (to always update cscope database)

  • it doesn't handle files that have spaces in them (they've been introduced in a few web-related repos)

remove "create offline container bundle" support

./docker-compose.sh -c option https://github.com/externpro/externpro/blob/24.05/compose.gpu.sh#L10

creates an offline container bundle (in .devcontainer/_bld aka offlineDir https://github.com/externpro/externpro/blob/24.05/denv.sh#L146) with the docker image (docker.${rel}.tar.bz2) and crtool, crtoolimpl, and webpro packages

with the offline container bundle in place (.devcontainer/_bld) in the secure room, the denv.sh script detects whether the "secure" isrhub (secure=isrhub.vip.local) is a valid host and uses the offline container bundle to build the docker image

now that things have progressed, the secure room isrhub should host the docker image and other packages (crtool, webpro, etc) and urls that access these artifacts (isrhub, ghcr.io, and all the devel packages in pros.cmake) should be routed to get them from isrhub directly and there is no longer a need to create an offline container bundle!

docker compose 'version' is obsolete

running the docker-compose.sh script, a new warning

WARN[0000] /home/smanders/src/pros/buildpro/docker-compose.yml: `version` is obsolete

this is after updating to docker compose version v2.25.0

smanders@C00873:~/src/pros/buildpro$ docker compose version
Docker Compose version v2.25.0

but apparently, according to the docker/compose issue docker/compose#11628 this isn't a bug, version is only informative and appears that it can be removed, most especially now that docker compose V2 is in full use in all of our projects (and V1 support has been dropped)

another issue with additional discussion jasonacox/Powerwall-Dashboard#453

unexpected package target

an include(CPack) will create a package target, even if there are no install() commands and no install target

CI attempts to create (and eventually upload) a package if the target exists

as part of the "package devel" #3 effort, xpFindPkg() was enhanced and calls a new cmake function ipGetPrefixPath() which eventually leverages cmake's FetchContent module to download devel packages -- within this cmake function include(CPack) is called so that CPACK_SYSTEM_NAME is defined -- CPACK_SYSTEM_NAME is needed to know the name of the devel package

CPACK_SYSTEM_NAME is just a mess on Windows and I was hoping to avoid hard-coding it by including CPack (which defines CPACK_SYSTEM_NAME)

CPACK_SYSTEM_NAME
System name, defaults to the value of CMAKE_SYSTEM_NAME, except on Windows where it will be win32 or win64.

xpPackageDevel CPACK_COMPONENTS_ALL

there is at lease one project/repo that has an additional cpack component to install -- more than just COMPONENT devel

  • dde_lib has COMPONENT tool

so rather than

set(CPACK_COMPONENTS_ALL devel)

xpPackageDevel should

list(APPEND CPACK_COMPONENTS_ALL devel)

PKG_NAME from REPO

related to #16 -- the cmake function ipGetPrefixPath should get the PKG_NAME from the REPO -- because they should match and the package name is not always lowercase -- this fixed the extraction and finding of devel packages like NG_GDP and Sdvideo (which weren't being found when looking for ng_gdp and sdvideo)

flags.cmake: Debug Information Format no longer works

Windows Debug targets that link in third-party libraries built with externpro cmake report LNK4099 warnings, for example:

palam_<lib>-sd.pdb linking object as if no debug info

see palam issue https://isrhub.usurf.usu.edu/palam/palam/issues/333

changing the Debug Information Format from Program Database (/Zi) to C7 compatible (/Z7) has "fixed" this warning
https://github.com/externpro/externpro/blob/24.04/cmake/flags.cmake#L10-L14

if(MSVC)
  # Debug Information Format: C7 compatible
  xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "/Z7")
  xpStringAppendIfDne(CMAKE_C_FLAGS_DEBUG "/Z7")
endif()

this cmake has existed for nearly as long as externpro has existed and has worked for a long time (more than a decade), but it appears that perhaps because of the recent update to cmake 3.28 (was 3.24) this no longer changes the Debug Information Format -- this appears to be a cmake change or regression

xpFindPkg handle webpro

pros.cmake defines xp_${pkg}
and if xp_${pkg} was not defined, a cmake FATAL_ERROR has been issued

    if(DEFINED xp_${pkg})
      ipGetPrefixPath(pfx pth PKG ${pkg} ${xp_${pkg}})
      unset(${pfx}-${pkg}_DIR CACHE)
      find_package(${pfx}-${pkg} REQUIRED PATHS ${pth} NO_DEFAULT_PATH)
      mark_as_advanced(${pfx}-${pkg}_DIR)
    else()
      message(FATAL_ERROR "xpFindPkg: xp_${pkg} not defined")
    endif()

however, webpro has several packages that are "found" via xpFindPkg() and so rather than add and maintain every webpro package in pros.cmake, for now if xp_${pkg} isn't defined it should default to finding the package how it was previously -- where the prefix is usexp and it searches in XP_MODULE_PATH

compose: default network

the compose yml files have been specifying

network: host
network_mode: host

for almost as long as we've been utilizing containers

in the early days (Jan 2021) of our use of containers, this commit modified the build container to use network_mode: host and removed the customized bridge network externpro/buildpro@ab6be8e this was part of an effort to separate "build containers" from "runtime containers" -- we didn't want build containers to have things like enabling jumbo frames and a named bridge network (necessary for runtime)

presently it appears that having containers using the host network has created issues for swat (software autotest tool) and if it runs in the default (bridge) network, swat can then dynamically connect the build container to the swat network at runtime (see https://isrhub.usurf.usu.edu/kmurphy/CommonLibraries/pull/20 and https://isrhub.usurf.usu.edu/kmurphy/SWATFramework/pull/6)

apparently no longer utilizing the host network also more closely matches the network used by CI machines https://isrhub.usurf.usu.edu/kmurphy/CommonLibraries/pull/20#discussion_r133461

when CI runs, it builds the containers by running ./docker-compose.sh -b, which builds them, but doesn't start them. I then upload them to Isrhub's contain registry for future steps to be able to run them.
However, when those future steps run them, all they do is pull down the image, but they don't get any of the runtime settings that were in the docker-compose.yml file, just the build time settings. The network being a runtime setting. One of my thoughts was maybe we could just set network_mode to host in CI's yml files. however, there is a big warning saying that --network is not supported... https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontaineroptions

docker permission denied

on Windows using WSL2, running the build container (./docker-compose.sh), and attempting to execute any docker command

smanders@bpbld23-04:/bpvol/commonlibraries (development)
$ docker ps -a
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json?all=1": dial unix /var/run/docker.sock: connect: permission denied

and there are now additional reports that some linux systems are experiencing the same error (but not all linux systems) -- some CI systems that were recently updated https://isrhub.usurf.usu.edu/IsrhubActions/VantageCI/issues/77#issuecomment-295177

cmake/xpweb: xpwebInstallNBuild doesn't prevent unnecessary rebuilds in all cases

This issue seems to surface only after doing several incremental builds, but when it starts, all incremental builds will rebuild the project regardless of an absence of changes to the files. The only way I have found to get it to stop is a clean run (cmake and build)

It is suspected that the issue may lie with yarn. It may be touching the lock file in certain circumstances. We might consider not including the lock file in the list of files to watch and instead rely on yarn to trigger an update. That way we can just rely on the yarn target to cascade the rebuild.

originally https://isrhub.usurf.usu.edu/webpro/webpro/issues/594

mysql-connector-odbc 9.0

same issue as before #21
odbcinst.ini is 9.0
odbc.ini is 8.4 and needs to be updated to 9.0

the buildpro runtime/develop docker images were updated to include libnsl
externpro/buildpro#79

other packages in the dockerfiles of these images are also updated when there is a change to the dockerfile
the browser/chrome version also needed to be updated because the previous version being installed is no longer available
externpro/buildpro#80

and now it's been discovered that the mysql-connector-odbc package has also been updated and that requires a change to the odbc.ini.test file in this repo -- see https://isrhub.usurf.usu.edu/Vantage/VantageSuper/pull/6029#issuecomment-308939 for additional details

the plan is to see if VANTAGE is good using 9.0 and if it is there will be an update to buildpro and externpro/externpro (aka .devcontainer) to move everything forward -- if not, or if there is any reluctance to move to 9.0 I will need to spend time figuring out how to lock the version of mysql-connector-odbc in the dockerfiles

cmake presets

https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html

share settings with other people for common ways to configure a project

externpro/internpro projects are built driven by cmake configure options/flags from the [ex|in]ternpro/projects .cmake files, for example curl: https://github.com/smanders/externpro/blob/24.02/projects/curl.cmake#L33-L46

  set(XP_CONFIGURE
    -DCMAKE_INSTALL_INCLUDEDIR=include/${NAME}_${VER}
    -DCMAKE_INSTALL_LIBDIR=lib
    -DXP_INSTALL_CMAKEDIR=share/cmake/tgt-${NAME}
    -DXP_MODULE_PATH=${CMAKE_DIR}
    -DXP_NAMESPACE:STRING=xpro
    -DBUILD_CURL_EXE=ON
    -DBUILD_SHARED_LIBS=OFF
    -DBUILD_TESTING=OFF
    -DENABLE_ARES=ON
    -DCMAKE_USE_OPENSSL=ON
    -DCURL_DISABLE_LDAP=ON
    -DUSE_LIBIDN2=OFF
    )

I was looking for a way for store these configure options in the repo once these projects are built stand-alone as part of the next generation externpro and came across cmake-presets

5 types of preset objects, to list the defined presets:

  1. configure: cmake --list-presets or cmake --list-presets=configure
  2. build: cmake --build --list-presets or cmake --list-presets=build
  3. test: ctest --list-presets or cmake --list-presets=test
  4. package: cpack --list-presets or cmake --list-presets=package
  5. workflow: cmake --workflow --list-presets or cmake --list-presets=workflow

examples of running presets:

  1. configure: cmake --preset=debug
  2. build: cmake --build --parallel --preset=debug --target package
  3. package: cpack --preset=debug
  4. workflow: cmake --workflow --preset=release; cmake --workflow --preset=debug

the fact that CMakePresets.json and CMakeUserPresets.json can include other files with the include field https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#includes means there can be a default or reusable preset .json files in the externpro cmake/ directory, making the(se) .json file(s) accessible to any project that uses externpro cmake

xpSourceListAppend auto add to cmake

every so often externpro cmake is update to handle adding files automatically to the cmake -- for example smanders/externpro#376

global.json is the latest such file that would be nice to handle automatically https://isrhub.usurf.usu.edu/kmurphy/TemplateMicroservice/pull/11#pullrequestreview-101535

however, maybe it's also wise to use some wildcards so that all json files in the root of the repo are automatically added, and any .*rc file (which would take care of .crtoolrc and .prettierrc)

version.cmake was our old way of specifying the version, but now we use project() to specify VERSION, so version.cmake could be removed from the list

cmake presets binaryDir override

background

as described in the issue when cmake presets were introduced to externpro #2 (comment)

it's expected that there will be two files in the root of a project leveraging externpro's cmake preset support

  1. CMakePresets.json
  2. CMakePresetsBase.json

the CMakePresetsBase.json file allows a project to define its own config-base

binaryDir

An optional string representing the path to the output binary directory.

example CMakePresetsBase.json https://github.com/externpro/externpro/blob/24.03/cmake/presets/CMakePresetsBase.json#L7

by default binaryDir is ${sourceDir}/_bld-${presetName} (so _bld-Linux and _bld-Windows in the source directory) and project repos have a .gitignore with _bld*/ so all directories starting with _bld are git ignored

package devel

as part of the next generation of externpro, projects should build and package standalone

this issue is to track commits and design decisions related to packaging (with COMPONENT devel for development), including what is included in the package

also any cmake necessary to download and extract and find the devel package

offlineImage.sh (and loadImage.sh) adjustments

I was worried I wasn't going to have it exactly correct #32 (comment) (since I hadn't verified everything worked)

as reported by another developer via zoom

Just got back from running ./loadImage.sh for 24.07 and got an error. Everything appeared to stage properly ( loading layer . . . . ), but it failed to load the image with error for line 15: unexpected EOF while looking for matching '"'; line 18: syntax error: unexpected end of file.
6A375A2A-1261-46BF-95F8-C16B1ECFB62B

denv script [build|web]pro_REV

script should look for buildpro_REV in root CMakeLists.txt file first, so project can override if buildpro_REV is set in a toplevel.cmake in a submodule (like CommonLibraries)

add ability for project to

set(webpro_REV NONE)

so that it can set this in the root CMakeLists.txt and override if webpro_REV is set in a toplevel.cmake in a submodule (like CommonLibraries)

remove centos7-run

now that rocky85-run #22 has replaced centos7-run 91f04b7 there is no longer a reason to keep centos7-run around, especially since it was found that executables built on rocky85 can't be run on centos7

CRTool fails to install on offline system

with the removal of "create offline container bundle" support #32 CRTool and CRToolImpl are now downloaded via wget from isrhub (there is an "offline" or closed-area enterprise github server also named isrhub)

https://github.com/externpro/externpro/blob/24.06/denv.sh#L84-L86

  CRTOOL_DL="wget -q \"${urlPfx}/CRTool/CRTool/releases/download/${crWrapVer}/CRTool-${crWrapVer}.sh\" \
&& wget -q \"${urlPfx}/CRTool/CRToolImpl/releases/download/${crToolVer}/CRToolImpl-${crToolVer}.sh\" \
&& chmod 755 CRTool*.sh"

currently the wget is successful when run from the host, but when run from the container as the docker image is being built, wget fails -- and removing the -q (quiet) option reveals that there is a certificate error

certificate support was added #23 and adjusted #33 -- but the issue here is that the certificates need to be added and update-ca-trust run before the wget command happens!

cmake/xpweb: xpwebInstallNBuild is broken when using TEST_DEPENDS option in angular projects

When using the TEST_DEPENDS option in the xpwebInstallNBuild function for angular, the generated make files (linux only) seem to include an incorrect target name used as a dependency for the unit test target. It appears the dependency target name is not converting the YARN_TARGET variable correctly because the target name includes "YARN_TARGET".

Example usage: https://isrhub.usurf.usu.edu/dlanier/Gateway/blob/c083c745fc0a6ab23a6cd3c734e9e7fe8817abaf/WebClient/CMakeLists.txt#L256

Build error: https://isrhub.usurf.usu.edu/Vantage/Gateway/actions/runs/15824/job/120251?pr=108#step:4:993

originally https://isrhub.usurf.usu.edu/webpro/webpro/issues/612

Findscript enhancements

there was a chicken-egg problem... the Findscript.cmake.in file couldn't leverage externpro's xpfunmac.cmake xpGetCompilerPrefix() because that cmake function was part of the bundled package of externpro and hadn't been found yet
https://github.com/externpro/externpro/blob/24.02/cmake/Findscript.cmake.in#L4-L5

but now that the next generation of externpro is a submodule

git submodule add https://github.com/externpro/externpro .devcontainer

xpfunmac.cmake and it's xpGetCompilerPrefix() cmake function is found in .devcontainer/cmake and so the Findscript.cmake.in file can be simplified and simply call this function

also, getNumBits() can be moved from Findscript.cmake.in into xpfunmac.cmake and named xpGetNumBits()

cmake/xpweb: xpwebInstallNBuild function is broken with CMake >= 3.29.x

I have tested it with 3.28.4 and everything seems to be in good order, but with the latest 3.29 there are issues with the build. I haven't tried this myself, but I have report that the issue lies within the step where CMake is suppose to create the tar.gz file for packaging and angular web app.

originally https://isrhub.usurf.usu.edu/webpro/webpro/issues/598 -- see this issue for a lot more details (maybe I'll transfer them here at some point?)

dirtyrepo exception in proSetStageDir()

a dirty repo exception was added to xpPackageDevel() in this commit ea6b1c2 -- so that if CMakePresetsBase.json is the only thing dirty, we don't append a "dirty repo" marker to git describe --tags -- this is because the launchWorkflow.cmake script can modify CMakePresetsBase.json to override binaryDir (see commit message for links to additional details)

this same exception should be added to the macro proSetStageDir() https://github.com/externpro/externpro/blob/24.06/cmake/macpro.cmake#L235-L248 -- which is used by externpro and webpro to set the staging directory and mark the package and installation directory as "dirty" -- this would help these projects move towards being built via CI (github actions) and cmake presets without being marked "dirty"

credit: this was a suggested enhancement from @camerbam

xpPackageDevel remove PRJ_NAME

CI requires that the devel package name match the name of the repo

for example, if the repo is named NG_GDP, the devel package should be named NG_GDP-<git describe --tags>-<OS>-devel.tar.xz

I was trying to minimize xpFindPkg() changes -- so trying to keep

xpFindPkg(PKGS sdl_ggdp)

so I introduced the PRJ_NAME parameter to xpPackageDevel() so the package could be named differently than the repo

but since CI requires them to be the same there is no reason to give a project the ability to change this

cmake presets install target

it would be useful if the build preset also built the install target for release configurations (this is especially useful for palam, for the UnitTestReqTool)

remove "browser later versions" support

"browser later versions" support was added with issue externpro/buildpro#47 (pull externpro/buildpro#48) and updated with issue externpro/buildpro#51

SWATFramework has decided to go a different direction, using Selenium containers https://isrhub.usurf.usu.edu/SWAT/SWATFramework/issues/586 and four images [chrome|firefox]-[min|modern] will be hosted on VantageDocker/TestingImages https://isrhub.usurf.usu.edu/VantageDocker/TestingImages/issues/9

the support added to devcontainer can be removed

pros.cmake devel packages

some initial projects (patch, fftw, kakadu) were switched to devel packages with issue #3

switch additional projects in pros.cmake from XP_MODULE (find package in externpro/internpro) to devel packages

secure room certificates

From: Aaron May
Date: Tuesday, September 26, 2023 at 10:51 AM
To: Blake Nelson, Chad Jeppson
Cc: Kevin Glenn, Paul Bowen, Pete Mace, Scott M Anderson
Subject: Re: Follow up for secure room docker container certificate issue

Scott has been asked to consider this with a future externpro, but there's no way that we'll have any kind of externpro to fix this for LinPI/Krayt/Corellia. As such we have told Pete that this will unfortunately have to be an additional manual step to the build process.

As this is a new (but hopefully temporary) addition to the build process, developers should also perform the same steps. We have had some developers say that they don't have to do this every time they start their container. It might just be something we have to do the first time you build the container. (A bit out of my depth and so I'm not sure I'm correct or even using the right terminology)

Copy the certificate(s) from the following folder outside the container into the same path in the container:
/etc/pki/ca-trust/source/anchors/
Then run the following command:
update-ca-trust

Scott/Pete/Chad, please use this time to correct me if I misunderstood the path forward. Thanks Everyone!

From: Blake Nelson
Sent: Tuesday, September 26, 2023 10:31:15 AM
To: Aaron May; Chad Jeppson
Subject: Follow up for secure room docker container certificate issue

Last week we discovered that the docker container is still unable to checkout the secure repository (we're now using the right protocol but don't have access to the certificate). I'm still needing to manually checkout the secure repo outside the container before running cmake inside the container.

I just assumed someone would work with smanders to take care of it, but then I realized maybe that was the assumption everyone was making? Is anyone working on this now? If not I can open discussions with smanders.

Thanks.
Blake

cmake/presets/launchWorkflow.cmake REGEX adjustment

the launchWorkflow.cmake script https://github.com/externpro/externpro/blob/24.06/cmake/presets/launchWorkflow.cmake was introduced (see #6) to allow CI (and anyone else) to override the binaryDir in the CMakePresetsBase.json file

for example, from the source directory of a project that has CMakePresets[Base].json

cmake -DbinaryDir="\${sourceParentDir}/_bld-\${sourceDirName}-\${presetName}" -P .devcontainer/cmake/presets/launchWorkflow.cmake

or

cmake -DbinaryDir=/bpvol/workspace/foobar_bld -P .devcontainer/cmake/presets/launchWorkflow.cmake

however, the regex of this line https://github.com/externpro/externpro/blob/24.06/cmake/presets/launchWorkflow.cmake#L5

set(regex "^.*\"binaryDir\": \"(.*)\"$")

assumes that the binaryDir line in CMakePresetsBase.json ends with a quote

and it often does, for example:
https://github.com/externpro/externpro/blob/24.06/cmake/presets/CMakePresetsBase.json#L7

"binaryDir": "${sourceDir}/_bld-${presetName}"

but the binaryDir line optionally might end with a comma, for example:
https://github.com/smanders/externpro/blob/24.04/CMakePresetsBase.json#L7-L9

      "binaryDir": "${sourceDir}/_bld-${presetName}",
      "cacheVariables": {
        "XP_STEP": "build"

so the regex needs to optionally look for a comma at the end of the binaryDir line

xpPackageDevel dirtyrepo, sysinfo

xpPackageDevel https://github.com/externpro/externpro/blob/24.04/cmake/xpfunmac.cmake#L1909 should append a dirty repo indicator (suffix -dr) to git describe --tags output so CPACK_PACKAGE_VERSION indicates that the package includes changes that haven't been committed (similar to what smanders/externpro does https://github.com/externpro/externpro/blob/24.04/cmake/macpro.cmake#L238-L242)

it would also be helpful for xpPackageDevel to record system information and include this in the devel package (again, similar to what smanders/externpro does https://github.com/externpro/externpro/blob/24.04/cmake/macpro.cmake#L257-L277)

cmake: Version.hpp.in inject

was smanders/externpro#20

In a way similar to how I've taken the wix template file and added cmake variables as a way to inject other text (xml for the wix template), add a cmake variable to the Version.hpp.in template file so developers can inject text into the cmake configured Version.hpp.

Use case: it would have been nice to inject the RDTP library version into the Version.hpp file for the RDTP tools.

xpSourceListAppend symlinks

repos like [Common|Plugin]Libraries have symlinks docker-compose.[sh|yml] that point to .devcontainer/compose files

once the submodule is in place (init/sync/update) there is no issue with these files, but when [Common|Plugin]Libraries is used as a submodule it would be nice if the .devcontainer submodule didn't need to be recursively initialized (git submodule update --init --recursive) because the .devcontainer for [Common|Plugin]Libraries isn't needed when they are being used as a submodule

however, when the nested submodule isn't initialized/updated, xpSourceListAppend sees that there are files in the repo that aren't in cmake

-- ***** FILE(S) IN REPO, BUT NOT IN CMAKE *****
-- Libraries/docker-compose.sh
-- Libraries/docker-compose.yml

these symlinks aren't valid because they point to something that doesn't exist (because the nested .devcontainer hasn't been initialized/updated)

lrwxrwxrwx  1 smanders smanders   28 Apr 15  2023 docker-compose.sh -> .devcontainer/compose.bld.sh
lrwxrwxrwx  1 smanders smanders   29 Apr 15  2023 docker-compose.yml -> .devcontainer/compose.bld.yml

and if these invalid symlinks are added to a cmake target, then cmake throws an error

CMake Error at .devcontainer/cmake/xpfunmac.cmake:1144 (add_custom_target):
  Cannot find source file:

    /bpvol/templatemicroservice/Libraries/docker-compose.sh
Call Stack (most recent call first):
  Libraries/CMakeLists.txt:114 (xpSourceListAppend)

so the trick is to add these invalid symlinks to the masterSrcList, but then remove them from the composeFiles list before the composeFiles list is added to a custom target

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.