0

In the main CMakeList.txt of Zipios I have a custom target to run some tools against my code to help cleaning it up once in a while.

Only when I do:

make -C ../BUILD zipios_code_analysis

I get this error:

svn: E155007: '/home/snapwebsites/snapcpp/contrib/zipios' is not a working copy

Which doesn't seem to make sense to me for two reasons:

  1. inspect has nothing to do with svn
  2. I'm using git and there are no references to svn in the source or binary directories

Here is the custom target:

add_custom_target(zipios_code_analysis
    # Make sure we have an output folder
    COMMAND mkdir -p ${PROJECT_BINARY_DIR}/analysis

    # Count the number of TODO, XXX, TBD, FIXME, and \todo
    COMMAND echo "TODO -- output ${PROJECT_BINARY_DIR}/analysis/todo.txt"
    COMMAND sh dev/todo.sh "${PROJECT_BINARY_DIR}/analysis"

    # Search for files with "invalid" (unwanted really) spaces
    COMMAND echo "Spaces -- output ${PROJECT_BINARY_DIR}/analysis/spaces.txt"
    COMMAND sh dev/spaces.sh "${PROJECT_BINARY_DIR}/analysis"

    # Boost inspect tool that reports various problems in the source
    COMMAND echo "inspect -- output ${PROJECT_BINARY_DIR}/analysis/inspect.html"
    COMMAND inspect -tab -crlf -end -path_name -ascii -minmax -assert_macro -deprecated_macro -unnamed -copyright >"${PROJECT_BINARY_DIR}/analysis/inspect.html"

    # All of these are expected to work on source code so make sure we are
    # in the source code top directory
    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)

When I run the command manually in my shell, I do not get that error.

Here is the build.make with the custom target. I still don't see anything having a link to svn?!

CMakeFiles/zipios_code_analysis:
    cd /home/snapwebsites/snapcpp/contrib/zipios && mkdir -p /home/snapwebsites/BUILD/contrib/zipios/analysis
    cd /home/snapwebsites/snapcpp/contrib/zipios && echo TODO\ --\ output\ /home/snapwebsites/BUILD/contrib/zipios/analysis/todo.txt
    cd /home/snapwebsites/snapcpp/contrib/zipios && sh dev/todo.sh /home/snapwebsites/BUILD/contrib/zipios/analysis
    cd /home/snapwebsites/snapcpp/contrib/zipios && echo Spaces\ --\ output\ /home/snapwebsites/BUILD/contrib/zipios/analysis/spaces.txt
    cd /home/snapwebsites/snapcpp/contrib/zipios && sh dev/spaces.sh /home/snapwebsites/BUILD/contrib/zipios/analysis
    cd /home/snapwebsites/snapcpp/contrib/zipios && echo inspect\ --\ output\ /home/snapwebsites/BUILD/contrib/zipios/analysis/inspect.html
    cd /home/snapwebsites/snapcpp/contrib/zipios && inspect -tab -crlf -end -path_name -ascii -minmax -assert_macro -deprecated_macro -unnamed -copyright >"/home/snapwebsites/BUILD/contrib/zipios/analysis/inspect.html"

Really, what could possibly add an svn command that I would get such an error?


Update

Ah. Actually, if I run the command with a redirect, I get the error:

% inspect -tab ... -copyright >a
svn: E155007: '/home/.../zipios' is not a working copy

So it does come from inspect.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156

1 Answers1

0

Okay, so somehow boost inspect wants to check something out in your svn code... I suppose boost used (and is still using?) svn. That's fine, I liked it too.

Now... why would a tool do that and not give you the option not to do that is strange. Oh well.

I found a hack I can use to fix my problem, though, here is the post with an answer to this problem:

CMake ignore return on custom target

I changed the command adding ... || true at the end:

COMMAND inspect [...snip...] -copyright >".../inspect.html" || true

That way, more or less, make ignores any error inspect is going to emit and my make returns cleanly.

Alexis Wilke
  • 19,179
  • 10
  • 84
  • 156