My setup is following "A First Tupfile" tutorial with the Tupfile changed 
like this:

: hello.c |> clang -Og -g hello.c -o hello |> hello

This compiles but the debug paths are wrong:

$ symbols -fullSourcePath hello | grep hello.c
                    0x0000000000000000 (     0x4) /Users/tomek/Desktop/prj/
tuptest/.tup/mnt/@tupjob-11/Users/tomek/Desktop/prj/tuptest/hello.c:4
                    0x0000000000000004 (     0xc) /Users/tomek/Desktop/prj/
tuptest/.tup/mnt/@tupjob-11/Users/tomek/Desktop/prj/tuptest/hello.c:5
                    0x0000000000000010 (     0x4) /Users/tomek/Desktop/prj/
tuptest/.tup/mnt/@tupjob-11/Users/tomek/Desktop/prj/tuptest/hello.c:6

I understand the `.tup/mnt/@tupjob-<id>/...` part is for a FUSE filesystem 
mount to transparently track dependencies. But why doesn't it chdir() into 
`.../.tup/mnt/@tupjob-11/Users/tomek/Desktop/prj/tuptest/` and run clang 
with the relative path from there? If it does chdir() into it, why does it 
embed the FUSE mount path?

Having DAFS, I found out a way to solve this problem is to tack ^c^ in 
front of the command to run it inside a chroot. OK.

tup error: This process requires namespacing, but this kernel does not 
support namespacing and tup is not privileged. You'll need to upgrade your 
kernel, or compile tup with CONFIG_TUP_SUDO_SUID=y in order to support the 
^c flag.

Creating a tup.config file with `CONFIG_TUP_SUDO_SUID=y` doesn't help. Tup 
updated the variant but failed with the same message.

Running a privileged tup crapped out differently:

$ sudo tup
Password:
[ tup ] [0.000s] Scanning filesystem...
[ tup ] [0.001s] Reading in new environment variables...
[ tup ] [0.001s] No Tupfiles to parse.
[ tup ] [0.001s] No files to delete.
[ tup ] [0.001s] Executing Commands...
* 0) clang -Og -g hello.c -o hello                                         
                                                                         
clang: error: couldn't rename cache file '/var/folders/zz/
zyxvpxvq6csfxvn_n0000000000000/T/xcrun_db-AY8QHbSY' to '/var/folders/zz/
zyxvpxvq6csfxvn_n0000000000000/T/xcrun_db' (errno=No such file or directory)
 *** tup messages ***
tup error: File '/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/
xcrun_db-AY8QHbSY' was written to, but is not in .tup/db. You probably 
should specify it as an output
 *** Command failed due to errors processing the output dependencies.
 [ ] 100%
 *** tup: 1 job failed.

I can of course set `target.source-map` in lldb to strip the FUSE prefix 
post-build but I presume the @tupjob-<id> is related to parallelisation and 
therefore <id> is not fixed. Another idea of mine was to add 
`--fdebug-prefix-map` to the clang command to strip it during build but 
what should I put there? Is there a $(TUP_variable) with the real current 
dir containing the FUSE mount or do I really need to call `pwd` each time I 
run clang? Either way sounds like overdoing things... So instead of 
fighting uphill, I figured the people out there must know a less ridiculous 
way to do something as basic as stepping through a program.

So, how do you debug a program built with tup?

I'm on macOS 10.15.1, FUSE 3.10.3, tup v0.7.8 (although it doesn't tell that 
<https://github.com/gittup/tup/issues/384>).

Regards,
Tomek

-- 
-- 
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tup-users/fb705919-49b1-4c04-93ed-1fea019b11ed%40googlegroups.com.

Reply via email to