Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@ on:

jobs:
deploy_11_3:
uses: ./.github/workflows/ci.yml
uses: ./.github/workflows/package_and_upload.yml
with:
version: "11.3"
secrets: inherit

deploy_12_2:
uses: ./.github/workflows/ci.yml
uses: ./.github/workflows/package_and_upload.yml
with:
version: "12.2"
secrets: inherit

deploy_12_3:
uses: ./.github/workflows/ci.yml
uses: ./.github/workflows/package_and_upload.yml
with:
version: "12.3"
secrets: inherit

deploy_13_2:
uses: ./.github/workflows/ci.yml
uses: ./.github/workflows/package_and_upload.yml
with:
version: "13.2"
secrets: inherit

deploy_13_3:
uses: ./.github/workflows/ci.yml
uses: ./.github/workflows/package_and_upload.yml
with:
version: "13.3"
secrets: inherit

deploy_14_2:
uses: ./.github/workflows/ci.yml
uses: ./.github/workflows/package_and_upload.yml
with:
version: "14.2"
secrets: inherit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 🚀 deploy
name: 📦 Package & Upload

on:
workflow_call:
Expand All @@ -12,9 +12,11 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15, windows-2022]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}
env:
VERBOSE: 1
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -41,23 +43,17 @@ jobs:
run: conan create prebuilt --version=${{ inputs.version }}

- name: 🏗️ Build Demos Conan Package
if: ${{ runner.os != 'Windows' }}
working-directory: prebuilt/demo
run: VERBOSE=1 conan build . -pr profile -s compiler.version="${{ inputs.version }}"

- name: 🏗️ Build Demos Conan Package
if: ${{ runner.os == 'Windows' }}
working-directory: prebuilt/demo
run: conan build . -pr profile -s compiler.version="${{ inputs.version }}"

- name: 📡 Sign into JFrog Artifactory
if: ${{ github.ref == 'refs/heads/main' && startsWith(matrix.os, 'ubuntu-') }}
if: ${{ startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu-') }}
env:
PASSWORD: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN }}
JFROG_USER: ${{ secrets.JFROG_LIBHAL_TRUNK_ID_TOKEN_USER }}
run: conan remote login -p $PASSWORD libhal-trunk $JFROG_USER

- name: 🆙 Upload `prebuilt-picolibc` to `libhal-trunk` repo
if: ${{ github.ref == 'refs/heads/main' && startsWith(matrix.os, 'ubuntu-') }}
if: ${{ startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu-') }}
run: |
conan upload "prebuilt-picolibc/*" --only-recipe --confirm -r=libhal-trunk
60 changes: 0 additions & 60 deletions flag_test_pkg/conanfile.py

This file was deleted.

32 changes: 11 additions & 21 deletions prebuilt/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conan import ConanFile
from conan.tools.files import get, copy
import os
from conan.tools.files import get
from pathlib import Path

required_conan_version = ">=2.0.6"

Expand All @@ -10,7 +10,6 @@ class PrebuiltPicolibc(ConanFile):
settings = "os", "arch", "compiler", "build_type"
package_type = "static-library"
build_policy = "missing"
short_paths = True
options = {
"crt0": [
"semihost",
Expand All @@ -25,19 +24,10 @@ class PrebuiltPicolibc(ConanFile):
def package_id(self):
self.info.clear()

def build(self):
def package(self):
get(self,
**self.conan_data["sources"][self.version],
destination=self.build_folder)

def package(self):
destination = os.path.join(self.package_folder, "")
copy(self, pattern="arm-none-eabi/*", src=self.build_folder,
dst=destination, keep_path=True)
copy(self, pattern="bin/*", src=self.build_folder,
dst=destination, keep_path=True)
copy(self, pattern="lib/*", src=self.build_folder,
dst=destination, keep_path=True)
destination=self.package_folder)

def package_info(self):
self.cpp_info.set_property("cmake_target_name", "picolibc")
Expand All @@ -49,22 +39,22 @@ def package_info(self):
self.cpp_info.libdirs = []
self.cpp_info.resdirs = []

short_to_long_version = {
SHORT_TO_LONG_VERSION = {
"11.3": "11.3.1",
"12.2": "12.2.1",
"12.3": "12.3.1",
"13.2": "13.2.1",
"13.3": "13.3.1",
"14.2": "14.2.1",
}
long_version = short_to_long_version[self.version]
specs_path = f"lib/gcc/arm-none-eabi/{long_version}/picolibcpp.specs"
prefix = os.path.join(self.package_folder, 'arm-none-eabi')
picolibcpp_specs = os.path.join(self.package_folder, specs_path)
LONG_VERSION = SHORT_TO_LONG_VERSION[self.version]
PREFIX = Path(self.package_folder) / 'arm-none-eabi'
PICOLIB_CPP_SPECS = Path(self.package_folder) / 'lib' / 'gcc' / \
'arm-none-eabi' / LONG_VERSION / 'picolibcpp.specs'

self.cpp_info.exelinkflags = [
f"-specs={picolibcpp_specs}",
f"--picolibc-prefix={prefix}",
f"-specs={PICOLIB_CPP_SPECS}",
f"--picolibc-prefix={PREFIX}",
f"-oslib={str(self.options.crt0)}",
]

Expand Down
2 changes: 0 additions & 2 deletions prebuilt/demo/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ class Demo(ConanFile):

def build_requirements(self):
self.tool_requires("cmake/3.27.1")
self.tool_requires(
f"arm-gnu-toolchain/{self.settings.compiler.version}")

def requirements(self):
self.requires(f"prebuilt-picolibc/{self.settings.compiler.version}")
Expand Down
2 changes: 2 additions & 0 deletions prebuilt/demo/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <cstdio>
#include <errno.h>
#include <sys/types.h>

int
main()
Expand Down
7 changes: 5 additions & 2 deletions prebuilt/demo/profile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[settings]
build_type=MinSizeRel
compiler=gcc
compiler.cppstd=20
compiler.cppstd=23
compiler.libcxx=libstdc++
compiler.version=12.2
compiler.version=14.2
arch=cortex-m4f
os=baremetal

[tool_requires]
arm-gnu-toolchain/14.2