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 VERSION file collision on MacOS #92

Merged
merged 7 commits into from
Jul 19, 2024

Conversation

dcbaker
Copy link
Collaborator

@dcbaker dcbaker commented Jul 19, 2024

Meson implicitly includes the source and build directory for a target. In the case cps-config and some of the tests, that's the root build directory. The stdlib provided by Apple looks for a file called VERSION. When these two things are combined, the build fails. We don't actually need this behavior from Meson, so we can disable it and leave the name of the file as VERSION.

dcbaker added 4 commits July 19, 2024 09:19
Meson will implicitly include the directory that a target is being built
into. This is often useful, but on occasion it causes problems. In this
case the Apple libc looks for a VERSION file, which is then found in the
source root.
@dcbaker dcbaker requested a review from bretbrownjr July 19, 2024 16:29
@dcbaker
Copy link
Collaborator Author

dcbaker commented Jul 19, 2024

@ckyang0225, does this work for you? (I really need to get a mac)

Since this better reflects what's in this file
Copy link
Contributor

@ckyang0225 ckyang0225 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works for me, thanks for the fix! @dcbaker

cyang571@QXMYQYF49K cps-config % ninja -C builddir test

ninja: Entering directory `builddir'
[6/16] Compiling C++ object loader_test.p/tests_loader.cpp.o
In file included from ../tests/loader.cpp:7:
/opt/homebrew/Cellar/googletest/1.14.0/include/gtest/gtest.h:1379:11: warning: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
/opt/homebrew/Cellar/googletest/1.14.0/include/gtest/gtest.h:1398:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
../tests/loader.cpp:239:13: note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<unsigned long, int, nullptr>' requested here
            ASSERT_EQ(package->components.size(), 7) << "should have found 7 different components";
            ^
/opt/homebrew/Cellar/googletest/1.14.0/include/gtest/gtest.h:1898:31: note: expanded from macro 'ASSERT_EQ'
#define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
                              ^
/opt/homebrew/Cellar/googletest/1.14.0/include/gtest/gtest.h:1882:54: note: expanded from macro 'GTEST_ASSERT_EQ'
  ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
                                                     ^
1 warning generated.
[15/16] Running all tests.
1/5 loader                          OK              0.19s
2/5 version                         OK              0.34s
3/5 utils                           OK              0.49s
4/5 pkg-config compatibility        OK              0.70s   9 subtests passed
5/5 cps integration tests           OK              0.71s   20 subtests passed

Ok:                 5
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0

@dcbaker dcbaker force-pushed the submit/meson-fix-version-file-include branch from 9a27ef2 to 8bbd2a4 Compare July 19, 2024 16:41
dcbaker added 2 commits July 19, 2024 09:42
Since we've had at least one regression already that would have been
caught by CI, we should have at least some testing on MacOS
@dcbaker dcbaker force-pushed the submit/meson-fix-version-file-include branch from 8bbd2a4 to fc45509 Compare July 19, 2024 16:42
@dcbaker
Copy link
Collaborator Author

dcbaker commented Jul 19, 2024

Since this regressed macOS, I've added a small macOS CI to this PR.

@dcbaker dcbaker merged commit 0d2f37c into cps-org:main Jul 19, 2024
9 checks passed
@dcbaker dcbaker deleted the submit/meson-fix-version-file-include branch July 19, 2024 18:00
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.

2 participants