Files
bitcoin/contrib/guix/libexec/build_macos.sh
merge-script 290cb2f17e Merge bitcoin/bitcoin#35775: scripted-diff: Use C.UTF-8 locale in Guix scripts
2cb3bfa8df scripted-diff: Use long form of shell options in Guix scripts (Hennadii Stepanov)
711eb10f08 guix: Add copyright headers to Guix scripts (Hennadii Stepanov)
80f831494e guix: Fix `glibc` version in comment (Hennadii Stepanov)
8916f7967e scripted-diff: Use C.UTF-8 locale in Guix scripts (Hennadii Stepanov)

Pull request description:

  The C.UTF-8 locale is set by default in `guix shell`, and there is no reason to avoid it nowadays. This PR also silences superfluous warnings from Qt tools, making build logs cleaner and other issues easier to spot. For example:
  ```
  Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
  Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
  If this causes problems, reconfigure your locale. See the locale(1) manual
  for more information.
  ```

  Locales in the `guix-*` launch scripts have been updated as well for consistency with the rest of the codebase.

  Additionally, the headers of the Guix scripts have been adjusted for [uniformity](https://github.com/bitcoin/bitcoin/pull/35775#discussion_r3636959268).

ACKs for top commit:
  fanquake:
    ACK 2cb3bfa8df

Tree-SHA512: 9e21d4ad50f5d583efdd8f79d9f96d45a92f1982ea3a422565bceea38aa50bbd9a9360972b37a1b49907e67523d68f3d1f889cb26179ce735453eb4fae4d3fa4
2026-07-23 14:33:55 +01:00

73 lines
2.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit.
export LC_ALL=C.UTF-8
set -o errexit -o pipefail
# shellcheck source=setup.sh
source "$(dirname "${BASH_SOURCE[0]}")/setup.sh"
# Set toolchain
CLANG_TOOLCHAIN="$(store_path clang-toolchain)"
LIBCXX="$(store_path libcxx)"
build_CC="${CLANG_TOOLCHAIN}/bin/clang \
-isystem ${CLANG_TOOLCHAIN}/include"
build_CXX="${CLANG_TOOLCHAIN}/bin/clang++ \
-stdlib=libc++ \
-isystem ${LIBCXX}/include/c++/v1 \
-isystem ${CLANG_TOOLCHAIN}/include"
build_LDFLAGS="-fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -L${LIBCXX}/lib -Wl,-rpath,${LIBCXX}/lib"
build_AR="${CLANG_TOOLCHAIN}/bin/llvm-ar"
build_RANLIB="${CLANG_TOOLCHAIN}/bin/llvm-ranlib"
build_OBJDUMP="${CLANG_TOOLCHAIN}/bin/llvm-objdump"
build_NM="${CLANG_TOOLCHAIN}/bin/llvm-nm"
build_STRIP="${CLANG_TOOLCHAIN}/bin/llvm-strip"
# Build the depends tree
make -C depends --jobs="$JOBS" HOST="$HOST" \
${V:+V=1} \
${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \
${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \
${SDK_PATH+SDK_PATH="$SDK_PATH"} \
${build_CC+build_CC="$build_CC"} \
${build_CXX+build_CXX="$build_CXX"} \
${build_LDFLAGS+build_LDFLAGS="$build_LDFLAGS"} \
${build_AR+build_AR="$build_AR"} \
${build_RANLIB+build_RANLIB="$build_RANLIB"} \
${build_OBJDUMP+build_OBJDUMP="$build_OBJDUMP"} \
${build_NM+build_NM="$build_NM"} \
${build_STRIP+build_STRIP="$build_STRIP"} \
NO_QT=1
mkdir -p "$DISTSRC"
(
cd "$DISTSRC"
# Extract the source tarball
tar --strip-components=1 -xf "${GIT_ARCHIVE}"
# Configure this DISTSRC for $HOST
env cmake -S . -B build \
--toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \
-Werror=dev \
-DBUILD_BENCH=OFF \
-DBUILD_FUZZ_BINARY=OFF \
-DBUILD_GUI=OFF \
-DBUILD_GUI_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="${INSTALLPATH}" \
-DCMAKE_SKIP_RPATH=TRUE \
-DREDUCE_EXPORTS=ON \
-DWITH_CCACHE=OFF
# Build Bitcoin Core
cmake --build build -j "$JOBS"
# Install built Bitcoin Core
cmake --install build --strip
)
rm -rf "$DISTSRC"/build
exit 0