summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2023-02-06 00:19:39 +0000
committerOmar Rizwan <omar@omar.website>2023-02-06 00:19:39 +0000
commit35e1269eceaee8a1e8cd1fdf74e9515b4e8fea51 (patch)
tree62f1e1a77b3538ae17287533fedebcb769c8ae15
parentc-statements: Harden the interface with the Tcl evaluator (diff)
downloadfolk-35e1269eceaee8a1e8cd1fdf74e9515b4e8fea51.tar.gz
folk-35e1269eceaee8a1e8cd1fdf74e9515b4e8fea51.zip
Some README tweaks
-rw-r--r--README.md59
-rw-r--r--lib/c.tcl4
2 files changed, 33 insertions, 30 deletions
diff --git a/README.md b/README.md
index e5e3c5d0..02a5c62e 100644
--- a/README.md
+++ b/README.md
@@ -26,10 +26,9 @@ Server 22.04 LTS-minimal.
On Pi, Raspberry Pi OS Lite => if no `folk`
user, then:
- ```
- sudo useradd -m folk; sudo passwd folk;
- sudo usermod -a -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,render,netdev,lpadmin,gpio,i2c,spi folk
- ```
+ sudo useradd -m folk; sudo passwd folk;
+ sudo usermod -a -G adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,input,render,netdev,lpadmin,gpio,i2c,spi folk
+
3. `sudo apt update`
2. Set up OpenSSH server if needed, connect to network.
4. `sudo apt install avahi-daemon` if needed (for mDNS so hostname can be autodiscovered)
@@ -46,26 +45,25 @@ Server 22.04 LTS-minimal.
when you run it from laptop. On Ubuntu Server or Raspberry Pi OS
(as root) ([from
here](https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6)):
- - ```
- # cat >/etc/systemd/system/folk.service
- [Unit]
- Description=Folk service
- After=network.target
- StartLimitIntervalSec=0
-
- [Service]
- Type=simple
- Restart=always
- RestartSec=1
- User=folk
- ExecStart=make -C /home/folk/folk
-
- [Install]
- WantedBy=multi-user.target
-
- # systemctl start folk
- # systemctl enable folk
- ```
+
+ # cat >/etc/systemd/system/folk.service
+ [Unit]
+ Description=Folk service
+ After=network.target
+ StartLimitIntervalSec=0
+
+ [Service]
+ Type=simple
+ Restart=always
+ RestartSec=1
+ User=folk
+ ExecStart=make -C /home/folk/folk
+
+ [Install]
+ WantedBy=multi-user.target
+
+ # systemctl start folk
+ # systemctl enable folk
You probably want to add `folk ALL=(ALL) NOPASSWD: /usr/bin/systemctl`
to `/etc/sudoers` as well.
@@ -141,8 +139,7 @@ Potentially useful for graphs: `graphviz`
Potentially useful: `v4l-utils`, `gdb`, `streamer`, `cec-utils`,
`file`, `strace`
-Potentially useful: add `folk0` shortcut to your laptop
-`~/.ssh/config`:
+Potentially useful: add `folk0` shortcut to your laptop `~/.ssh/config`:
```
Host folk0
HostName folk0.local
@@ -193,6 +190,12 @@ choosing.
- ~clean up lexical scope~
- ~with-all-matches~
+## Troubleshooting
+
+You can build Tcl with `TCL_MEM_DEBUG`. Download Tcl source code. (On
+Mac, _do not_ go to the macosx/ subdir; go to the unix/ subdir.) Do
+`./configure --enable-symbols=all`, do `make`, `make install`
+
## Vulkan
### Pi 4
@@ -245,7 +248,7 @@ clone https://github.com/krh/vkcube
`./vkcube -m khr -k 0:0:0`
-### FFT example
+## FFT example
- Including [kissfft](https://github.com/mborgerding/kissfft)
@@ -324,4 +327,4 @@ When $this has camera image /im/ {
On unmatch [list freeImage $bwim]
}
}
-``` \ No newline at end of file
+```
diff --git a/lib/c.tcl b/lib/c.tcl
index 9e155502..27b7a2cb 100644
--- a/lib/c.tcl
+++ b/lib/c.tcl
@@ -157,7 +157,7 @@ namespace eval c {
set frame [info frame -2]
if {[dict exists $frame line] && [dict exists $frame file] &&
[dict get $frame line] >= 0} {
- subst {#line [dict get $frame line] "[dict get $frame file]"}
+ #subst {#line [dict get $frame line] "[dict get $frame file]"}
} else { list }
}
::proc code {newcode} {
@@ -363,7 +363,7 @@ namespace eval c {
# puts "=====================\n$sourcecode\n====================="
set cfd [file tempfile cfile cfile.c]; puts $cfd $sourcecode; close $cfd
- exec cc -Wall -g -shared -fPIC {*}$cflags $cfile -o [file rootname $cfile][info sharedlibextension]
+ exec cc -Wall -g -shared -fsanitize=address -fPIC {*}$cflags $cfile -o [file rootname $cfile][info sharedlibextension]
load [file rootname $cfile][info sharedlibextension] cfile
}
::proc import {scc sname as dest} {