Skip to content

Commit

Permalink
Add build files 2024-07-30-0524
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 30, 2024
1 parent 9376cb2 commit 0fc6bbe
Show file tree
Hide file tree
Showing 21 changed files with 1,447 additions and 0 deletions.
119 changes: 119 additions & 0 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
jobs:
stage_0_job_0:
name: tf2-web-republisher
runs-on: windows-2019
strategy:
fail-fast: false
needs: []
env:
CONDA_BLD_PATH: C:\\bld\\
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: 'true'
channel-priority: 'true'
python-version: '3.11'
activate-environment: test
- run: mamba install -c conda-forge -n base --yes --quiet conda-build pip mamba
ruamel.yaml anaconda-client boa
name: Install conda-build, boa and activate environment
- uses: egor-tensin/cleanup-path@v4
with:
dirs: C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;C:\Program
Files\Git\mingw64\bin
- shell: cmd
run: |
set "CI=azure"
call activate base
:: 4 cores available on GHA: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
:: CPU_COUNT is passed through conda build: https://github.com/conda/conda-build/pull/1149
set CPU_COUNT=4
set PYTHONUNBUFFERED=1
conda config --set show_channel_urls true
conda config --set auto_update_conda false
conda config --set add_pip_as_python_dependency false
call setup_x64
:: Set the conda-build working directory to a smaller path
if "%CONDA_BLD_PATH%" == "" (
set "CONDA_BLD_PATH=C:\\bld\\"
)
:: On azure, there are libcrypto*.dll & libssl*.dll under
:: C:\\Windows\\System32, which should not be there (no vendor dlls in windows folder).
:: They would be found before the openssl libs of the conda environment, so we delete them.
if defined CI (
DEL C:\\Windows\\System32\\libcrypto-1_1-x64.dll || (Echo Ignoring failure to delete C:\\Windows\\System32\\libcrypto-1_1-x64.dll)
DEL C:\\Windows\\System32\\libssl-1_1-x64.dll || (Echo Ignoring failure to delete C:\\Windows\\System32\\libssl-1_1-x64.dll)
)
:: Make paths like C:\\hostedtoolcache\\windows\\Ruby\\2.5.7\\x64\\bin garbage
set "PATH=%PATH:ostedtoolcache=%"
mkdir "%CONDA%\\etc\\conda\\activate.d"
echo set "CONDA_BLD_PATH=%CONDA_BLD_PATH%" > "%CONDA%\\etc\\conda\\activate.d\\conda-forge-ci-setup-activate.bat"
echo set "CPU_COUNT=%CPU_COUNT%" >> "%CONDA%\\etc\\conda\\activate.d\\conda-forge-ci-setup-activate.bat"
echo set "PYTHONUNBUFFERED=%PYTHONUNBUFFERED%" >> "%CONDA%\\etc\\conda\\activate.d\\conda-forge-ci-setup-activate.bat"
echo set "PATH=%PATH%" >> "%CONDA%\\etc\\conda\\activate.d\\conda-forge-ci-setup-activate.bat"
conda info
conda config --show-sources
conda list --show-channel-urls
name: conda-forge build setup
- shell: cmd
run: |
setlocal EnableExtensions EnableDelayedExpansion
call %CONDA%\condabin\conda_hook.bat
call %CONDA%\condabin\conda.bat activate base
echo "PATH is %PATH%"
echo "CONDA_BLD_PATH is %CONDA_BLD_PATH%"
rmdir /Q/S C:\Strawberry\
rmdir /Q/S "C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\"
set "FEEDSTOCK_ROOT=%cd%"
mkdir %CONDA_BLD_PATH%
call conda index %CONDA_BLD_PATH%
rem call conda config --remove channels defaults
call conda config --add channels conda-forge
call conda config --add channels robostack-staging
call conda config --add channels %CONDA_BLD_PATH%
:: call conda config --set channel_priority strict
:: Enable long path names on Windows
reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
:: conda remove --force m2-git
for %%X in (%CURRENT_RECIPES%) do (
echo "BUILDING RECIPE %%X"
cd %FEEDSTOCK_ROOT%\recipes\%%X\
boa build . -m %FEEDSTOCK_ROOT%\.ci_support\conda_forge_pinnings.yaml -m %FEEDSTOCK_ROOT%\conda_build_config.yaml
if errorlevel 1 exit 1
)
anaconda -t %ANACONDA_API_TOKEN% upload "C:\bld\win-64\*.tar.bz2" --force
if errorlevel 1 exit 1
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
CURRENT_RECIPES: ros-noetic-tf2-web-republisher
PYTHONUNBUFFERED: 1
name: Build ros-noetic-tf2-web-republisher
name: build_win
on:
push:
branches:
- buildbranch_win
15 changes: 15 additions & 0 deletions activate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:: Generated by vinca http://github.com/RoboStack/vinca.
:: DO NOT EDIT!
@if not defined CONDA_PREFIX goto:eof

