#Compiling stellar-core v20.0.0-rc.2.2 results in mismatch XDR

34 messages · Page 1 of 1 (latest)

next wedge
#

I'm building v20.0.0-rc.2.2 8344f3369493bd4c89796dbb9f0f7aabade7e951 using the following Homebrew formula, and I'm seeing the following error:

stellar-core@20.rb:

class StellarCoreAT20 < Formula
  desc "Backbone of the Stellar (XLM) network"
  homepage "https://www.stellar.org/"
  url "https://github.com/stellar/stellar-core.git",
      tag:      "v20.0.0-rc.2.2",
      revision: "8344f3369493bd4c89796dbb9f0f7aabade7e951"
  license "Apache-2.0"

  depends_on "autoconf" => :build
  depends_on "automake" => :build
  depends_on "bison" => :build # Bison 3.0.4+
  depends_on "libtool" => :build
  depends_on "pandoc" => :build
  depends_on "pkg-config" => :build
  depends_on "libpq"
  depends_on "libpqxx"
  depends_on "libsodium"
  depends_on macos: :catalina # Requires C++17 filesystem
  depends_on "rust"
  uses_from_macos "flex" => :build

  on_linux do
    depends_on "libunwind"
  end

  # https://github.com/stellar/stellar-core/blob/master/INSTALL.md#build-dependencies
  fails_with :gcc do
    version "7"
    cause "Requires C++17 filesystem"
  end

  def install
    system "./autogen.sh"
    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}",
                          "--enable-postgres"
    system "make", "install"
  end
end

Compiles and installs fine with:

$ brew install --formula stellar-core@20.rb

Compiles and installs fine, but then when executed errors:

$ stellar-core verison
Warning: soroban-env-host-curr is running a pre-release version 20.0.0-rc1
current exception: std::runtime_error("Number of xdr hashes don't match between C++ and Rust. C++ size = 1 and Rust size = 12.")
backtrace unavailable
[1]    1343 abort      stellar-core verison
#

Compiling stellar-core v20.0.0-rc.2.2 results in mismatch XDR

whole wave
#

that's weird; do you have all the XDRs checked out properly? I'm not sure how can you end up with just 1 XDR hash...

next wedge
#

In the build log I see these lines, which are outputted when the git submodules are initialized:

==> Checking out tag v20.0.0-rc.2.2
HEAD is now at 8344f3369 Add option to take XDR input as base64
HEAD is now at 8344f3369 Add option to take XDR input as base64
Entering 'lib/asio'
Entering 'lib/cereal'
Entering 'lib/fmt'
Entering 'lib/libmedida'
Entering 'lib/libsodium'
Entering 'lib/spdlog'
Entering 'lib/tracy'
Entering 'lib/xdrpp'
Entering 'src/protocol-curr/xdr'
Entering 'src/protocol-next/xdr'
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/lib/asio
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/lib/cereal
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/lib/fmt
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/lib/libmedida
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/lib/libsodium
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/lib/spdlog
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/lib/tracy
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/lib/xdrpp
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/src/protocol-curr/xdr
/Users/leighmcculloch/Library/Caches/Homebrew/stellar-core@20--git/src/protocol-next/xdr
whole wave
#

search for XDRFilesSha256.cpp

#

it should be generated somewhere during the build. I wonder what the contents are

#

I suspect it's just {"", ""}

#

and if it is just that, then you can try running hash-xdrs.sh from stellar-core root to see what it does

next wedge
#

What runs the hash-xdrs.sh file?

whole wave
#

make

next wedge
#

The files are all present in the src directory for compilation:

$ ls -1 src/protocol-curr/xdr
LICENSE
README.md
Stellar-SCP.x
Stellar-contract-config-setting.x
Stellar-contract-env-meta.x
Stellar-contract-meta.x
Stellar-contract-spec.x
Stellar-contract.x
Stellar-internal.x
Stellar-ledger-entries.x
Stellar-ledger.x
Stellar-overlay.x
Stellar-transaction.x
Stellar-types.x
whole wave
#

right, but what about the hash-xdrs output?

next wedge
#

Hmm, I try running it, but not sure what is going wrong:

$ ./hash-xdrs.sh src/protocol-curr/xdr
usage: ./hash-xdrs.sh XDR_PROTOCOL_DIR
$ echo $?
1
whole wave
#

remove /xdr

#
main/XDRFilesSha256.cpp: $(SRC_X_FILES) Makefile $(top_srcdir)/hash-xdrs.sh
    $(top_srcdir)/hash-xdrs.sh protocol-curr >$@
#

that's what make does

next wedge
#

I think I know what the problem is.

#

One sec...

#

Nope. That wasn't it.

#

I noticed that the homebrew formula called make install without first calling make. But when I added a make call first it made no difference.

#
$ ./hash-xdrs.sh src/protocol-curr
// DO NOT EDIT: this file is automatically generated from ./hash-xdrs.sh
#include <string>
#include <vector>
#include <filesystem>
namespace stellar {
extern const std::vector<std::pair<std::filesystem::path, std::string>> XDR_FILES_SHA256 = {
./hash-xdrs.sh: line 25: sha256sum: command not found
{"", ""}};
}```
whole wave
#

does the manual call do the right thing?

#

oh

next wedge
#

Looks like the script assumes Linux 😕

whole wave
#

for sure it does 🙂

next wedge
#

What's worse though is that should cause an error, not a silent failure.

#

I'll open an isue.

#

I can open a fix too.

whole wave
#

yeah, that's the most annoying bit

next wedge
#

Thanks for help debugging.

whole wave
#

that would be great, thanks.

jade depot
#

xdrgen problem?

whole wave
#

no, just a tool missing on mac

next wedge
#
GitHub

Issue Description Compiling recent versions of stellar-core on macOS following the instructions produces a binary that is not usable. Steps to Reproduce Be on a mac. Follow the INSTALL.md instructi...

GitHub

What
In hash-xdr.h explicitly use bash and fail early on fail or pipefail at any command in the script.
Why
Without enabling errexit or pipefail the script will continue to run as if nothing if an ...