# Compiling [or not] a package before pushing to repo

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?

edit retag close merge delete

Sort by » oldest newest most voted

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.

more

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.

( 2012-04-03 05:55:19 -0500 )edit

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?

( 2012-10-31 03:25:17 -0500 )edit

Ignore them; if necessary, name the files individually or by some wildcard like *.moc.cpp

( 2012-11-05 02:56:37 -0500 )edit

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

more

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.

( 2012-04-03 05:56:39 -0500 )edit