@REM Don't do anything when we are in conda build.
@if defined SYS_PREFIX exit /b 0

@set "QT_PLUGIN_PATH=%CONDA_PREFIX%\Library\plugins"

@call "%CONDA_PREFIX%\Library\local_setup.bat"
@set PYTHONHOME=
@set "ROS_OS_OVERRIDE=conda:win64"
@set "ROS_ETC_DIR=%CONDA_PREFIX%\Library\etc\ros"
@set "AMENT_PREFIX_PATH=%CONDA_PREFIX%\Library"
@set "AMENT_PYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe"
16 changes: 16 additions & 0 deletions activate.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Generated by vinca http://github.com/RoboStack/vinca.
# DO NOT EDIT!
if ($null -eq ${env:CONDA_PREFIX}) { Exit }

# Don't do anything when we are in conda build.
if ($null -ne ${env:SYS_PREFIX}) { Exit 0 }

$Env:QT_PLUGIN_PATH="${env:CONDA_PREFIX}\Library\plugins"

& "${env:CONDA_PREFIX}\Library\local_setup.ps1"

$Env:PYTHONHOME=''
$Env:ROS_OS_OVERRIDE='conda:win64'
$Env:ROS_ETC_DIR="${env:CONDA_PREFIX}\Library\etc\ros"
$Env:AMENT_PREFIX_PATH="${env:CONDA_PREFIX}\Library"
$Env:AMENT_PYTHON_EXECUTABLE="${env:CONDA_PREFIX}\python.exe"
26 changes: 26 additions & 0 deletions activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by vinca http://github.com/RoboStack/vinca.
# DO NOT EDIT!
# if [ -z "${CONDA_PREFIX}" ]; then
# exit 0;
# fi

# Not sure if this is necessary on UNIX?
# export QT_PLUGIN_PATH=$CONDA_PREFIX\plugins

if [ "$CONDA_BUILD" = "1" -a "$target_platform" != "$build_platform" ]; then
# ignore sourcing
echo "Not activating ROS when cross-compiling";
else
source $CONDA_PREFIX/setup.sh
fi

case "$OSTYPE" in
darwin*) export ROS_OS_OVERRIDE="conda:osx"; export RMW_IMPLEMENTATION="rmw_cyclonedds_cpp";;
linux*) export ROS_OS_OVERRIDE="conda:linux";;
esac

export ROS_ETC_DIR=$CONDA_PREFIX/etc/ros
export AMENT_PREFIX_PATH=$CONDA_PREFIX

# Looks unnecessary for UNIX
# unset PYTHONHOME=
39 changes: 39 additions & 0 deletions bld_ament_cmake.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
:: Generated by vinca http://github.com/RoboStack/vinca.
:: DO NOT EDIT!
setlocal EnableDelayedExpansion

set "PYTHONPATH=%LIBRARY_PREFIX%\lib\site-packages;%SP_DIR%"

