From 73c7d4d8c0da09b95df74afec71f441d2efe091b Mon Sep 17 00:00:00 2001 From: johannes-wolf Date: Fri, 15 Mar 2024 13:50:17 +0100 Subject: [PATCH] conan: Override node.js via conan profile --- .github/workflows/build-release.yml | 2 +- build-ui.bash | 10 ---------- ci/00_linux_setup.bash | 16 +++++++++++----- conan-profiles/build.profile | 7 +++++++ conan-profiles/emscripten.profile | 4 ---- 5 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 conan-profiles/build.profile diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 0458610a..4545e2c9 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -29,7 +29,7 @@ jobs: cd $(mktemp -d) git clone "https://github.com/ndsev/mapget.git" -b use-conan cd mapget - conan create . -s compiler.cppstd=20 -b missing \ + conan create . -s compiler.cppstd=20 -s build_type=Release -b missing \ -pr:b default -pr:h "$GITHUB_WORKSPACE/conan-profiles/emscripten.profile" \ -o with_httplib=False \ -o with_service=False \ diff --git a/build-ui.bash b/build-ui.bash index 7ce34f81..fbda30d2 100755 --- a/build-ui.bash +++ b/build-ui.bash @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -eu -NODE_VERSION="21" SOURCE_LOC="$1" BUILD_DIR="${SOURCE_LOC}/build" @@ -13,15 +12,6 @@ fi echo "Using source dir @ $SOURCE_LOC." cd "$SOURCE_LOC" -echo "Installing nvm" -export NVM_DIR="$(mktemp -d)" -git clone https://github.com/nvm-sh/nvm.git "${NVM_DIR}" -b v0.39.7 -. "${NVM_DIR}/nvm.sh" - -echo "Setting up Node.js ${NODE_VERSION}" -nvm install "${NODE_VERSION}" -nvm use "${NODE_VERSION}" - echo "Collecting npm modules." npm -g install --force --include=dev npm install diff --git a/ci/00_linux_setup.bash b/ci/00_linux_setup.bash index 5a218927..8b3b89de 100755 --- a/ci/00_linux_setup.bash +++ b/ci/00_linux_setup.bash @@ -1,9 +1,15 @@ #!/usr/bin/env bash set -eu -rm -rf build -mkdir -p build/deps -mkdir -p build/assets -conan install . -pr:b default -pr:h conan-profiles/emscripten.profile \ +BUILD_DIR="./build" +PROFILE_DIR="./conan-profiles" + +rm -rf "$BUILD_DIR" +mkdir -p "$BUILD_DIR/deps" +mkdir -p "$BUILD_DIR/assets" + +conan install . \ + -pr:b "$PROFILE_DIR/build.profile" \ + -pr:h "$PROFILE_DIR/emscripten.profile" \ -s build_type=Release -s compiler.cppstd=20 -b missing -b editable \ - -of build + -of "$BUILD_DIR" diff --git a/conan-profiles/build.profile b/conan-profiles/build.profile new file mode 100644 index 00000000..f2d691f0 --- /dev/null +++ b/conan-profiles/build.profile @@ -0,0 +1,7 @@ +include(default) + +[settings] +compiler.cppstd=20 + +[replace_requires] +nodejs/*: nodejs/18.15.0 diff --git a/conan-profiles/emscripten.profile b/conan-profiles/emscripten.profile index 4f958fc5..1ff3b952 100644 --- a/conan-profiles/emscripten.profile +++ b/conan-profiles/emscripten.profile @@ -5,10 +5,6 @@ compiler=clang compiler.version=15 compiler.libcxx=libc++ compiler.cppstd=20 -build_type=Release [tool_requires] emsdk/3.1.50 - -[replace_tool_requires] -nodejs/*: nodejs/16.20.2