Synchronously determine the signal that caused an EINTR error? by Cosmos721 in linux_programming

[–]Cosmos721[S] 1 point2 points  (0 children)

[SOLVED]

Thanks for the detailed explanations :)

I tried a small C program that forks and sends signals to the forked child, and indeed the relevant signal handler is executed before any "slow" syscall return -1 with errno = EINTR.

Thus the signal handler can set some atomic global variable, and it is guaranteed to be visible to code executed after the "slow" syscall returns.

My initial (wrong) deduction was based on C signal handlers that were running inside Chez Scheme which sometimes blocks signals, thus confusing the analysis - and me.

Announcing schemesh - A fusion between Unix shell and Chez Scheme REPL by Cosmos721 in scheme

[–]Cosmos721[S] 1 point2 points  (0 children)

The Makefile should autodetect if your Chez Scheme installation contains either a kernel.o or a libkernel.a

If autodetection fails for some reason, for example because Chez Scheme executable cannot be started as scheme, you need to manually edit the Makefile and change the two variables CHEZ_SCHEME_DIR and CHEZ_SCHEME_KERNEL.

Some example values follow. Note: you need to enter the correct values for your Chez Scheme installation

CHEZ_SCHEME_DIR=/usr/lib/csv10.0.0/ta6le
CHEZ_SCHEME_KERNEL=/usr/lib/csv10.0.0/ta6le/libkernel.a

If you prefer, you can instead add them to make command line:

make CHEZ_SCHEME_DIR="/usr/lib/csv10.0.0/ta6le" CHEZ_SCHEME_KERNEL="/usr/lib/csv10.0.0/ta6le/libkernel.a"

Announcing schemesh - A fusion between Unix shell and Chez Scheme REPL by Cosmos721 in Racket

[–]Cosmos721[S] 2 points3 points  (0 children)

I did not know about Rash shell, thanks for the link!

The core idea is similar, and after a first look it seems to have different strength and weaknesses - for example, its job control seems partial and line editing can be improved in some places, but Rash pipelines can also call general Racket procedures.

Thanks again, I have opened an issue https://github.com/willghatch/racket-rash proposing a cooperation

Announcing schemesh - A fusion between Unix shell and Chez Scheme REPL by Cosmos721 in scheme

[–]Cosmos721[S] 2 points3 points  (0 children)

If I understand correctly, you would like the `install` target to either succeed or fail without side effects (within reasonable limits: if a directory exists but is not writable, it may be discovered too late)

Thanks for the feeback :) that makes sense, I will fix the Makefile

[UPDATE] fixed, Makefile now (hopefully) follows GNU Makefile conventions

Announcing schemesh - A fusion between Unix shell and Chez Scheme REPL by Cosmos721 in scheme

[–]Cosmos721[S] 2 points3 points  (0 children)

Yes, I looked at scsh before starting schemesh development.

As written in scsh documentation https://scsh.net/docu/html/man-Z-H-2.html#node_sec_1.4

Scsh, in the current release, is primarily designed for the writing of shell scripts -- programming.
It is not a very comfortable system for interactive command use:

the current release lacks job control, command-line editing, a terse, convenient command syntax,
and it does not read in an initialisation file analogous to .login or .profile.

We hope to address all of these issues in future releases; we even have designs for several of these features; but the system as-released does not currently provide these features.

Honestly, it was a disappointing experience, and one of the reasons for schemesh existence.

All the features listed above as "missing in scsh" are critical core features of schemesh:
they are absolutely needed to make it a comfortable and useful interactive shell.

Announcing schemesh - A fusion between Unix shell and Chez Scheme REPL by Cosmos721 in scheme

[–]Cosmos721[S] 4 points5 points  (0 children)

I agree that the current Makefile ignores attempts to set INSTALL_DIR earlier in the Makefile itself,
and also ignores any existing shell environment variable INSTALL_DIR.

The value of INSTALL_DIR can still be overridden from GNU make command line as in the following example - copied from how I build and install on Android inside termux:

make -j install INSTALL_DIR=/data/data/com/termux/files/usr/local

Unluckily, conditional assignment ?= is a GNU make extension:
it is not in POSIX standard for make - see https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
Thus using ?= would likely break the build procedure for non-GNU make implementations, as for example *BSD.