adobe-type-tools / cffsubr

Standalone CFF subroutinizer based on AFDKO tx
Apache License 2.0
8 stars 8 forks source link

cffsubr/tx crashes on macOS if env TMPDIR names a non-existent path #21

Open rsms opened 2 years ago

rsms commented 2 years ago

When tx is run (in my case via fontmake) and the TMPDIR environment variable is set to a path that does not exist, tx crashes.

Repro:

( TMPDIR=/does/not/exist ; \
  fontmake -u RSMSIntra-Condensed.ufo -o otf --output-path out.otf \
    --overlaps-backend pathops --production-names --optimize-cff 2 \
    --verbose DEBUG

Full log here: https://gist.github.com/rsms/e9946c7f28bb6e663b622e9c4b7f16f0

tx seem to write data and then read it back in again. I wonder if it can skip that disk write-and-read middle step?

anthrotype commented 2 years ago

Hm yeah, there were a couple issues with tx reading from stdin and writing to stdout so we had to use temp files

Grep for "tempfile" below and see the inline comments (sorry I'm writing from mobile phone) https://github.com/adobe-type-tools/cffsubr/blob/master/src/cffsubr/__init__.py

Perhaps those issues have been fixed in tx upstream, I don't know.

PRs welcome

anthrotype commented 2 years ago

Didn't mean to close sorry.. Why do you set TMPDIR environment variable to a path that does not exist?

rsms commented 2 years ago

Why do you set TMPDIR environment variable to a path that does not exist?

It was an accident; a makefile included by another makefile used a variable with the same name (and unfortunately in make, make variables and env variables share scope.)

Once I figured out what was going on I changed the make variable.