0
$\begingroup$

Rosanswers logo

Hi everybody,
I realized that during compilation time there will be a CMakeCache created; which is specific to our machine. Hence if we push the package (after compiling it) to a repo and someone else tries to compile it, they will get an error that the CMakeCache doesn't match the CMake on their current machine. The fix is simple - simply do a make clean in the downloaded package directory and then try compiling it again. But, it would be nice if there's no cache included.

  1. Is there a way to disable the CMakeCache during compilation?
  2. Is it a good practice to compile a package and pushing it the repo? or should we just push an uncompiled and clean package (with only the source codes files) to the repo?

Originally posted by Haikal Pribadi on ROS Answers with karma: 103 on 2012-04-02

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Every version control system can be instructed to ignore certain files or directories, so that they are never committed to the repository. Usually, this is a special file that contains a list of ignored names, one per line.

For Git, write those file names to a file named .gitignore (don't forget the leading dot). For CVS and Mercurial, the file is called .cvsignore and .hgignore respectively. Subversion is a bit special, because it stores this information in a "property" called svn:ignore. You can edit this property with the command

EDITOR=gedit svn propedit svn:ignore /path/to/my/workingcopy

For ROS packages, I usually end up ignoring the following files:

build
bin
cmake_install.cmake
lib
msg_gen
srv_gen

Of course, this does not remove files from the repository which are already checked in; you will have to do this manually.


Originally posted by roehling with karma: 1951 on 2012-04-03

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Haikal Pribadi on 2012-04-03:
exactly! thank you for reminding me this - it's funny how I overlooked this. Hence I can always have compiled packages on my machine yet the released repo only have the source code. And now i'm confused which one to mark as answer. I guess i'll leave it to the votes till tomorrow.

Comment by mlanting on 2012-10-31:
what do you do about generated source files that end up in the src directory? Do you just let them be, or add something like src/my_package to svn ignore?

Comment by roehling on 2012-11-05:
Ignore them; if necessary, name the files individually or by some wildcard like *.moc.cpp

$\endgroup$
0
$\begingroup$

Rosanswers logo

In general, you should only have the source code in the repository. The main reason is whomever is using your software may have a different system architecture/operating system/library version/etc than what you've used to compile your code, and it will not run on their systems. If you put only what is required to build your code, than your users can build it on whatever environment they are using.

Here's a discussion that may be helpful: http://stackoverflow.com/questions/1480274/which-files-do-you-commit-and-or-omit-from-your-source-control


Originally posted by John Hoare with karma: 765 on 2012-04-03

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by Haikal Pribadi on 2012-04-03:
Completely understood now! thanks John. But I'm confused which answer to mark as correct. So I guess I'll leave it to the votes till tomorrow.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.