:: MSVC is preferred.
set CC=cl.exe
set CXX=cl.exe

rd /s /q build
mkdir build
pushd build

:: set "CMAKE_GENERATOR=Ninja"

:: try to fix long paths issues by using default generator
set "CMAKE_GENERATOR=Visual Studio %VS_MAJOR% %VS_YEAR%"
set "SP_DIR_FORWARDSLASHES=%SP_DIR:\=/%"

cmake ^
-G "%CMAKE_GENERATOR%" ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=True ^
-DPYTHON_EXECUTABLE=%PYTHON% ^
-DPython_EXECUTABLE=%PYTHON% ^
-DPython3_EXECUTABLE=%PYTHON% ^
-DSETUPTOOLS_DEB_LAYOUT=OFF ^
-DBUILD_SHARED_LIBS=ON ^
-DBUILD_TESTING=OFF ^
-DCMAKE_OBJECT_PATH_MAX=255 ^
-DPYTHON_INSTALL_DIR=%SP_DIR_FORWARDSLASHES% ^
--compile-no-warning-as-error ^
%SRC_DIR%\%PKG_NAME%\src\work
if errorlevel 1 exit 1

cmake --build . --config Release --target install
if errorlevel 1 exit 1
25 changes: 25 additions & 0 deletions bld_ament_python.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
:: Generated by vinca http://github.com/RoboStack/vinca.
:: DO NOT EDIT!
setlocal

set "PYTHONPATH=%LIBRARY_PREFIX%\lib\site-packages;%SP_DIR%"

pushd %SRC_DIR%\%PKG_NAME%\src\work
set "PKG_NAME_SHORT=%PKG_NAME:*ros-noetic-=%"
set "PKG_NAME_SHORT=%PKG_NAME_SHORT:-=_%"

:: If there is a setup.cfg that contains install-scripts then use pip to install
findstr install[-_]scripts setup.cfg
if "%errorlevel%" == "0" (
%PYTHON% setup.py install --single-version-externally-managed --record=files.txt ^
--prefix=%LIBRARY_PREFIX% ^
--install-lib=%SP_DIR% ^
--install-scripts=%LIBRARY_PREFIX%\lib\%PKG_NAME_SHORT%
) else (
%PYTHON% setup.py install --single-version-externally-managed --record=files.txt ^
--prefix=%LIBRARY_PREFIX% ^
--install-lib=%SP_DIR% ^
--install-scripts=%LIBRARY_PREFIX%\bin
)

if errorlevel 1 exit 1
81 changes: 81 additions & 0 deletions bld_catkin.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
:: Generated by vinca http://github.com/RoboStack/vinca.
:: DO NOT EDIT!
setlocal
set "PYTHONPATH=%LIBRARY_PREFIX%\lib\site-packages;%SP_DIR%"

:: MSVC is preferred.
set CC=cl.exe
set CXX=cl.exe

:: ROS_BUILD_SHARED_LIBS is always defined in CMake by catkin
:: if ROS (1) is build as shared library . However, some packages are not
:: passing compilation flags from CMake to other build systems (such as qmake),
:: so we enable it explicitly via the CL environment variable, see
:: https://learn.microsoft.com/en-us/cpp/build/reference/cl-environment-variables?view=msvc-170
set CL=/DROS_BUILD_SHARED_LIBS=1 /DNOGDI=1

set "CATKIN_BUILD_BINARY_PACKAGE_ARGS=-DCATKIN_BUILD_BINARY_PACKAGE=1"
if "%PKG_NAME%" == "ros-noetic-catkin" (
:: create catkin cookie to make it is a catkin workspace
type NUL > %LIBRARY_PREFIX%\.catkin
:: keep the workspace activation scripts (e.g., local_setup.bat)
set CATKIN_BUILD_BINARY_PACKAGE_ARGS=
)

rd /s /q build
mkdir build
pushd build

set SKIP_TESTING=ON

