Exercise CLI won't run test on Mac OS error: make: *** No targets specified and no makefile found

I’m trying to run the exercism t on Mac OS M1 Pro

Here is the details from my exercism troubleshoot call

Troubleshooting Information
===========================

Version
----------------
Current: 3.5.4
Latest:  3.5.4


Operating System
----------------
OS:           darwin
Architecture: amd64


Configuration
----------------
Home:      /Users/my_user
Workspace: /Users/my_user/Source/exercism
Config:    /Users/my_user/.config/exercism
API key:   6415*****************************551

API Reachability
----------------

GitHub:
    * https://api.github.com
    * [connected]
    * 206.684209ms

Exercism:
    * https://api.exercism.org/v1/ping
    * [connected]
    * 631.14275ms


If you are having trouble, please create a new topic in the Exercism forum
at https://forum.exercism.org/c/support/cli/10 and include
this information.

This is what I get when I call the test

exercism t
Running tests via `make`

make: *** No targets specified and no makefile found.  Stop.

I have tried calling cmake -G Xcode, cmake -G Xcode . and mkdir build && cd build && cmake -G Xcode .. before I run the test and still I get the same error.

I tried working with members of the discord to resolve, but so far have been unable to resolve

Testing on my own system (MacBook Air M2, Sequoia 15.0), it seems that exercism t (exercism test) is not compatible with the C++ track. Recommend trying mkdir -p build && cd build && cmake -G Xcode .. && make from the exercise base directory

2 Likes

I had confirmed synchronously as well, with the same findings in a call with @CallingCaring .

1 Like

Thanks for this, Thought I tried and the results are as follows

mkdir -p build && cd build && cmake -G Xcode .. && make
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/my_user/Source/exercism/cpp/lasagna
make: *** No targets specified and no makefile found.  Stop.

So I’m still not sure what I’m doing wrong

I was able to solve this and get it running with the exercism cli. Here are the steps that I took.

Using the example that @neenjaw provided in the Discord thread which was

cmake -G "Unix Makefiles" ..

I was able to build and run the application. because the exercise cli required the JSON in the root directory it is unable to be run in either the build directory or see the actual build in the build directory. SO instead I used the following in the root directory

 cmake -G "Unix Makefiles" .
CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (1.0s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/my_user/Source/exercism/cpp/lasagna

Then after this is done I can either run make or even better, I can run exercise t or exercise test and get the result below

exercism t
Running tests via `make`

[ 33%] Building CXX object CMakeFiles/lasagna.dir/lasagna_test.cpp.o
[ 66%] Linking CXX executable lasagna
[100%] Built target lasagna
===============================================================================
All tests passed (1 assertion in 1 test case)

[100%] Built target test_lasagna

It sounds like when running the Xcode project you’re unable to use the make command on the resulting project. However, when using the unix Makefiles it works.

I can even run the app directly

 ./lasagna
===============================================================================
All tests passed (1 assertion in 1 test case)

It would be great if we could add something about this into the C++ documentation and instructions for the CLI or I don’t know if it is possible make a change to the exercism CLI such that it is able to process Xcode files instead This is way above my skill level though

Happy to write up some new instructions if it would help future C++ Mac OS users get setup and running

:+1: :hand_with_index_finger_and_thumb_crossed:

4 Likes

cpp/docs/INSTALLATION.md at main · exercism/cpp · GitHub and cpp/docs/TESTS.md at main · exercism/cpp · GitHub would be the two files to open a PR against to help others facing this situation in the future. I would be happy to lend my voice/review to an update to these documents

2 Likes

Hey @neenjaw,

I have submitted this PR (It was closed because of the automation). Should I still open a new thread as suggested in the PR or will this thread suffice as a place to discuss the PR?

Thank’s :+1:

1 Like

This thread is sufficient ;) There is no need for a new thread. I re-opened the PR for review by C++ people.

1 Like

Thanks much, I have reviewed and merged

1 Like