silnrsi / smith

font development, testing and release
Other
14 stars 5 forks source link

manifest generation issue with tarball target #71

Open n7s opened 2 years ago

n7s commented 2 years ago

when doing a smith release (aka chaining zip and tarball), the zip target runs fine but the tarball one does not seem to find (or generate in the expected folder) the manifest.json file:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/waflib/Scripting.py", line 154, in waf_entry_point run_commands() File "/usr/lib/python3/dist-packages/waflib/Scripting.py", line 245, in run_commands run_command(cmd_name) File "/usr/lib/python3/dist-packages/waflib/Scripting.py", line 231, in run_command ctx.execute() File "/usr/lib/python3/dist-packages/waflib/Scripting.py", line 551, in execute return execute_method(self) File "/usr/lib/python3/dist-packages/smithlib/wafplus.py", line 369, in execute return old_exec(bld) File "/usr/lib/python3/dist-packages/waflib/Build.py", line 228, in execute self.execute_build() File "/usr/lib/python3/dist-packages/waflib/Build.py", line 259, in execute_build self.post_build() File "/usr/lib/python3/dist-packages/smithlib/package.py", line 772, in post_build p.execute_tar(self) File "/usr/lib/python3/dist-packages/smithlib/package.py", line 392, in execute_tar tar.add(y.abspath(), arcname = archive_name) File "/usr/lib/python3.8/tarfile.py", line 1955, in add tarinfo = self.gettarinfo(name, arcname) File "/usr/lib/python3.8/tarfile.py", line 1834, in gettarinfo statres = os.lstat(name) FileNotFoundError: [Errno 2] No such file or directory: '/smith/font-tagmukay/results/manifest.json'

n7s commented 2 years ago

looks likeself.build_manifest(bld) is missing from execute_tar()

devosb commented 2 years ago

looks likeself.build_manifest(bld) is missing from execute_tar()

This did not seem to resolve the issue with smith release.

It did make a difference when running smith tarball. For a font project that did not have any issues with smith release (tested with Namdhinggo) smith tarball would fail, unless the above fix was applied. However, for projects (Dai Banna SIL and Tagmukay) where smith release has the original issue noted above, then the above fix did not help, with either release or tarball.

mhosken commented 2 years ago

For a font package to create a manifest.json, each font must contain an axes dictionary {axis: value}. Absence of an axes dictionary results in no manifest being made. This was causing the crash but is now silently not included in the package. Users should endeavour to create an axes dictionary for fonts not created from a designspace (since designspaces automatically insert an axes dictionary).

devosb commented 2 years ago

I am confused.

devosb commented 2 years ago

The recent fix enabled smith release to work for the two projects that had this issue. However, smith tarball still fails (with a different message)

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.10/site-packages/waflib/Scripting.py", line 154, in waf_entry_point
    run_commands()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/waflib/Scripting.py", line 245, in run_commands
    run_command(cmd_name)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/waflib/Scripting.py", line 231, in run_command
    ctx.execute()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/waflib/Scripting.py", line 551, in execute
    return execute_method(self)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/smithlib/wafplus.py", line 369, in execute
    return old_exec(bld)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/waflib/Build.py", line 228, in execute
    self.execute_build()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/waflib/Build.py", line 259, in execute_build
    self.post_build()
  File "/home/ubuntu/.local/lib/python3.10/site-packages/smithlib/package.py", line 750, in post_build
    p.execute_tar(self)
  File "/home/ubuntu/.local/lib/python3.10/site-packages/smithlib/package.py", line 389, in execute_tar
    for t in sorted(self.get_files(bld), key=lambda x:x[1]) :
  File "/home/ubuntu/.local/lib/python3.10/site-packages/smithlib/package.py", line 461, in get_files
    if not self.nomanifest:
AttributeError: 'Package' object has no attribute 'nomanifest'
devosb commented 2 years ago

@mhosken found that if shortcircuit = False was removed from wscript, then a mainifest file would be created with smith release.

With another fix smith tarball does not crash, but does not produce the manifest file.

jvgaultney commented 2 years ago

However be careful, as the shortcircuit mechanism does not properly set some font metadata. IOW removing that line may generate a fontmanifest.json file, but the fonts may be bad, and the axis values in the fontmanifest.json file may be incorrect.