cmake ^
-G "Ninja" ^
--compile-no-warning-as-error ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=ON ^
-DBUILD_SHARED_LIBS=ON ^
-DPYTHON_EXECUTABLE=%PYTHON% ^
-DPython_EXECUTABLE=%PYTHON% ^
-DPython3_EXECUTABLE=%PYTHON% ^
-DSETUPTOOLS_DEB_LAYOUT=OFF ^
-DBoost_USE_STATIC_LIBS=OFF ^
%CATKIN_BUILD_BINARY_PACKAGE_ARGS% ^
-DCATKIN_SKIP_TESTING=%SKIP_TESTING% ^
%SRC_DIR%\%PKG_NAME%\src\work
if errorlevel 1 exit 1

if "%PKG_NAME%" == "ros-noetic-eigenpy" (
cmake --build . --config Release --target all --parallel 1
if errorlevel 1 exit 1
) else (
cmake --build . --config Release --target all
if errorlevel 1 exit 1
)

if "%SKIP_TESTING%" == "OFF" (
cmake --build . --config Release --target run_tests
if errorlevel 1 exit 1
)

cmake --build . --config Release --target install
if errorlevel 1 exit 1

if "%PKG_NAME%" == "ros-noetic-catkin" (
:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
for %%F in (activate deactivate) DO (
if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
)
)

if "%PKG_NAME%" == "ros-noetic-ros-workspace" (
:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
for %%F in (activate deactivate) DO (
if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
copy %RECIPE_DIR%\%%F.ps1 %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.ps1
)
)
34 changes: 34 additions & 0 deletions bld_catkin_merge.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
:: Generated by vinca http://github.com/RoboStack/vinca.
:: DO NOT EDIT!
setlocal

:: MSVC is preferred.
set CC=cl.exe
set CXX=cl.exe

:: ROS_BUILD_SHARED_LIBS is always defined in CMake by catkin
:: if ROS (1) is build as shared library . However, some packages are not
:: passing compilation flags from CMake to other build systems (such as qmake),
:: so we enable it explicitly via the CL environment variable, see
:: https://learn.microsoft.com/en-us/cpp/build/reference/cl-environment-variables?view=msvc-170
set CL=/DROS_BUILD_SHARED_LIBS=1 /DNOGDI=1

set CATKIN_MAKE_ISOLATED=src\ros-noetic-catkin\bin\catkin_make_isolated
set CMAKE_PREFIX_PATH=%CMAKE_PREFIX_PATH:\=/%

%PYTHON% %CATKIN_MAKE_ISOLATED% ^
--install-space %LIBRARY_PREFIX% ^
--use-ninja ^
--install ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_SHARED_LIBS=ON ^
-DPYTHON_EXECUTABLE=%PYTHON% ^
-DCATKIN_SKIP_TESTING=ON
if errorlevel 1 exit 1

:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
for %%F in (activate deactivate) DO (
if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
)
29 changes: 29 additions & 0 deletions bld_colcon_merge.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
:: Generated by vinca http://github.com/RoboStack/vinca.
:: DO NOT EDIT!
setlocal

:: MSVC is preferred.
set CC=cl.exe
set CXX=cl.exe

set "SP_DIR_FORWARDSLASHES=%SP_DIR:\=/%"

colcon build ^
--event-handlers console_cohesion+ ^
--merge-install ^
--install-base %LIBRARY_PREFIX% ^
--cmake-args ^
--compile-no-warning-as-error ^
-G Ninja ^
-DCMAKE_BUILD_TYPE=Release ^
-DBUILD_TESTING=OFF ^
-DPYTHON_INSTALL_DIR=%SP_DIR_FORWARDSLASHES% ^
-DPYTHON_EXECUTABLE=%PYTHON%
if errorlevel 1 exit 1

:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d.
:: This will allow them to be run on environment activation.
for %%F in (activate deactivate) DO (
if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d
copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat
)
Loading

0 comments on commit 0fc6bbe

Please sign in to comment.