Skip to content

Commit

Permalink
docs: fix broken links in docs/build/conan.md (XRPLF#4699)
Browse files Browse the repository at this point in the history
  • Loading branch information
thejohnfreeman authored and legleux committed Jan 27, 2024
1 parent 1676e9f commit 0a670ce
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 188 deletions.
7 changes: 0 additions & 7 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,4 @@ If you want to experiment with a new package, follow these steps:
[gcovr]: https://gcovr.com/en/stable/getting-started.html
[python-pip]: https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/
[build_type]: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
[runtime]: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
[toolchain]: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html
[pcf]: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-configuration-file
[pvf]: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-version-file
[find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
[search]: https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure
[prefix_path]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
[profile]: https://docs.conan.io/en/latest/reference/profiles.html
83 changes: 12 additions & 71 deletions Builds/containers/packaging/dpkg/build_dpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
set -ex

# make sure pkg source files are up to date with repo
cd /opt/rippled_bld/pkg
cp -fpru rippled/Builds/containers/packaging/dpkg/debian/. debian/
cp -fpu rippled/Builds/containers/shared/rippled*.service debian/
cp -fpu rippled/Builds/containers/shared/update_sources.sh .
# cd /opt/rippled_bld/pkg
cp -fpru ../Builds/containers/packaging/dpkg/debian/. debian/
cp -fpu ../Builds/containers/shared/rippled.service debian/
cp -fpu ../Builds/containers/shared/update_sources.sh .
source update_sources.sh

# Build the dpkg
Expand All @@ -15,24 +15,15 @@ RIPPLED_DPKG_VERSION=$(echo "${RIPPLED_VERSION}" | sed 's!-!~!g')
# TODO - decide how to handle the trailing/release
# version here (hardcoded to 1). Does it ever need to change?
RIPPLED_DPKG_FULL_VERSION="${RIPPLED_DPKG_VERSION}-1"
git config --global --add safe.directory /opt/rippled_bld/pkg/rippled
cd /opt/rippled_bld/pkg/rippled
if [[ -n $(git status --porcelain) ]]; then
git status
error "Unstaged changes in this repo - please commit first"
fi
git archive --format tar.gz --prefix rippled-${RIPPLED_DPKG_VERSION}/ -o ../rippled-${RIPPLED_DPKG_VERSION}.tar.gz HEAD
cd ..
# dpkg debmake would normally create this link, but we do it manually


git archive --format tar.gz --prefix rippled-${RIPPLED_DPKG_VERSION}/ -o rippled-${RIPPLED_DPKG_VERSION}.tar.gz HEAD
ln -s ./rippled-${RIPPLED_DPKG_VERSION}.tar.gz rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz
tar xvf rippled-${RIPPLED_DPKG_VERSION}.tar.gz
cd rippled-${RIPPLED_DPKG_VERSION}
cp -pr ../debian .
cp -pr ../pkgs/debian .


# dpkg requires a changelog. We don't currently maintain
# a useable one, so let's just fake it with our current version
# TODO : not sure if the "unstable" will need to change for
# release packages (?)
NOWSTR=$(TZ=UTC date -R)
cat << CHANGELOG > ./debian/changelog
rippled (${RIPPLED_DPKG_FULL_VERSION}) unstable; urgency=low
Expand All @@ -44,56 +35,6 @@ CHANGELOG

# PATH must be preserved for our more modern cmake in /opt/local
# TODO : consider allowing lintian to run in future ?
export DH_BUILD_DDEBS=1
debuild --no-lintian --preserve-envvar PATH --preserve-env -us -uc
rc=$?; if [[ $rc != 0 ]]; then
error "error building dpkg"
fi
cd ..

# copy artifacts
cp rippled-reporting_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.deb ${PKG_OUTDIR}
cp rippled_${RIPPLED_DPKG_FULL_VERSION}.dsc ${PKG_OUTDIR}
# dbgsym suffix is ddeb under newer debuild, but just deb under earlier
cp rippled-dbgsym_${RIPPLED_DPKG_FULL_VERSION}_amd64.* ${PKG_OUTDIR}
cp rippled-reporting-dbgsym_${RIPPLED_DPKG_FULL_VERSION}_amd64.* ${PKG_OUTDIR}
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.changes ${PKG_OUTDIR}
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.build ${PKG_OUTDIR}
cp rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz ${PKG_OUTDIR}
cp rippled_${RIPPLED_DPKG_FULL_VERSION}.debian.tar.xz ${PKG_OUTDIR}
# buildinfo is only generated by later version of debuild
if [ -e rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.buildinfo ] ; then
cp rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.buildinfo ${PKG_OUTDIR}
fi

pushd ${PKG_OUTDIR}
for f in *.ddeb; do mv -- "$f" "${f%.ddeb}.deb"; done
popd

cat rippled_${RIPPLED_DPKG_FULL_VERSION}_amd64.changes
# extract the text in the .changes file that appears between
# Checksums-Sha256: ...
# and
# Files: ...
awk '/Checksums-Sha256:/{hit=1;next}/Files:/{hit=0}hit' \
rippled_${RIPPLED_DPKG_VERSION}-1_amd64.changes | \
sed -E 's!^[[:space:]]+!!' > shasums
DEB_SHA256=$(cat shasums | \
grep "rippled_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
DBG_SHA256=$(cat shasums | \
grep "rippled-dbgsym_${RIPPLED_DPKG_VERSION}-1_amd64.*" | cut -d " " -f 1)
REPORTING_DBG_SHA256=$(cat shasums | \
grep "rippled-reporting-dbgsym_${RIPPLED_DPKG_VERSION}-1_amd64.*" | cut -d " " -f 1)
REPORTING_SHA256=$(cat shasums | \
grep "rippled-reporting_${RIPPLED_DPKG_VERSION}-1_amd64.deb" | cut -d " " -f 1)
SRC_SHA256=$(cat shasums | \
grep "rippled_${RIPPLED_DPKG_VERSION}.orig.tar.gz" | cut -d " " -f 1)
echo "deb_sha256=${DEB_SHA256}" >> ${PKG_OUTDIR}/build_vars
echo "dbg_sha256=${DBG_SHA256}" >> ${PKG_OUTDIR}/build_vars
echo "reporting_sha256=${REPORTING_SHA256}" >> ${PKG_OUTDIR}/build_vars
echo "reporting_dbg_sha256=${REPORTING_DBG_SHA256}" >> ${PKG_OUTDIR}/build_vars
echo "src_sha256=${SRC_SHA256}" >> ${PKG_OUTDIR}/build_vars
echo "rippled_version=${RIPPLED_VERSION}" >> ${PKG_OUTDIR}/build_vars
echo "dpkg_version=${RIPPLED_DPKG_VERSION}" >> ${PKG_OUTDIR}/build_vars
echo "dpkg_full_version=${RIPPLED_DPKG_FULL_VERSION}" >> ${PKG_OUTDIR}/build_vars
export DH_BUILD_DDEBS=0
#debuild --no-lintian --preserve-envvar PATH --preserve-env -us -uc
dpkg-buildpackage -b -uc -us
8 changes: 1 addition & 7 deletions Builds/containers/packaging/dpkg/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Source: rippled
Section: misc
Priority: extra
Maintainer: Ripple Labs Inc. <[email protected]>
Build-Depends: cmake, debhelper (>=9), zlib1g-dev, dh-systemd, ninja-build
Build-Depends: dh-systemd
Standards-Version: 3.9.7
Homepage: http://ripple.com/

Expand All @@ -11,9 +11,3 @@ Architecture: any
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: rippled daemon

Package: rippled-reporting
Architecture: any
Multi-Arch: foreign
Depends: ${misc:Depends}, ${shlibs:Depends}
Description: rippled reporting daemon
3 changes: 0 additions & 3 deletions Builds/containers/packaging/dpkg/debian/rippled-dev.install

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

33 changes: 0 additions & 33 deletions Builds/containers/packaging/dpkg/debian/rippled-reporting.postinst

This file was deleted.

1 change: 0 additions & 1 deletion Builds/containers/packaging/dpkg/debian/rippled.install
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
opt/ripple/bin/rippled
opt/ripple/bin/validator-keys
opt/ripple/bin/update-rippled.sh
opt/ripple/bin/getRippledInfo
opt/ripple/etc/rippled.cfg
Expand Down
47 changes: 6 additions & 41 deletions Builds/containers/packaging/dpkg/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -15,67 +15,32 @@ override_dh_systemd_start:
dh_systemd_start --no-restart-on-upgrade

override_dh_auto_configure:
/root/.pyenv/shims/conan export external/snappy snappy/1.1.10@
/root/.pyenv/shims/conan export external/soci soci/4.0.3@
pyenv local conan
conan export external/snappy snappy/1.1.10@
conan export external/soci soci/4.0.3@

mkdir build.rippled

cd build.rippled && \
/root/.pyenv/shims/conan install .. \
--profile gcc \
conan install .. \
--profile gcc-rel \
--output-folder . \
--build missing \
--settings build_type=Release

cd build.rippled && \
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-Dvalidator_keys=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake

mkdir build.rippled-reporting

cd build.rippled-reporting && \
/root/.pyenv/shims/conan install .. \
--profile gcc \
--output-folder . \
--settings compiler.cppstd=17 \
--settings build_type=Release \
--build missing \
--build boost \
--build sqlite3 \
--build libuv \
--options reporting=True

cd build.rippled-reporting && \
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-Dvalidator_keys=ON \
-Dstatic=ON \
-Dunity=OFF \
-Dreporting=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake

override_dh_auto_build:
cmake --build build.rippled --target rippled --target validator-keys --parallel 8
cmake --build build.rippled-reporting --target rippled --parallel 8
cmake --build build.rippled --target rippled --parallel 22

override_dh_auto_install:
cmake --install build.rippled --prefix debian/tmp/opt/ripple
install -D build.rippled/validator-keys/validator-keys debian/tmp/opt/ripple/bin/validator-keys
install -D Builds/containers/shared/update-rippled.sh debian/tmp/opt/ripple/bin/update-rippled.sh
install -D bin/getRippledInfo debian/tmp/opt/ripple/bin/getRippledInfo
install -D Builds/containers/shared/update-rippled-cron debian/tmp/opt/ripple/etc/update-rippled-cron
install -D Builds/containers/shared/rippled-logrotate debian/tmp/etc/logrotate.d/rippled
rm -rf debian/tmp/opt/ripple/lib64/cmake/date

mkdir -p debian/tmp/opt/rippled-reporting/etc
mkdir -p debian/tmp/opt/rippled-reporting/bin
cp cfg/validators-example.txt debian/tmp/opt/rippled-reporting/etc/validators.txt

sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/update-rippled.sh > debian/tmp/opt/rippled-reporting/bin/update-rippled-reporting.sh
sed -E 's/rippled?/rippled-reporting/g' bin/getRippledInfo > debian/tmp/opt/rippled-reporting/bin/getRippledReportingInfo
sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/update-rippled-cron > debian/tmp/opt/rippled-reporting/etc/update-rippled-reporting-cron
sed -E 's/rippled?/rippled-reporting/g' Builds/containers/shared/rippled-logrotate > debian/tmp/etc/logrotate.d/rippled-reporting
12 changes: 2 additions & 10 deletions Builds/containers/shared/update_sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@ function error {
exit 1
}

cd /opt/rippled_bld/pkg/rippled
cd ..
export RIPPLED_VERSION=$(egrep -i -o "\b(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9a-z\-]+(\.[0-9a-z\-]+)*)?(\+[0-9a-z\-]+(\.[0-9a-z\-]+)*)?\b" src/ripple/protocol/impl/BuildInfo.cpp)

: ${PKG_OUTDIR:=/opt/rippled_bld/pkg/out}
: ${PKG_OUTDIR:=pkgs}
export PKG_OUTDIR
if [ ! -d ${PKG_OUTDIR} ]; then
error "${PKG_OUTDIR} is not mounted"
fi

if [ -x ${OPENSSL_ROOT}/bin/openssl ]; then
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${OPENSSL_ROOT}/lib ${OPENSSL_ROOT}/bin/openssl version -a
fi

12 changes: 11 additions & 1 deletion docs/build/conan.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ For options, each package recipe defines its own defaults.
You can pass every parameter to Conan on the command line,
but it is more convenient to put them in a configuration file, once, that
Conan can read every time it is configured.
For Conan, that file is a [profile][profile].
For Conan, that file is a [profile][].
**All we must do to properly configure Conan is edit and pass the profile.**
By default, Conan will use the profile named "default".

[build_type]: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
[find_package]: https://cmake.org/cmake/help/latest/command/find_package.html
[pcf]: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-configuration-file
[prefix_path]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
[profile]: https://docs.conan.io/en/latest/reference/profiles.html
[pvf]: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-version-file
[runtime]: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
[search]: https://cmake.org/cmake/help/latest/command/find_package.html#search-procedure
[toolchain]: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html

0 comments on commit 0a670ce

Please sign in to comment.