Initial commit
This commit is contained in:
164
README.md
Normal file
164
README.md
Normal file
@@ -0,0 +1,164 @@
|
||||
---
|
||||
gitea: none
|
||||
include_toc: true
|
||||
---
|
||||
|
||||
# Conan 2.0 Profiles, Remotes and Global-Configuration and Usage
|
||||
|
||||
## 1. Overview
|
||||
|
||||
This directory contains Conan 2.0 profile files used to define the build configuration for our projects. They cover multiple architectures (`x64`, `armv8`) and GCC compiler versions (`9`, `13`, `14`).
|
||||
|
||||
## Quick-Start
|
||||
|
||||
To apply these configurations to your local Conan environment, use the `conan config install` command pointing to this repository.
|
||||
Installs global.conf, remotes.json, and profiles automatically:
|
||||
|
||||
> ⚠️ **Warning:** This command will **overwrite** your existing [remotes.json](remotes.json) file. Any custom remotes you have configured will be replaced by the ones defined in this repository.
|
||||
>
|
||||
> **Please back up your existing remotes if needed!**
|
||||
|
||||
|
||||
```bash
|
||||
conan config install https://package-cloud.dns.army/ros2/conan2-config.git --type git
|
||||
# or a specific branch/tag
|
||||
conan config install https://package-cloud.dns.army/ros2/conan2-config.git --type git --args="--branch main"
|
||||
```
|
||||
|
||||
For authenticated access (development), use:
|
||||
|
||||
```bash
|
||||
export CONAN_USR=<your_username>
|
||||
export CONAN_PSW=<your_password>
|
||||
conan remote login package-cloud-ros2-conan2 $CONAN_USR -p $CONAN_PSW
|
||||
|
||||
# for development/nightly builds
|
||||
conan remote login package-cloud-ros2-dev-conan2 $CONAN_USR -p $CONAN_PSW
|
||||
# is disabled by default, enable it with:
|
||||
conan remote enable package-cloud-ros2-dev-conan2
|
||||
```
|
||||
|
||||
## 7. Requirements
|
||||
|
||||
- **Conan Client**: Version 2.0+ is required.
|
||||
|
||||
## 2. Naming Convention
|
||||
|
||||
The filenames follow a strict pattern to identify the target environment:
|
||||
|
||||
`{arch}_{os}_{compiler}_{version}[_{variant}]`
|
||||
|
||||
- **{arch}**: Target architecture (`x64`, `armv8`)
|
||||
- **{os}**: Target operating system (`linux`)
|
||||
- **{compiler}**: Compiler used (`gcc`)
|
||||
- **{version}**: Major compiler version (`9`, `13`, `14`)
|
||||
- **{variant}**: Optional suffix for specific cross-compilation toolchains (e.g., `croco` for ARMv8 Cross-Compilation toolchain)
|
||||
|
||||
## 3. Profile Types
|
||||
|
||||
### A. Base Profiles
|
||||
|
||||
*(e.g., `x64_linux_gcc_13`, `armv8_linux_gcc_14`)*
|
||||
|
||||
- Define the standard settings: `os`, `arch`, `compiler`, `build_type`, `cppstd`.
|
||||
- Use the system-installed compiler or the default environment.
|
||||
- **Content format example:**
|
||||
|
||||
```ini
|
||||
[settings]
|
||||
arch=x86_64
|
||||
compiler=gcc
|
||||
...
|
||||
```
|
||||
|
||||
### B. Variant Profiles
|
||||
|
||||
*(e.g., `armv8_linux_gcc_13_croco`)*
|
||||
|
||||
- **EXTEND** base profiles using the `include()` directive.
|
||||
- **INJECT** specific build tools via `[tool_requires]`.
|
||||
- **"croco" variants** inject the `armv8-croco-toolchain` package for cross-compilation.
|
||||
|
||||
## 4. Usage
|
||||
|
||||
To use a profile, pass the filename to the Conan install or create command using the `-pr` (profile) argument.
|
||||
|
||||
**Example 1: Build for standard x64 Linux with GCC 14**
|
||||
|
||||
```bash
|
||||
conan install . -pr x64_linux_gcc_14 --build=missing
|
||||
```
|
||||
|
||||
**Example 2: Cross-compile for ARMv8 "Croco" target with GCC 9**
|
||||
|
||||
```bash
|
||||
conan install . -pr armv8_linux_gcc_9_croco --build=missing
|
||||
```
|
||||
|
||||
## 5. File List & Details
|
||||
|
||||
| Profile Filename | Arch | GCC Ver | Std | Description |
|
||||
|:---------------------------|:-------|:--------|:------|:-----------------------------------------------|
|
||||
| `x64_linux_gcc_9` | x86_64 | 9 | gnu14 | Legacy x64 build for ubuntu-focal-20.04 |
|
||||
| `x64_linux_gcc_13` | x86_64 | 13 | gnu17 | Modern x64 build for ubuntu-jammy-22.04 |
|
||||
| `x64_linux_gcc_14` | x86_64 | 14 | gnu17 | Bleeding edge x64 for ubuntu-noble-24.04 |
|
||||
| `armv8_linux_gcc_9` | armv8 | 9 | gnu14 | Base ARMv8 GCC 9 for ubuntu-focal-20.04 |
|
||||
| `armv8_linux_gcc_13` | armv8 | 13 | gnu17 | Base ARMv8 GCC 13 for ubuntu-jammy-22.04 |
|
||||
| `armv8_linux_gcc_14` | armv8 | 14 | gnu17 | Base ARMv8 GCC 14 for ubuntu-noble-24.04 |
|
||||
| `armv8_linux_gcc_9_croco` | armv8 | 9 | gnu14 | Croco Toolchain (v9.3) for ubuntu-focal-20.04 |
|
||||
| `armv8_linux_gcc_13_croco` | armv8 | 13 | gnu17 | Croco Toolchain (v13.3) for ubuntu-jammy-22.04 |
|
||||
| `armv8_linux_gcc_14_croco` | armv8 | 14 | gnu17 | Croco Toolchain (v14.3) for ubuntu-noble-24.04 |
|
||||
|
||||
## 6. Global Configuration & Remotes
|
||||
|
||||
In addition to profiles, this repository provides standard configuration for the Conan client (`global.conf`) and package repositories (`remotes.json`).
|
||||
|
||||
### A. Global Configuration (`global.conf`)
|
||||
|
||||
This file defines core client behavior, optimizing for build performance and system integration.
|
||||
|
||||
- **Networking:**
|
||||
- `core.net.http:timeout`: Set to **6000** seconds to handle large downloads over VPN.
|
||||
- `core.download:parallel` / `core.upload:parallel`: Dynamically uses all available CPU cores (`{{os.cpu_count()}}`) for faster transfers.
|
||||
|
||||
- **System Integration:**
|
||||
- `tools.system.package_manager:mode`: Set to `install` (automatically installs system dependencies like apt packages).
|
||||
- `tools.system.package_manager:sudo`: Enabled (`True`) to allow sudo for system package installs.
|
||||
|
||||
### B. Remotes (`remotes.json`)
|
||||
|
||||
This file defines the upstream sources for packages. The order is critical for security and precedence.
|
||||
|
||||
| Order | Remote Name | URL | Usage |
|
||||
|:------|:--------------------------------|:----------------------------------|:-----------------------------------------------------|
|
||||
| **1** | `package-cloud-ros2-conan2` | `.../api/packages/ros2/conan` | **Primary** source for stable production packages. |
|
||||
| **2** | `package-cloud-ros2-dev-conan2` | `.../api/packages/ros2-dev/conan` | **Secondary** source for development/nightly builds. |
|
||||
|
||||
**Important Note:** These remotes are hosted on `package-cloud.dns.army`. Ensure you have the necessary network access and credentials.
|
||||
|
||||
### C. Installation
|
||||
|
||||
To apply these configurations to your local Conan environment, use the `conan config install` command pointing to this repository:
|
||||
|
||||
> ⚠️ **Warning:** This command will **overwrite** your existing [remotes.json](remotes.json) file. Any custom remotes you have configured will be replaced by the ones defined in this repository.
|
||||
>
|
||||
> **Please back up your existing remotes if needed!**
|
||||
|
||||
```bash
|
||||
conan config install https://package-cloud.dns.army/ros2/conan2-config.git --type git
|
||||
# or a specific branch/tag
|
||||
conan config install https://package-cloud.dns.army/ros2/conan2-config.git --type git --args="--branch main"
|
||||
```
|
||||
|
||||
For authenticated access (development), use:
|
||||
|
||||
```bash
|
||||
export CONAN_USR=<your_username>
|
||||
export CONAN_PSW=<your_password>
|
||||
conan remote login package-cloud-ros2-conan2 $CONAN_USR -p $CONAN_PSW
|
||||
|
||||
# for development/nightly builds
|
||||
conan remote login package-cloud-ros2-dev-conan2 $CONAN_USR -p $CONAN_PSW
|
||||
# is disabled by default, enable it with:
|
||||
conan remote enable package-cloud-ros2-dev-conan2
|
||||
```
|
||||
95
Taskfile.yml
Normal file
95
Taskfile.yml
Normal file
@@ -0,0 +1,95 @@
|
||||
# https://taskfile.dev
|
||||
|
||||
version: "3"
|
||||
|
||||
vars:
|
||||
# Available for all Taskfiles!
|
||||
|
||||
# --- Color Palette (ANSI Escape Codes) ---
|
||||
RESET: '\033[0m'
|
||||
BOLD: '\033[1m'
|
||||
|
||||
# Standard Colors
|
||||
RED: '\033[0;31m'
|
||||
GREEN: '\033[0;32m'
|
||||
YELLOW: '\033[0;33m'
|
||||
BLUE: '\033[0;34m'
|
||||
MAGENTA: '\033[0;35m'
|
||||
CYAN: '\033[0;36m'
|
||||
WHITE: '\033[0;37m'
|
||||
|
||||
# Bold/Bright Colors
|
||||
B_RED: '\033[1;31m'
|
||||
B_GREEN: '\033[1;32m'
|
||||
B_YELLOW: '\033[1;33m'
|
||||
B_BLUE: '\033[1;34m'
|
||||
B_MAGENTA: '\033[1;35m'
|
||||
B_CYAN: '\033[1;36m'
|
||||
B_WHITE: '\033[1;37m'
|
||||
|
||||
tasks:
|
||||
default:
|
||||
desc: Show available tasks
|
||||
silent: true
|
||||
cmds:
|
||||
- task: version
|
||||
- task --list
|
||||
|
||||
version:
|
||||
silent: true
|
||||
vars:
|
||||
NAME_COMPONENT: conan2-config
|
||||
URL_COMPONENT: https://package-cloud.dns.army/ros2/conan2-config
|
||||
GIT_REF: main
|
||||
GIT_SHA:
|
||||
sh: git ls-remote {{.URL_COMPONENT}}.git {{.GIT_REF}} | awk 'NR==1 {print substr($1,1,7)}'
|
||||
cmds:
|
||||
- printf "{{.B_MAGENTA}}Component-Name{{.RESET}} - {{.CYAN}}{{.NAME_COMPONENT}}{{.RESET}}\n"
|
||||
- printf "{{.B_MAGENTA}}Component-Url{{.RESET}} - {{.CYAN}}{{.URL_COMPONENT}}{{.RESET}}\n"
|
||||
- printf "{{.B_MAGENTA}}Branch{{.RESET}} - {{.CYAN}}{{.GIT_REF}} {{.B_WHITE}}{{.RESET}} - {{.B_MAGENTA}}Hash{{.RESET}} - {{.GREEN}}{{.GIT_SHA}}{{.RESET}}\n"
|
||||
- printf "\n"
|
||||
|
||||
list:profiles:
|
||||
desc: List all available conan build profiles [local]
|
||||
cmds:
|
||||
- conan profile list
|
||||
|
||||
list:remotes:
|
||||
desc: List all available conan remotes [local]
|
||||
cmds:
|
||||
- conan remote list
|
||||
|
||||
list:config:
|
||||
desc: List all conan configuration [local+remote]
|
||||
vars:
|
||||
URL_COMPONENT: https://package-cloud.dns.army/ros2/conan2-config
|
||||
GIT_REF: main
|
||||
cmds:
|
||||
- conan config list
|
||||
- printf "Using {{.CYAN}} conan config list{{.RESET}}\n"
|
||||
- printf "{{.B_MAGENTA}}Added by configuration from remote (additional installed):{{.RESET}}\n"
|
||||
- curl {{.URL_COMPONENT}}/raw/branch/{{.GIT_REF}}/global.conf
|
||||
silent: true
|
||||
|
||||
show:readme:
|
||||
desc: Show README (RAW with just curl cmd) [remote]
|
||||
vars:
|
||||
URL_COMPONENT: https://package-cloud.dns.army/ros2/conan2-config
|
||||
GIT_REF: main
|
||||
cmds:
|
||||
- curl {{.URL_COMPONENT}}/raw/branch/{{.GIT_REF}}/README.md
|
||||
|
||||
show:readme:glow:
|
||||
desc: Show (fancy) README using glow [remote]
|
||||
vars:
|
||||
URL_COMPONENT: https://package-cloud.dns.army/ros2/conan2-config
|
||||
GIT_REF: main
|
||||
cmds:
|
||||
- mkdir -p .glow_styles
|
||||
- curl -s -o .glow_styles/dracula.json https://raw.githubusercontent.com/charmbracelet/glamour/refs/heads/master/styles/dracula.json
|
||||
- >-
|
||||
glow "{{.URL_COMPONENT}}/raw/branch/{{.GIT_REF}}/README.md"
|
||||
--tui
|
||||
--line-numbers
|
||||
--width 0
|
||||
--style .glow_styles/dracula.json
|
||||
5
global.conf
Normal file
5
global.conf
Normal file
@@ -0,0 +1,5 @@
|
||||
core.net.http:timeout=6000
|
||||
core.download:parallel={{os.cpu_count()}}
|
||||
core.upload:parallel={{os.cpu_count()}}
|
||||
tools.system.package_manager:mode=install
|
||||
tools.system.package_manager:sudo=True
|
||||
8
profiles/armv8_linux_gcc_13
Normal file
8
profiles/armv8_linux_gcc_13
Normal file
@@ -0,0 +1,8 @@
|
||||
[settings]
|
||||
arch=armv8
|
||||
build_type=Release
|
||||
compiler=gcc
|
||||
compiler.cppstd=gnu17
|
||||
compiler.libcxx=libstdc++11
|
||||
compiler.version=13
|
||||
os=Linux
|
||||
32
profiles/armv8_linux_gcc_13_croco
Normal file
32
profiles/armv8_linux_gcc_13_croco
Normal file
@@ -0,0 +1,32 @@
|
||||
include(armv8_linux_gcc_13)
|
||||
|
||||
[tool_requires]
|
||||
armv8-croco-toolchain/13.3.0
|
||||
|
||||
[buildenv]
|
||||
# Toolchain Binaries to PATH
|
||||
# You must adjust this path to where Conan unzips the toolchain.
|
||||
# Since paths in profiles are static, this is tricky.
|
||||
# BETTER: Trust the toolchain recipe to set PATH.
|
||||
# IF MANUAL TESTING:
|
||||
# PATH=/root/.conan2/p/b/armv8.../p/ros2_jazzy_toolchain/bin:$PATH
|
||||
|
||||
# Variables for Autotools
|
||||
CC=aarch64-buildroot-linux-gnu-gcc
|
||||
CXX=aarch64-buildroot-linux-gnu-g++
|
||||
LD=aarch64-buildroot-linux-gnu-ld
|
||||
AR=aarch64-buildroot-linux-gnu-ar
|
||||
RANLIB=aarch64-buildroot-linux-gnu-ranlib
|
||||
NM=aarch64-buildroot-linux-gnu-nm
|
||||
STRIP=aarch64-buildroot-linux-gnu-strip
|
||||
AS=aarch64-buildroot-linux-gnu-as
|
||||
|
||||
[conf]
|
||||
# Define Compiler Executables for CMake
|
||||
tools.build:compiler_executables={"c": "aarch64-buildroot-linux-gnu-gcc", "cpp": "aarch64-buildroot-linux-gnu-g++", "asm": "aarch64-buildroot-linux-gnu-as"}
|
||||
|
||||
# Optional: Sysroot if needed
|
||||
# tools.build:sysroot=/path/to/sysroot
|
||||
|
||||
[options]
|
||||
ros2-jazzy-python/*:cross_blob=True
|
||||
8
profiles/armv8_linux_gcc_14
Normal file
8
profiles/armv8_linux_gcc_14
Normal file
@@ -0,0 +1,8 @@
|
||||
[settings]
|
||||
arch=armv8
|
||||
build_type=Release
|
||||
compiler=gcc
|
||||
compiler.cppstd=gnu17
|
||||
compiler.libcxx=libstdc++11
|
||||
compiler.version=14
|
||||
os=Linux
|
||||
32
profiles/armv8_linux_gcc_14_croco
Normal file
32
profiles/armv8_linux_gcc_14_croco
Normal file
@@ -0,0 +1,32 @@
|
||||
include(armv8_linux_gcc_14)
|
||||
|
||||
[tool_requires]
|
||||
armv8-croco-toolchain/14.3.0
|
||||
|
||||
[buildenv]
|
||||
# Toolchain Binaries to PATH
|
||||
# You must adjust this path to where Conan unzips the toolchain.
|
||||
# Since paths in profiles are static, this is tricky.
|
||||
# BETTER: Trust the toolchain recipe to set PATH.
|
||||
# IF MANUAL TESTING:
|
||||
# PATH=/root/.conan2/p/b/armv8.../p/ros2_jazzy_toolchain/bin:$PATH
|
||||
|
||||
# Variables for Autotools
|
||||
CC=aarch64-buildroot-linux-gnu-gcc
|
||||
CXX=aarch64-buildroot-linux-gnu-g++
|
||||
LD=aarch64-buildroot-linux-gnu-ld
|
||||
AR=aarch64-buildroot-linux-gnu-ar
|
||||
RANLIB=aarch64-buildroot-linux-gnu-ranlib
|
||||
NM=aarch64-buildroot-linux-gnu-nm
|
||||
STRIP=aarch64-buildroot-linux-gnu-strip
|
||||
AS=aarch64-buildroot-linux-gnu-as
|
||||
|
||||
[conf]
|
||||
# Define Compiler Executables for CMake
|
||||
tools.build:compiler_executables={"c": "aarch64-buildroot-linux-gnu-gcc", "cpp": "aarch64-buildroot-linux-gnu-g++", "asm": "aarch64-buildroot-linux-gnu-as"}
|
||||
|
||||
# Optional: Sysroot if needed
|
||||
# tools.build:sysroot=/path/to/sysroot
|
||||
|
||||
[options]
|
||||
ros2-jazzy-python/*:cross_blob=True
|
||||
8
profiles/armv8_linux_gcc_9
Normal file
8
profiles/armv8_linux_gcc_9
Normal file
@@ -0,0 +1,8 @@
|
||||
[settings]
|
||||
arch=armv8
|
||||
build_type=Release
|
||||
compiler=gcc
|
||||
compiler.cppstd=gnu14
|
||||
compiler.libcxx=libstdc++11
|
||||
compiler.version=9
|
||||
os=Linux
|
||||
32
profiles/armv8_linux_gcc_9_croco
Normal file
32
profiles/armv8_linux_gcc_9_croco
Normal file
@@ -0,0 +1,32 @@
|
||||
include(armv8_linux_gcc_9)
|
||||
|
||||
[tool_requires]
|
||||
armv8-croco-toolchain/9.3.0
|
||||
|
||||
[buildenv]
|
||||
# Toolchain Binaries to PATH
|
||||
# You must adjust this path to where Conan unzips the toolchain.
|
||||
# Since paths in profiles are static, this is tricky.
|
||||
# BETTER: Trust the toolchain recipe to set PATH.
|
||||
# IF MANUAL TESTING:
|
||||
# PATH=/root/.conan2/p/b/armv8.../p/ros2_jazzy_toolchain/bin:$PATH
|
||||
|
||||
# Variables for Autotools
|
||||
CC=aarch64-buildroot-linux-gnu-gcc
|
||||
CXX=aarch64-buildroot-linux-gnu-g++
|
||||
LD=aarch64-buildroot-linux-gnu-ld
|
||||
AR=aarch64-buildroot-linux-gnu-ar
|
||||
RANLIB=aarch64-buildroot-linux-gnu-ranlib
|
||||
NM=aarch64-buildroot-linux-gnu-nm
|
||||
STRIP=aarch64-buildroot-linux-gnu-strip
|
||||
AS=aarch64-buildroot-linux-gnu-as
|
||||
|
||||
[conf]
|
||||
# Define Compiler Executables for CMake
|
||||
tools.build:compiler_executables={"c": "aarch64-buildroot-linux-gnu-gcc", "cpp": "aarch64-buildroot-linux-gnu-g++", "asm": "aarch64-buildroot-linux-gnu-as"}
|
||||
|
||||
# Optional: Sysroot if needed
|
||||
# tools.build:sysroot=/path/to/sysroot
|
||||
|
||||
[options]
|
||||
ros2-jazzy-python/*:cross_blob=True
|
||||
8
profiles/x64_linux_gcc_13
Normal file
8
profiles/x64_linux_gcc_13
Normal file
@@ -0,0 +1,8 @@
|
||||
[settings]
|
||||
arch=x86_64
|
||||
build_type=Release
|
||||
compiler=gcc
|
||||
compiler.cppstd=gnu17
|
||||
compiler.libcxx=libstdc++11
|
||||
compiler.version=13
|
||||
os=Linux
|
||||
8
profiles/x64_linux_gcc_14
Normal file
8
profiles/x64_linux_gcc_14
Normal file
@@ -0,0 +1,8 @@
|
||||
[settings]
|
||||
arch=x86_64
|
||||
build_type=Release
|
||||
compiler=gcc
|
||||
compiler.cppstd=gnu17
|
||||
compiler.libcxx=libstdc++11
|
||||
compiler.version=14
|
||||
os=Linux
|
||||
8
profiles/x64_linux_gcc_9
Normal file
8
profiles/x64_linux_gcc_9
Normal file
@@ -0,0 +1,8 @@
|
||||
[settings]
|
||||
arch=x86_64
|
||||
build_type=Release
|
||||
compiler=gcc
|
||||
compiler.cppstd=gnu14
|
||||
compiler.libcxx=libstdc++11
|
||||
compiler.version=9
|
||||
os=Linux
|
||||
22
remotes.json
Normal file
22
remotes.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"remotes": [
|
||||
{
|
||||
"name": "package-cloud-ros2-conan2",
|
||||
"url": "https://package-cloud.dns.army/api/packages/ros2/conan",
|
||||
"verify_ssl": true,
|
||||
"disabled": false
|
||||
},
|
||||
{
|
||||
"name": "package-cloud-ros2-dev-conan2",
|
||||
"url": "https://package-cloud.dns.army/api/packages/ros2-dev/conan",
|
||||
"verify_ssl": true,
|
||||
"disabled": true
|
||||
},
|
||||
{
|
||||
"name": "conan-center",
|
||||
"url": "https://center2.conan.io",
|
||||
"verify_ssl": true,
|
||||
"disabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user