Skip to content

Commit 8a3ec33

Browse files
authored
🧑‍💻 Add single major versions of gcc (#10)
* 🧑‍💻 Add single major versions of gcc This way, a compiler setting of just 12, 13, or 14 will resolve to the latest version of picolibc for that version of GCC. * force gcc as compiler for package creation
1 parent a9addbc commit 8a3ec33

4 files changed

Lines changed: 45 additions & 15 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ jobs:
2929
version: "12.3"
3030
secrets: inherit
3131

32+
deploy_12:
33+
uses: ./.github/workflows/package_and_upload.yml
34+
with:
35+
version: "12"
36+
secrets: inherit
37+
3238
deploy_13_2:
3339
uses: ./.github/workflows/package_and_upload.yml
3440
with:
@@ -41,8 +47,20 @@ jobs:
4147
version: "13.3"
4248
secrets: inherit
4349

50+
deploy_13:
51+
uses: ./.github/workflows/package_and_upload.yml
52+
with:
53+
version: "13"
54+
secrets: inherit
55+
4456
deploy_14_2:
4557
uses: ./.github/workflows/package_and_upload.yml
4658
with:
4759
version: "14.2"
4860
secrets: inherit
61+
62+
deploy_14:
63+
uses: ./.github/workflows/package_and_upload.yml
64+
with:
65+
version: "14"
66+
secrets: inherit

.github/workflows/package_and_upload.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,16 @@ jobs:
2424
fetch-depth: 0
2525

2626
- name: 📥 Install Conan
27-
run: pipx install conan==2.16.1
27+
run: pipx install conan>=2.16.1
2828

29-
- name: 📡 Add `libhal-trunk` conan remote
30-
run: |
31-
conan remote add libhal-trunk https://libhal.jfrog.io/artifactory/api/conan/trunk-conan
32-
33-
- name: 📡 Create and setup default profile
34-
run: conan profile detect --force
35-
36-
- name: 👁️‍🗨️ Show conan profile
37-
run: conan profile show
29+
- name: 📡 Install libhal conan config2
30+
run: conan config install https://github.com/libhal/conan-config2.git
3831

39-
- name: 📡 Install libhal settings_user.yml
40-
run: conan config install -sf profiles/baremetal/v2/ https://github.com/libhal/conan-config.git
32+
- name: 📡 libhal setup
33+
run: conan hal setup
4134

4235
- name: 📦 Create Conan Package
43-
run: conan create prebuilt --version=${{ inputs.version }}
36+
run: conan create prebuilt --version=${{ inputs.version }} -s compiler=gcc -s compiler.version=${{ inputs.version }}
4437

4538
- name: 🏗️ Build Demos Conan Package
4639
working-directory: prebuilt/demo
@@ -56,4 +49,4 @@ jobs:
5649
- name: 🆙 Upload `prebuilt-picolibc` to `libhal-trunk` repo
5750
if: ${{ startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu-') }}
5851
run: |
59-
conan upload "prebuilt-picolibc/*" --only-recipe --confirm -r=libhal-trunk
52+
conan upload "prebuilt-picolibc/*" --only-recipe --confirm -r=libhal

prebuilt/conandata.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,21 @@ sources:
88
"12.3":
99
url: "https://github.com/picolibc/picolibc/releases/download/1.8.3/picolibc-1.8.3-12.3-rel1.zip"
1010
sha256: "9263e6e7317b0e205e68a88301bde2b42fb758aa50df68251c17de2c493875f6"
11+
"12":
12+
url: "https://github.com/picolibc/picolibc/releases/download/1.8.3/picolibc-1.8.3-12.3-rel1.zip"
13+
sha256: "9263e6e7317b0e205e68a88301bde2b42fb758aa50df68251c17de2c493875f6"
1114
"13.2":
1215
url: "https://github.com/picolibc/picolibc/releases/download/1.8.6/picolibc-1.8.6-13.2.Rel1.zip"
1316
sha256: "9658c58307000de6d9998b29904b1316196eadc4b31a7fe8f9bdefa0c8325bb6"
1417
"13.3":
1518
url: "https://github.com/picolibc/picolibc/releases/download/1.8.8/picolibc-1.8.8-13.3.rel1.zip"
1619
sha256: "a298cabc310e992399824ae48e275f49603ba1c5f3c040acb116e54146b70995"
20+
"13":
21+
url: "https://github.com/picolibc/picolibc/releases/download/1.8.8/picolibc-1.8.8-13.3.rel1.zip"
22+
sha256: "a298cabc310e992399824ae48e275f49603ba1c5f3c040acb116e54146b70995"
1723
"14.2":
1824
url: "https://github.com/picolibc/picolibc/releases/download/1.8.10/picolibc-1.8.10-14.2.rel1.zip"
1925
sha256: "a5d0e5be0cd5e7b0e47a229a49f58d9b258a7012c3402751711d71415a645f99"
26+
"14":
27+
url: "https://github.com/picolibc/picolibc/releases/download/1.8.10/picolibc-1.8.10-14.2.rel1.zip"
28+
sha256: "a5d0e5be0cd5e7b0e47a229a49f58d9b258a7012c3402751711d71415a645f99"

prebuilt/conanfile.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from conan import ConanFile
2+
from conan.errors import ConanInvalidConfiguration
23
from conan.tools.files import get
34
from pathlib import Path
45

56
required_conan_version = ">=2.0.6"
67

78

8-
class PrebuiltPicolibc(ConanFile):
9+
class PrebuiltGccPicolibc(ConanFile):
910
name = "prebuilt-picolibc"
1011
settings = "os", "arch", "compiler", "build_type"
1112
package_type = "static-library"
@@ -21,6 +22,11 @@ class PrebuiltPicolibc(ConanFile):
2122
"crt0": "semihost",
2223
}
2324

25+
def validate(self):
26+
if self.settings.compiler != "gcc":
27+
raise ConanInvalidConfiguration(
28+
"This package only works with GCC compiler")
29+
2430
def package_id(self):
2531
self.info.clear()
2632

@@ -43,10 +49,14 @@ def package_info(self):
4349
"11.3": "11.3.1",
4450
"12.2": "12.2.1",
4551
"12.3": "12.3.1",
52+
"12": "12.3.1",
4653
"13.2": "13.2.1",
4754
"13.3": "13.3.1",
55+
"13": "13.3.1",
4856
"14.2": "14.2.1",
57+
"14": "14.2.1",
4958
}
59+
5060
LONG_VERSION = SHORT_TO_LONG_VERSION[self.version]
5161
PREFIX = Path(self.package_folder) / 'arm-none-eabi'
5262
PICOLIB_CPP_SPECS = Path(self.package_folder) / 'lib' / 'gcc' / \

0 commit comments

Comments
 (0)