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

manifest generation issue with tarball target #71

Open
n7s opened this issue May 11, 2022 · 7 comments
Open

manifest generation issue with tarball target #71

n7s opened this issue May 11, 2022 · 7 comments
Assignees
Labels

Comments

@n7s
Copy link
Contributor

n7s commented May 11, 2022

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
Copy link
Contributor Author

n7s commented Jul 14, 2022

looks like self.build_manifest(bld) is missing from execute_tar()

@devosb
Copy link
Contributor

devosb commented Aug 8, 2022

looks like self.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
Copy link
Contributor

mhosken commented Aug 15, 2022

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
Copy link
Contributor

devosb commented Aug 15, 2022

I am confused.

  • I can see Tagmukay not having an axes dictionary, since it is not built from a Designspace file. Dai Banna SIL is built from a Designspace, so I don't understand why the axes dictionary is not being created.
  • smith zip and smith tarball have different behaviour. That is, even without today's fix, the zip target will run, but the tarball target will give the error of not having a manifest. Why does the behaviour change just because of the package file format (zip or tar)?

@devosb
Copy link
Contributor

devosb commented Aug 15, 2022

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
Copy link
Contributor

devosb commented Aug 16, 2022

@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
Copy link
Contributor

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.

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

4 participants