cmake/install question

Hi Jon,

another question about the cmake install: when I change one of the
broctl Python scripts, the change doesn't seem to get copied over
into the build directory (and therefore then also not installed on
"make install"):

    > dir aux/broctl/BroControl/options.py
    -rw-r--r-- 1 robin robin 12940 Jan 25 15:14 aux/broctl/BroControl/options.py
    > dir ./build/aux/broctl/BroControl/options.py
    -rw-r--r-- 1 robin robin 12842 Jan 10 16:01 ./build/aux/broctl/BroControl/options.py
    > make
    ( cd build && make )
    [ 1%] Built target binpac_lib
    [ 14%] Built target binpac
    [ 16%] Built target bifcl
    [ 81%] Built target bro
    [ 82%] Built target _SubnetTree
    [ 82%] Built target capstats
    [ 83%] Built target adtrace
    [ 83%] Built target bdcat
    [ 84%] Built target cf
    [ 86%] Built target hf
    [ 87%] Built target nf
    [ 88%] Built target pf
    [ 88%] Built target ftwire2bro
    [ 88%] Built target nfcollector
    [ 89%] Built target rst
    [ 98%] Built target broccoli
    [ 98%] Built target broconftest
    [ 98%] Built target broconn
    [ 99%] Built target broenum
    [ 99%] Built target brohose
    [ 99%] Built target broping
    [100%] Built target brotable
    [100%] Built target _broccoli_intern
    > dir ./build/aux/broctl/BroControl/options.py
    -rw-r--r-- 1 robin robin 12842 Jan 10 16:01 ./build/aux/broctl/BroControl/options.py

Any idea?

Robin

when I change one of the broctl Python scripts, the change doesn't seem to get copied over into the build directory

Hmm. I thought I remember streamlining it so that the BroControl scripts don't get copied into the build directory anymore, they're installed straight from the source dir.

I think what you're seeing in the build dir is just leftovers from before this change happened and it's just a red herring.

(and therefore then also not installed on "make install"):

I don't see the same behavior with a fresh clone. After `make install`:

$ ls -l ./build/aux/broctl/BroControl/
ls: ./build/aux/broctl/BroControl/: No such file or directory

$ tail -n2 /usr/local/bro/lib/broctl/BroControl/options.py

    printOptions(Option.AUTOMATIC)

$ echo "# some modification" >> aux/broctl/BroControl/options.py

$ make install
...

$ tail -n2 /usr/local/bro/lib/broctl/BroControl/options.py
    printOptions(Option.AUTOMATIC)
# some modification

Maybe you weren't looking in the right install prefix for the change?

I don't think it's possible for it to accidentally be picking up those old files in build directory, but you might try deleting them to see if that changes the behavior.

- Jon

I think what you're seeing in the build dir is just leftovers from
before this change happened and it's just a red herring.

That may be, I didn't clean up after pulling in the recent changes.
However, now that I did, I'm running into different problems with my
multi-user setup:

Compiling as user robin:

    [in ~robin/bro/master/]
    > rm -rf build
    > ./configure --prefix=/home/bro/ --enable-cluster
    > (cd build && make -j 8)

Installing as user bro:

    [in ~bro/]
    > ( cd ~robin/bro/master && make install )
    ( cd build && make install )
    CMake Error: Could not open file for write in copy operation /home/robin/bro/master/build/cmake_uninstall.cmake.tmp
    CMake Error: : System Error: Permission denied
    CMake Error at CMakeLists.txt:18 (configure_file):
    configure_file Problem configuring file

    CMake Error: Could not open file for write in copy operation /home/robin/bro/master/build/bro-path-dev.tmp
    CMake Error: : System Error: Permission denied
    CMake Error at CMakeLists.txt:39 (configure_file):
    configure_file Problem configuring file

    [...]

That looks like it's now trying again to write into the build
directory on "make install"?

This is cmake 2.8.2 if that matters.

Maybe you weren't looking in the right install prefix for the change?

I had tried deleting the installed version of the file, and it got
reinstalled but with the old version, that's why though it must have
been coming out of the build directory.

Robin

I'm running into different problems with my multi-user setup:

Compiling as user robin:

[in ~robin/bro/master/]
> rm -rf build
> ./configure --prefix=/home/bro/ --enable-cluster
> (cd build && make -j 8)

Installing as user bro:

[in ~bro/]
> ( cd ~robin/bro/master && make install )
( cd build && make install )
CMake Error: Could not open file for write in copy operation
/home/robin/bro/master/build/cmake_uninstall.cmake.tmp
CMake Error: : System Error: Permission denied
CMake Error at CMakeLists.txt:18 (configure_file):
configure_file Problem configuring file

CMake Error: Could not open file for write in copy operation
/home/robin/bro/master/build/bro-path-dev.tmp
CMake Error: : System Error: Permission denied
CMake Error at CMakeLists.txt:39 (configure_file):
configure_file Problem configuring file

[...]

That looks like it's now trying again to write into the build
directory on "make install"?

Yeah, but AFAIK the stuff it's trying to write doesn't normally happen on every `make install`, it only happens when part of the CMake framework changes and it determines that it has to "reconfigure" and produce a new cache. You should be able to look further down in the output that got clipped out of your last email and see the "build summary" outputs? That should be a signal that this is what's occurring.

Did something happen between the `make` as user robin and the `make install` as user bro?

I can make the same thing happen if I just stick a `touch CMakeLists.txt` in between those two steps.

This is cmake 2.8.2 if that matters.

I was able to produce the same behavior w/ 2.8.3 as explained above.

No, nothing, but I've figured it out: NFS was involved, the build
was on a different machine than the install. Guess I just need to
remember to not do that. Now doing all on the same machine.

But, sorry!, it still doesn't work. I reverted to a clean master,
did a rebuild as robin, and an install as user bro. That worked. But
then I applied my original modifiction to options.py, did another
"make" as user robin in the top-level bro directory (which went
clean and didn't shown anything done); and then did the "make
install" again as user bro:

    Error copying directory from "/home/robin/bro/master/aux/broctl/BroControl" to "/home/robin/bro/master/build/aux/broctl/BroControl".
Listing BroControl ...
Can't list BroControl
-- Installing: /home/bro/bin/broctl
CMake Error at aux/broctl/cmake_install.cmake:47 (FILE):
  file INSTALL cannot find
  "/home/robin/bro/master/build/aux/broctl/BroControl".
Call Stack (most recent call first):
  cmake_install.cmake:48 (INCLUDE)

Robin

I reverted to a clean master

When you're inside the aux/broctl directory, what does `git show-ref master` tell you?

Error copying directory from
"/home/robin/bro/master/aux/broctl/BroControl" to
"/home/robin/bro/master/build/aux/broctl/BroControl".

I really don't think that copy should be happening anymore. You might just send me your current version of aux/broctl/CMakeLists.txt and I can see if it's old.

Argh, it was indeed *still* not up to date. Works now, thanks!

Robin