Skip to content

Commit 5021f0b

Browse files
committed
[fix] kagome-crates in CI build
[added] Rust toolchain settings [fix] init.sh and portfile
1 parent 898a5a3 commit 5021f0b

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

.ci/scripts/init.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ main() {
1313
linux_deb)
1414
echo "=== Detected Linux system with apt"
1515
apt update && apt install -y $LINUX_PACKAGES
16+
if [ -f "$HOME/.cargo/env" ]; then
17+
source "$HOME/.cargo/env"
18+
fi
19+
export PATH="$HOME/.cargo/bin:$PATH"
1620
;;
1721
linux_other)
1822
echo "=== Detected Linux system without apt"
@@ -31,6 +35,12 @@ main() {
3135
echo "=== Unknown system"
3236
;;
3337
esac
38+
39+
if command -v cargo >/dev/null 2>&1; then
40+
echo "=== Cargo is available: $(cargo --version)"
41+
else
42+
echo "=== Warning: Cargo is not available in PATH"
43+
fi
3444
}
3545

3646
main

.github/workflows/build_and_test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ on:
1919
env:
2020
USE_CACHE: ${{ github.event.inputs.use_cache || 'true' }}
2121
CACHE_VERSION: v01
22+
CARGO_HOME: ~/.cargo
23+
RUSTUP_HOME: ~/.rustup
2224
CACHE_PATH: |
2325
~/.cargo
2426
~/.hunter
@@ -43,6 +45,11 @@ jobs:
4345
submodules: true
4446
fetch-depth: 0
4547

48+
- name: "Set up Rust"
49+
uses: dtolnay/rust-toolchain@stable
50+
with:
51+
toolchain: stable
52+
4653
- name: "Restore cache dependencies"
4754
id: cache-restore
4855
if: ${{ env.USE_CACHE == 'true' }}
@@ -62,6 +69,7 @@ jobs:
6269
else
6370
./.ci/scripts/init.sh
6471
fi
72+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
6573
6674
- name: "Init all dependencies"
6775
run: |

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ project(cpp-jam
2121
LANGUAGES CXX
2222
)
2323

24+
include(GNUInstallDirs)
25+
2426
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
2527
message(STATUS "Boost_DIR: ${Boost_DIR}")
2628

@@ -32,6 +34,7 @@ pkg_check_modules(libb2 REQUIRED IMPORTED_TARGET GLOBAL libb2)
3234
find_package(Boost CONFIG REQUIRED COMPONENTS algorithm outcome program_options)
3335
find_package(fmt CONFIG REQUIRED)
3436
find_package(yaml-cpp CONFIG REQUIRED)
37+
find_package(kagome-crates CONFIG REQUIRED)
3538
find_package(jam_crust CONFIG REQUIRED)
3639
find_package(scale CONFIG REQUIRED)
3740
find_package(soralog CONFIG REQUIRED)

src/app/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ set(BUILD_VERSION_CPP "${CMAKE_BINARY_DIR}/generated/app/build_version.cpp")
88
set(GET_VERSION_SCRIPT "${CMAKE_SOURCE_DIR}/scripts/get_version.sh")
99
add_custom_command(
1010
OUTPUT ${BUILD_VERSION_CPP}
11-
COMMAND echo "// Auto-generated file\\n" > ${BUILD_VERSION_CPP}
12-
COMMAND echo "#include <string>\\n" >> ${BUILD_VERSION_CPP}
11+
COMMAND echo "// Auto-generated file" > ${BUILD_VERSION_CPP}
12+
COMMAND echo "#include <string>" >> ${BUILD_VERSION_CPP}
1313
COMMAND echo "namespace jam {" >> ${BUILD_VERSION_CPP}
1414
COMMAND echo " const std::string &buildVersion() {" >> ${BUILD_VERSION_CPP}
1515
COMMAND printf " static const std::string buildVersion(\"" >> ${BUILD_VERSION_CPP}

vcpkg-overlay/kagome-crates/portfile.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ vcpkg_from_github(
55
REF 9011440d56d51bb33e7c4c6a47e85314178ce87f
66
SHA512 f0b1b0e1ed6e20d149d5639e14c231a46f3cdaaa6bfa320bfd64e88c4ed0496fa4246c3135e0032647c05c2aaac02804b565fbeae34b1625771114c8b263920d
77
)
8-
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
8+
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}"
9+
OPTIONS
10+
-DQDRVM_BIND_CRATES=schnorrkel;bandersnatch_vrfs
11+
)
912
vcpkg_cmake_install()
1013
vcpkg_cmake_config_fixup(PACKAGE_NAME "kagome-crates")
1114
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

0 commit comments

Comments
 (0)