Build error on TK1: git files problem

I’ve been doing fine on my Jetson TK1. I’ve been writing and running code for about a month now. However today I have an error when trying to build. Something is wrong with the git repository but I don’t understand how git works. This is my first project using it, and the tools that came with Jetson TK1 set it up for me. The files on my development computer are fine. Is there a way to clear out the errors on the remote, i.e. the TK1?

Here’s the text of the error. I would be very grateful for a solution so I can continue my development: I’m stuck!

Errors occurred during the build.
Errors running builder 'CDT Builder' on project 'saw'.
Internal error building project saw configuration Release
org.eclipse.ptp.rdt.sync.core.exceptions.RemoteSyncException: remote git commit failed with message: error: object file .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831 is empty
error: object file .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831 is empty
fatal: loose object 61c43641b76777d36c6c77db73029cee15eef831 (stored in .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831) is corrupt

remote git commit failed with message: error: object file .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831 is empty
error: object file .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831 is empty
fatal: loose object 61c43641b76777d36c6c77db73029cee15eef831 (stored in .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831) is corrupt

Internal error building project saw configuration Release
org.eclipse.ptp.rdt.sync.core.exceptions.RemoteSyncException: remote git commit failed with message: error: object file .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831 is empty
error: object file .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831 is empty
fatal: loose object 61c43641b76777d36c6c77db73029cee15eef831 (stored in .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831) is corrupt

remote git commit failed with message: error: object file .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831 is empty
error: object file .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831 is empty
fatal: loose object 61c43641b76777d36c6c77db73029cee15eef831 (stored in .ptp-sync/objects/61/c43641b76777d36c6c77db73029cee15eef831) is corrupt

Have you git cloned the files to Jetson yourself or are you using a tool on your PC that does that automatically?

I haven’t seen that error myself so I don’t know if there’s a “proper” way to fix it. Some files seem to be empty while they shouldn’t. Are you always shutting down the Jetson by running the shutdown command and not just by disconnecting the power?

If you did the git clone manually and if you don’t have any new commits on the git repository, you could rename the whole tree, git clone a new one and then copy your “broken” working tree on top of new tree. Excluding the .git directory in which git stores all its state files. This way you would have a fresh tree but still with your changes.

I think the Nsight Eclipse software does this for me. I’m not doing anything besides editing my code, saving the files in Nsight, and finally hitting the build button. It takes over from there and I can see the .ptp-sync file growing with each compile.

Here’s what I did so I could compile again:

(1) Delete entire project folder on target device, i.e. the TK1.
(2) Empty trash on target.
(3) On the host go to the project folder and delete the sub folder .ptp-sync.
(4) Empty trash on host.

This fixed the problem so I can recompile but this created or revealed a new problem. As I make changes to the source the .ptp-sync file grows at an alarming rate with each recompile. For example the source files are about 125K bytes of text total. The .ptp-sync folder after the first compile is about 3 MB. after the next compile it’s 7 M. Here are typical numbers of the size of the folder after small edits and each compile:

3 M
7 M
12 M
18 M
38 M
78 M
158 M
200 M
360 M

So after not too many edits and compiles the size becomes overwhelming and rapidly approaches a gig which is too big for the system to manage. So when it hits about 300 M I delete it again, and the target project folder too.

I’ve never used a versioning system before so this is new to me. I wish I could simply bypass it. I back up my files separately.

Surely I must be doing something wrong or the system is configured wrong.

Any tips to rectify this?

As far as shutting down, normally I shut down properly. However if I have a nasty code bug that locks up the TK1 then I have no choice but to do a hard reset.