Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeotf always exits with 0 (i.e. success) even when error occurs #417

Closed
anthrotype opened this issue Jun 13, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@anthrotype
Copy link
Member

anthrotype commented Jun 13, 2018

The MakeOTF.py script's main() function does not return a non-zero value to the calling shell when an exception occurs and the font was not built successfully. Currently all exceptions are handled and passed, so main always exits successfully:

except (MakeOTFOptionsError, MakeOTFTXError, MakeOTFRunError):
pass
except Exception:
import traceback
traceback.print_exc()
finally:
if not makeOTFParams.debug:
for tempPath in makeOTFParams.tempPathList:
if os.path.exists(tempPath):
os.remove(tempPath)
print("Done.")

in fontmake there's an optional FDKFeatureCompiler that calls makeotf as subprocess. That code is broken for many reasons, one of which is that it attempts to guess whether the build was successful from the messages printed to stdout, because the exit code is meaningless.

@anthrotype
Copy link
Member Author

(just realised I forgot an important "does not" in the previous message, so the logic was inverted; I edited the comment)

@miguelsousa
Copy link
Member

@anthrotype fix done. Just waiting for your review

anthrotype added a commit to googlefonts/fontmake that referenced this issue Jun 14, 2018
adobe-type-tools/afdko#417

This way we support both the old and the new behaviour.

I also renamed the method from the deprecated setupFile_featureTables to buildTables
and removed the overridden __init__ as the 'mtiFeatures' argument is no longer used
by ufo2ft (one now needs to use a separate MTIFeatureCompiler class for those).
@miguelsousa miguelsousa self-assigned this Aug 9, 2018
schriftgestalt pushed a commit to schriftgestalt/afdko that referenced this issue May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants