Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on mac produces a broken binary (Version: v20.0.0-rc.2.2) #4013

Closed
leighmcculloch opened this issue Nov 6, 2023 · 3 comments · Fixed by #4014
Closed

Compiling on mac produces a broken binary (Version: v20.0.0-rc.2.2) #4013

leighmcculloch opened this issue Nov 6, 2023 · 3 comments · Fixed by #4014
Labels

Comments

@leighmcculloch
Copy link
Member

leighmcculloch commented Nov 6, 2023

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 instructions.
  • Run the compiled stellar-core binary.

Expected Result

Success and 🌈 .

Actual Result

$ stellar-core version
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

Your Environment and Setup

stellar-core Version

It's not possible to run this command because it errors per above.

Environment

  • Operation System & Version (You can usually obtain from uname -a): mac
  • Are you running from the command line? From a container? command line
  • Did you pass in special parameters when building the app?: no
  • Please add any additional relevant configuration related to thisbug report.ok`

Supporting Files

None.

Additional context

When manually running one of the build steps and viewing its output, it appears that one of the scripts assumes a dependence on a specific tool, sha256sum, which is found on Linux, but not macOS:

$ ./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
{"", ""}};
}

This issue was discussed on Discord:

@leighmcculloch
Copy link
Member Author

I'm working on a code fix or documentation fix.

@leighmcculloch
Copy link
Member Author

Actually, it looks like the INSTALL.md instructions are correct. They instruct the installer to install the coreutils Homebrew package as a dependency which contains sha256sum. It looks like I missed installing this dependency, and so the situation is a user error.

However, we shouldn't have any scripts that are part of the build process that silently ignore errors. So I'd like to keep this open and address that issue.

@leighmcculloch
Copy link
Member Author

leighmcculloch commented Nov 6, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant