[Resolved] test161 Submission Error: fork/exec ./config: no such file or directory

I have configured our repository and local test161 config as instructed, and when I try to submit I get the error in the title. Several TAs could not figure out what was causing the issue, so here is the full debug output of test161 submit.

trinity@zion:~/shared/src$ test161 submit -debug asst1
git status
On branch master
Your branch is up-to-date with ‘origin/master’.
nothing to commit, working tree clean

git rev-parse --abbrev-ref --symbolic-full-name @{u}
origin/master

git ls-remote --get-url origin
git@bitbucket.org:opsclass/ops-class.git

git rev-parse --abbrev-ref HEAD
master

git status --porcelain

Env: GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i /home/trinity/.test161/keys/rshanule@buffalo.edu/id_rsa
git remote update origin
Fetching origin

git rev-parse HEAD
e489c9d5a1719a9f7c5456d8bd7850b416b546a5

git rev-parse origin/master
e489c9d5a1719a9f7c5456d8bd7850b416b546a5

git rev-parse origin/master
e489c9d5a1719a9f7c5456d8bd7850b416b546a5

Env: GIT_SSH_COMMAND=ssh -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i /home/trinity/.test161/keys/rshanule@buffalo.edu/id_rsa
git remote update origin
Fetching origin

test161: 2017/02/13 18:30:41 build.go:578: Skipping overlay (OK for local builds)
1.000000 Exec: git reset --hard
2.000000 OK
1.000000 Exec: git clean -d -f
2.000000 OK
1.000000 Exec: git fetch
2.000000 OK
1.000000 Exec: git checkout e489c9d5a1719a9f7c5456d8bd7850b416b546a5
2.000000 OK
1.000000 Exec: ./configure --ostree=/home/trinity/.test161/cache/241093b8364219d61dfc2de3c3f2e657e5420f343ae3b45933be95fbe74b7b0d/root
2.000000 OK
1.000000 Exec: ./config ASST1
0.000000
Error: fork/exec ./config: no such file or directory

It’s trying to run ./config ASST1 from your kern/conf directory, but there is no ./config file. It looks like you may have mucked up your repo somehow, maybe you deleted the conf directory or added it to .gitignore? If you clone your repo to another directory locally (which is what we do), you should be able to replicate the issue if you try to build.

kern/conf directory is still intact and present in the remote repository. In it, config exists, and so does ASST1. The output from test161 looks like it’s trying to run ./config from the src directory. I don’t know if that’s correct but I cannot do that. Am I supposed to be able to?

Are you editing files in Windows? I just cloned your repo using your test161 deploy key, and your kern/conf/config file has all sorts of ^M characters in the git diff log for that file:

For example:

--- a/kern/conf/conf.kern
+++ b/kern/conf/conf.kern
@@ -309,6 +309,14 @@ file      ../common/libc/string/strlen.c
 file      ../common/libc/string/strrchr.c
 file      ../common/libc/string/strtok_r.c
 
+#^M
+# libtest161 shared code and security functions^M
+#^M
+^M
+file      ../common/libtest161/test161.c^M
+file      ../common/libtest161/secure.c^M
+file      ../common/libtest161/sha256.c^M

When I try to run the ./config command with your code locally, I get:

bash: ./config: /bin/sh^M: bad interpreter: No such file or directory

It looks like your text editor is inserting bad line endings in (at least) this file.

Well that’s bizarre. I have been working in Windows but I don’t recall ever editing that file. When I look at the file on Bitbucket and in my local repo using vim I don’t see those ^M characters. But I am getting that error locally as well. I’m not really sure where that’s coming from or what needs to be done. I’ll try to hunt these characters down.

If you’re not familiar, different platforms handle newlines differently. Windows uses CR LF, which on Unix is “\r\n”, whereas Unix just uses “\n”. The ^M is actually the CR, I believe. This is a PITA when sharing text files between platforms. I would suggest that you do editing in your virtualbox, or configure your Windows text editor to use Unix line endings.

To fix this, you could just check out the staff version of the files that are messed up. Code files are probably OK, but the scripts are not. There is probably a nasty awk command you can run to find the affected files.

1 Like

There’s a small utility called dos2unix that will correct line breaks. You can probably create a little shell one-liner to fix all of the files in your repository. (It’s in an apt package called tofrodos.)

1 Like

Alright thanks all. I had to save conf.kern, config, and ASST1 using the Unix line endings, which my text editor made pretty easy. I’m still a bit annoyed considering I don’t think I ever manually edited those files but oh well it’s working now.