diff --git a/conan/lockfile/README.md b/conan/lockfile/README.md index d7ebba1b30..5e70de102d 100644 --- a/conan/lockfile/README.md +++ b/conan/lockfile/README.md @@ -9,34 +9,4 @@ need to specify it. You have to update this file every time you add a new dependency or change a revision or version of an existing dependency. -## Updating the lockfile - -To update a lockfile, run the following commands from the repository root: - -```bash -# Ensure that the xrplf remote is the first to be consulted, so any recipes we -# patched are used. We also add it there to not created huge diff when the -# official Conan Center Index is updated. -conan remote add --force --index 0 xrplf https://conan.ripplex.io - -# Remove all local packages to prevent the local cache from influencing the -# lockfile. -conan remove '*' --confirm - -# Create a new lockfile that is compatible with Linux, macOS, and Windows. The -# first create command will create a new lockfile, while the subsequent create -# commands will merge any additional dependencies into the created lockfile. -rm conan.lock -conan lock create . \ - --options '&:jemalloc=True' \ - --options '&:rocksdb=True' \ - --profile:all=conan/lockfile/linux.profile -conan lock create . \ - --options '&:jemalloc=True' \ - --options '&:rocksdb=True' \ - --profile:all=conan/lockfile/macos.profile -conan lock create . \ - --options '&:jemalloc=True' \ - --options '&:rocksdb=True' \ - --profile:all=conan/lockfile/windows.profile -``` +To update a lockfile, run from the repository root: `./conan/lockfile/regenerate.sh` diff --git a/conan/lockfile/regenerate.sh b/conan/lockfile/regenerate.sh new file mode 100755 index 0000000000..30d38dc2d7 --- /dev/null +++ b/conan/lockfile/regenerate.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +set -ex + +TEMP_DIR=$(mktemp -d) +trap "rm -rf $TEMP_DIR" EXIT + +echo "Using temporary CONAN_HOME: $TEMP_DIR" + +# We use a temporary Conan home to avoid polluting the user's existing Conan +# configuration and to not use local cache (which leads to non-reproducible lockfiles). +export CONAN_HOME="$TEMP_DIR" + +# Ensure that the xrplf remote is the first to be consulted, so any recipes we +# patched are used. We also add it there to not created huge diff when the +# official Conan Center Index is updated. +conan remote add --force --index 0 xrplf https://conan.ripplex.io + +# Delete any existing lockfile. +rm -f conan.lock + +# Create a new lockfile that is compatible with Linux, macOS, and Windows. The +# first create command will create a new lockfile, while the subsequent create +# commands will merge any additional dependencies into the created lockfile. +conan lock create . \ + --options '&:jemalloc=True' \ + --options '&:rocksdb=True' \ + --profile:all=conan/lockfile/linux.profile +conan lock create . \ + --options '&:jemalloc=True' \ + --options '&:rocksdb=True' \ + --profile:all=conan/lockfile/macos.profile +conan lock create . \ + --options '&:jemalloc=True' \ + --options '&:rocksdb=True' \ + --profile:all=conan/lockfile/windows.profile