rock-core / autoproj

Rock (Robot Construction Kit) package-oriented build system
http://rock-robotics.org/rock-and-syskit/workspace
23 stars 22 forks source link

Rock_lib/build/test file not generated when working outside of rock_install_dir #370

Closed greg-is-kub closed 2 years ago

greg-is-kub commented 2 years ago

Hi everybody,

first of all : rock beginner here, feel free to tell me if there is any info missing in my post i'll edit it with the missing data. thanks in advance for your help !

Config


I’m currently working on rock from a docker:

ubuntu 20.04, docker config below:

#!/bin/bash

#arguments init
ROCK_ROOT=/rock_root
_apt_get_option="-y"

#downloading required pkg
apt-get update
apt-get ${_apt_get_option} install ruby-full git sudo

#installing rock
mkdir -p ${ROCK_ROOT}
cd ${ROCK_ROOT}
wget -q https://raw.githubusercontent.com/rock-core/buildconf/master/bootstrap.sh

echo "___________________BOOTSTRAP______________________"
chmod +x bootstrap.sh
yes "" | ./bootstrap.sh

echo "source ${ROCK_ROOT}/env.sh" >> ~/.bashrc
. ${ROCK_ROOT}"/env.sh"

#setup rock
echo "______________________AUP______________________"
git config --global user.email "oui@yopmail.com"
git config --global user.name "yeet yeet" 
yes "" | aup     #autoproj update

echo "______________________AMAKE______________________"
yes "" | amake   #autoproj build

. ${ROCK_ROOT}"/env.sh"

Problem


I would like to be able to work from an other folder than the rock_root directory from where rock has been installed (specifically a workspace directory mounted from my computer where my work will be easily saved).

The problem is that after having (very) closely followed this tutorial I found that the last part (testing) could only be achieved if the rock-create-lib ${lib_name} was called from the rock_install_directory. Otherwise, the build/test file is not generated so no binaries and no the tests can be executed.

following commands are extracted from (the end of) the tutorial :

#until this part everything works fine fine
autoproj test enable tutorials/message_driver #works ok
amake # works fine

#last command is not ok 
./build/test/test_suite # cannot be executed because there is not test folder nor any test_suite binary

I know that this was specified at the beginning of the directory. However, the open wikistart from the DFKI tells that it doesn’t matter in which folder the library is created.

SO MY QUESTION IS : WHY IS IT NOT WORKING ? why can’t I generate a build/test folder from outside the rock_install_directory ? Is there any way I could do that ? thanks in advance for your time ! :wink:

greg-is-kub commented 2 years ago

Ok problem solved quite simply

rock-create-lib /relative/path/to/lib/outside/rock/lib_name

then adding to <autoproj/manifest> following this syntax :

layout :
    - relative/path/to/lib/outside/rock : 
        - lib_name

then in the shell :

cd /relative/path/to/lib/outside/rock/lib_name
autoproj test enable .
amake

generated the build/test file and allowed to test the lib

doudou commented 2 years ago

Hi @greg-is-kub ...

I have to admit the fact it worked at all is ... unexpected. You really should not be relying on that behavior. It may break in the future.

However, you can use the same functionality to split the two sets of packages, by putting e.g. rock.core into a separate folder:

layout:
  rock:
    rock.core
  myproject:
    mylib