diff --git a/.github/actions/dependencies/action.yml b/.github/actions/dependencies/action.yml index c5c6a59ab9..7ece9710a8 100644 --- a/.github/actions/dependencies/action.yml +++ b/.github/actions/dependencies/action.yml @@ -43,7 +43,7 @@ runs: cd ${build_dir} conan install \ --output-folder . \ - --build '*' \ + --build missing \ --options:host "&:tests=True" \ --options:host "&:xrpld=True" \ --settings:all build_type=${{ inputs.configuration }} \ diff --git a/docs/build/environment.md b/docs/build/environment.md index 760be144d8..40a80d4b25 100644 --- a/docs/build/environment.md +++ b/docs/build/environment.md @@ -53,6 +53,34 @@ minimum required (see [BUILD.md][]). clang --version ``` +### Install Xcode Specific Version (Optional) + +If you develop other applications using XCode you might be consistently updating to the newest version of Apple Clang. +This will likely cause issues building rippled. You may want to install a specific version of Xcode: + +1. **Download Xcode** + + - Visit [Apple Developer Downloads](https://developer.apple.com/download/more/) + - Sign in with your Apple Developer account + - Search for an Xcode version that includes **Apple Clang (Expected Version)** + - Download the `.xip` file + +2. **Install and Configure Xcode** + + ```bash + # Extract the .xip file and rename for version management + # Example: Xcode_16.2.app + + # Move to Applications directory + sudo mv Xcode_16.2.app /Applications/ + + # Set as default toolchain (persistent) + sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer + + # Set as environment variable (temporary) + export DEVELOPER_DIR=/Applications/Xcode_16.2.app/Contents/Developer + ``` + The command line developer tools should include Git too: ``` diff --git a/src/xrpld/overlay/detail/OverlayImpl.cpp b/src/xrpld/overlay/detail/OverlayImpl.cpp index 79dba77ee7..646d3edc2d 100644 --- a/src/xrpld/overlay/detail/OverlayImpl.cpp +++ b/src/xrpld/overlay/detail/OverlayImpl.cpp @@ -1443,9 +1443,10 @@ OverlayImpl::updateSlotAndSquelch( if (!strand_.running_in_this_thread()) return post( strand_, + // Must capture copies of reference parameters (i.e. key, validator) [this, - key, - validator, + key = key, + validator = validator, peers = std::move(peers), isTrusted]() mutable { updateSlotAndSquelch( @@ -1472,9 +1473,12 @@ OverlayImpl::updateSlotAndSquelch( return; if (!strand_.running_in_this_thread()) - return post(strand_, [this, key, validator, peer, isTrusted]() { - updateSlotAndSquelch(key, validator, peer, isTrusted); - }); + return post( + strand_, + // Must capture copies of reference parameters (i.e. key, validator) + [this, key = key, validator = validator, peer, isTrusted]() { + updateSlotAndSquelch(key, validator, peer, isTrusted); + }); slots_.updateSlotAndSquelch( key, diff --git a/src/xrpld/overlay/detail/Slot.cpp b/src/xrpld/overlay/detail/Slot.cpp index e6878cf594..2f1b523a79 100644 --- a/src/xrpld/overlay/detail/Slot.cpp +++ b/src/xrpld/overlay/detail/Slot.cpp @@ -35,6 +35,7 @@ #include #include #include +#include namespace ripple { namespace reduce_relay { @@ -233,6 +234,7 @@ Slot::deletePeer(PublicKey const& validator, Peer::id_t id, bool erase) if (it == peers_.end()) return; + std::vector toUnsquelch; auto const now = clock_.now(); if (it->second.state == PeerState::Selected) { @@ -246,7 +248,7 @@ Slot::deletePeer(PublicKey const& validator, Peer::id_t id, bool erase) for (auto& [k, v] : peers_) { if (v.state == PeerState::Squelched) - handler_.unsquelch(validator, k); + toUnsquelch.push_back(k); v.state = PeerState::Counting; v.count = 0; v.expire = now; @@ -256,7 +258,7 @@ Slot::deletePeer(PublicKey const& validator, Peer::id_t id, bool erase) reachedThreshold_ = 0; state_ = SlotState::Counting; } - else if (considered_.find(id) != considered_.end()) + else if (considered_.contains(id)) { if (it->second.count > reduce_relay::MAX_MESSAGE_THRESHOLD) --reachedThreshold_; @@ -268,6 +270,10 @@ Slot::deletePeer(PublicKey const& validator, Peer::id_t id, bool erase) if (erase) peers_.erase(it); + + // Must be after peers_.erase(it) + for (auto const& k : toUnsquelch) + handler_.unsquelch(validator, k); } void