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

Fix macOS compilation #16412

Merged
merged 2 commits into from Jun 14, 2021
Merged

Fix macOS compilation #16412

merged 2 commits into from Jun 14, 2021

Conversation

simon-mo
Copy link
Contributor

https://buildkite.com/ray-project/ray-builders-branch/builds/1802#d42a0e6c-ff64-4c31-acb3-320d73c66ef4/629-805

src/ray/core_worker/reference_count_test.cc:280:23: error: loop variable 'callback_it' creates a copy from type 'const std::__1::pair<const ray::ObjectID, std::__1::function<void ()>>' [-Werror,-Wrange-loop-construct]
      for (const auto callback_it : callback_map) {
                      ^
src/ray/core_worker/reference_count_test.cc:280:12: note: use reference type 'const std::__1::pair<const ray::ObjectID, std::__1::function<void ()>> &' to prevent copying
      for (const auto callback_it : callback_map) {
           ^~~~~~~~~~~~~~~~~~~~~~~~
                      &
src/ray/core_worker/reference_count_test.cc:278:21: error: loop variable 'it' creates a copy from type 'const std::__1::pair<const std::__1::basic_string<char>, std::__1::unordered_map<ray::ObjectID, std::__1::function<void ()>>>' [-Werror,-Wrange-loop-construct]
    for (const auto it : subscription_failure_callback_map) {
                    ^
src/ray/core_worker/reference_count_test.cc:278:10: note: use reference type 'const std::__1::pair<const std::__1::basic_string<char>, std::__1::unordered_map<ray::ObjectID, std::__1::function<void ()>>> &' to prevent copying
    for (const auto it : subscription_failure_callback_map) {
         ^~~~~~~~~~~~~~~
                    &

This was not detected because two commits were merged right after each
other and we don't linearize merges. So the buildkite PR was green, and
the OBOD PR was green as well.

Why are these changes needed?

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

https://buildkite.com/ray-project/ray-builders-branch/builds/1802#d42a0e6c-ff64-4c31-acb3-320d73c66ef4/629-805
```
src/ray/core_worker/reference_count_test.cc:280:23: error: loop variable 'callback_it' creates a copy from type 'const std::__1::pair<const ray::ObjectID, std::__1::function<void ()>>' [-Werror,-Wrange-loop-construct]
      for (const auto callback_it : callback_map) {
                      ^
src/ray/core_worker/reference_count_test.cc:280:12: note: use reference type 'const std::__1::pair<const ray::ObjectID, std::__1::function<void ()>> &' to prevent copying
      for (const auto callback_it : callback_map) {
           ^~~~~~~~~~~~~~~~~~~~~~~~
                      &
src/ray/core_worker/reference_count_test.cc:278:21: error: loop variable 'it' creates a copy from type 'const std::__1::pair<const std::__1::basic_string<char>, std::__1::unordered_map<ray::ObjectID, std::__1::function<void ()>>>' [-Werror,-Wrange-loop-construct]
    for (const auto it : subscription_failure_callback_map) {
                    ^
src/ray/core_worker/reference_count_test.cc:278:10: note: use reference type 'const std::__1::pair<const std::__1::basic_string<char>, std::__1::unordered_map<ray::ObjectID, std::__1::function<void ()>>> &' to prevent copying
    for (const auto it : subscription_failure_callback_map) {
         ^~~~~~~~~~~~~~~
                    &
```

This was not detected because two commits were merged right after each
other and we don't linearize merges. So the buildkite PR was green, and
the OBOD PR was green as well.
@rkooo567
Copy link
Contributor

Thanks for catching this!!

@simon-mo
Copy link
Contributor Author

I will merge once the compile finishes

@simon-mo
Copy link
Contributor Author

Compile passed

@simon-mo simon-mo merged commit 5f44951 into ray-project:master Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants