Commit Graph

57 Commits

Author SHA1 Message Date
Kartik K. Agaram 5e976554dd drop the lfs library
I can't feel confident about its sandboxing story yet. And if we can't
build a file navigator, what are we even doing with it.
2022-03-14 17:26:13 -07:00
Kartik K. Agaram b68405fe31 delete debug library
There's security issues here, and they're subtle. Dropping for now until
I or someone else finds a need for them.
2022-03-13 17:36:01 -07:00
Kartik K. Agaram 101c59d8cb experiment: drop -Wshadow
I'm totally fine with lexical scope in other languages. Why does it feel
like such a big deal in C?
2022-03-03 18:15:26 -08:00
Kartik K. Agaram 272d7532dc disable non-portable ASan flags 2022-02-16 20:53:53 -08:00
Kartik K. Agaram 5e200cf96a zet.tlv: some more editor shortcuts 2022-02-12 15:56:12 -08:00
Kartik K. Agaram c1e4b84222 fixup! clean up top-level Makefile targets 2022-02-10 16:40:22 -08:00
Kartik K. Agaram 3cfb8f7812 in fact, loadlib.c is all dead code now
Now we can be sure apps can't call `require`.
2022-02-06 13:34:16 -08:00
Kartik K. Agaram 63e3ba62c2 now all our supported platforms are POSIX 2022-02-06 13:30:32 -08:00
Kartik K. Agaram 6860a02396 drop all support for loading dynamic libraries 2022-02-06 13:29:38 -08:00
Kartik K. Agaram b79d6be383 drop some more untested platforms 2022-02-06 13:08:46 -08:00
Kartik K. Agaram 467ce31371 drop USE_LINUX and similar defines
How many levels of macros do we need. Also stop lying that we're using
Linux in BSD.
2022-02-06 13:06:27 -08:00
Kartik K. Agaram c101d1a3c5 drop MinGW
I've never tested with it, and it is likely broken after all my changes
to base Lua 5.1. Might as well be transparent about that.

If you care about this platform, please let me know:
  http://akkartik.name/contact
2022-02-06 12:44:51 -08:00
Kartik K. Agaram 88404d41ea copy realpath() from FreeBSD repo
To sandbox apps robustly, we're going to need to always work with
canonical absolute paths.
2022-01-30 12:22:42 -08:00
Kartik K. Agaram 7a13adb52c try to get by with one feature macro
I fucking hate feature macros. Egregious discharge of our
division-of-labor-obsessed society. People should be able to introduce
names. People should be able to give up names to lower levels of
abstraction when they encounter conflicts.

Feature macros seem to exist[1] to support more than two levels of
abstraction. You try to build, one of your libraries fails to build
because of a conflict between it and one level down. You don't want to
modify this library. Just fucking https://catern.com/change_code.html
already. But no, I have to litter my code with feature macros even
though I just want the abstraction the original library provides.

[1] https://man7.org/linux/man-pages/man7/feature_test_macros.7.html
    https://lwn.net/Articles/590381
2022-01-29 12:41:20 -08:00
Kartik K. Agaram 24f0781d2b new library: luafilesystem (lfs)
https://github.com/keplerproject/luafilesystem

The new commander.tlv app demonstrates it working.
2022-01-29 12:39:53 -08:00
Kartik K. Agaram 1f620a28d7 more precise dependencies 2022-01-29 11:36:00 -08:00
Kartik K. Agaram b493ed32b8 get Teliva working on FreeBSD 2022-01-26 09:36:06 -08:00
Kartik K. Agaram 6a33284b07 get Teliva running on NetBSD
NetBSD still uses curses by default. One _could_ install ncurses, but I
don't have access to a NetBSD box with permissions to install ncurses,
so I'm experimenting to see how far we can get with just curses. So far
most of the apps seem to work, with the exception of one bug that I'll
commit next.
2022-01-24 20:15:43 -08:00
Kartik K. Agaram a3a207d2e3 more generic build target in luasocket 2022-01-24 17:32:42 -08:00
Kartik K. Agaram 058145ee23 clarify generic 'bsd' build target
We still only have OpenBSD working.
2022-01-24 17:25:50 -08:00
Kartik K. Agaram 2b5559d8eb update all places when changing color scheme 2021-12-25 15:14:33 -08:00
Kartik K. Agaram bb6e79aa0d reorg: pull Teliva-specific stuff out of lua.c
It should now be easier to diff against the Lua 5.1 sources upstream.
2021-12-25 13:33:37 -08:00
Kartik K. Agaram 191538baf7 drop ASan from Makefile
Accidentally added at some point. It's a useful debugging aide, but I
don't want to require the additional dependencies on a first run.
2021-12-18 07:58:18 -08:00
Kartik K. Agaram 1d9a4fa1d5 ctrl-u: clear prose 2021-12-17 23:19:59 -08:00
Kartik K. Agaram 0b0a58da06 snapshot: start reading a new format
I really wanted to avoid getting into defining or parsing new file
formats. However, using the entire power of Lua is not ideal, as
described earlier in Konrad Hinsen's bug. In addition to everything
else, it's a vector for arbitrary code execution when someone loads an
untrusted image.

I could use JSON, but it requires ugly string escaping. Seems cleaner to
just use YAML. But YAML is complex and needs its own dependencies. If
I'm going to do my own, might as well make the multi-line string format
really clear.

I can't yet write the new format.
2021-12-11 00:43:26 -08:00
Kartik K. Agaram a0c66dbe31 more configurable colors
Also start using 256 colors, under the assumption most people will have
them.
2021-12-06 16:53:11 -08:00
Kartik K. Agaram 462a45a39f yet another fucking makefile bug
Making changes to lcurses directory was causing it to be compiled, but
not causing teliva to be relinked.

Now I'm:
  - unconditionally running `make` on subdirectories
  - conditionally linking their outputs

Seems reasonable when I put it like that. Hopefully this is working now.

I used to know `make` down cold a decade ago, but it's evaporated from
my brain.
2021-11-28 11:41:09 -08:00
Kartik K. Agaram 107af65f3c pass some CFLAGS at least to libcurses
My Makefiles are an utter mess. Unclear how to reconcile staying close
to upstream with being clean in isolation.
2021-11-27 09:24:00 -08:00
Kartik K. Agaram 295c99c2d9 . 2021-11-27 09:00:38 -08:00
Kartik K. Agaram 7d71663f1a one final issue building on Mac OS X 2021-11-27 08:10:18 -08:00
Kartik K. Agaram 7814c1c98a now building on OpenBSD
Still emitting a bunch of warnings on OpenBSD, though.
2021-11-27 07:58:58 -08:00
Kartik K. Agaram 3fee59527a select C99 standard 2021-11-27 07:18:24 -08:00
Kartik K. Agaram c558d2c565 . 2021-11-27 00:42:15 -08:00
Kartik K. Agaram ff43b5bae1 fix build on Mac 2021-11-27 00:41:17 -08:00
Kartik K. Agaram 83050ec38e starting to test compilation on Mac and BSD.
For starters, put Linux-specific stuff in a Linux-specific target.

By not resetting MYCFLAGS and MYLDFLAGS, I'm unnecessarily passing in
-DLUA_USE_LINUX. But that'll make it easier to get things running on Mac
and BSD.
2021-11-27 00:34:49 -08:00
Kartik K. Agaram 73a22a397e libraries don't need Lua's `#define`s and whatnot 2021-11-25 20:21:05 -08:00
Kartik K. Agaram f58d5b8354 teliva is now ASan-clean again
At least in short runs.

Encouraging that the problem was in a recent commit (5a63a5ca40 from
yesterday when I introduced version control).

Disabling Address Sanitizer again.
2021-11-25 19:27:30 -08:00
Kartik K. Agaram 6727045165 temporarily start using the address sanitizer 2021-11-25 11:25:28 -08:00
Kartik K. Agaram 103b8e17bb jettison luac
I'm starting to see some heap buffer overruns, which means we have too
much C code.

I noticed this because editing life.tlv no longer works after commit
5a63a5ca4. However, the offending heap overrun has been around long
before that. It's just been a silent bug until now.
2021-11-25 11:22:26 -08:00
Kartik K. Agaram b40ad26544 more Makefile streamlining
Since everything is in my control there's no need to parameterize
include paths.

It's a struggle to get make to run when it should. Lying that something
is phony stops working when it's a dependency. Commands get
unnecessarily run. Just fucking run recursive makes directly in the
target that depends on them.
2021-11-24 09:28:01 -08:00
Kartik K. Agaram 76329c0206 standardize warning flags everywhere
I'd like to enable -Wextra as well, but that creates some false
positives.

I've at least made my changes clean w.r.t. -Wextra.

Now we have 4 remaining warnings with gcc 9.3 that seem genuine. Need to
fix those.
2021-11-22 19:01:07 -08:00
Kartik K. Agaram 3b4d7131cb standardize CFLAGS
Adding -Wpedantic creates a new warning. Leaving it alone for now:
  https://stackoverflow.com/questions/31526876/casting-when-using-dlsym
2021-11-22 18:11:38 -08:00
Kartik K. Agaram 5a484efe8c https now working!
Still extremely ugly:
- I've inlined all the namespaces under ssl, so you need to know that
  context and config are related to ssl.
- luasec comes with its own copy of luasocket. I haven't deduped that
  yet.
2021-11-21 15:55:52 -08:00
Kartik K. Agaram 3b44b9827d basic http requests starting to work
In the process we're starting to load almost all of luasocket by
default. And everything is working as expected, no unpleasant surprises.
2021-11-21 15:07:42 -08:00
Kartik K. Agaram 548d59f918 luasocket now loading properly
I still haven't tried actually running it.
2021-11-20 23:34:29 -08:00
Kartik K. Agaram 02acfa7c9c rename 2021-11-20 21:03:38 -08:00
Kartik K. Agaram 6bdc3d17a7 inline luasocket
Just builds for now, isn't available yet to Lua code.
2021-11-20 20:26:17 -08:00
Kartik K. Agaram b43747ecef inline lcurses maximally rather than minimally
Until now we had just the bare minimum bindings needed for the demos
built so far. Now we have all of lcurses building in place with minimal
changes.

The changes in this commit can run hanoi.lua when inlined into Lua 5.1,
but don't work with Teliva.
2021-11-19 19:11:03 -08:00
Kartik K. Agaram 720d728a8d tested on Mac OS 2021-11-14 12:33:25 -08:00
Kartik K. Agaram 5a44605143 instrumenting function calls with their depth 2021-11-13 08:16:41 -08:00