alerque / libertinus

The Libertinus font family
Other
928 stars 57 forks source link

Build process is broken due to changes in ufoLib2 #500

Closed cionx closed 2 years ago

cionx commented 2 years ago

Describe the bug The current build script tools/build.py seems to be broken.

Steps to reproduce Following the build instructions in the README.md, clone the repository and then run fontship make.

Expected vs. actual behavior I expect the fonts to build. But instead, the build process immediately crashes.

Screenshots / logs

$ cd /tmp
$ git clone https://github.com/alerque/libertinus.git
Cloning into 'libertinus'...
remote: Enumerating objects: 8929, done.
remote: Counting objects: 100% (86/86), done.
remote: Compressing objects: 100% (74/74), done.
remote: Total 8929 (delta 45), reused 34 (delta 11), pack-reused 8843
Receiving objects: 100% (8929/8929), 237.41 MiB | 6.25 MiB/s, done.
Resolving deltas: 100% (6114/6114), done.
$ cd libertinus 
$ fontship make
┏━ Welcome to Fontship v0.8.2
┠─ Everything seems to be ship shape, anchors up!
┣━ Building target(s) using ‘make’
┠┄ Starting make job for target: .fontship
┠┄ Finished make job for target: .fontship
┠┄ Starting make job for target: .fontship/LibertinusSerif-Semibold-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerif-Regular-normalized.sfd
┠┄ Starting make job for target: .fontship/last-commit
┠┄ Starting make job for target: .fontship/LibertinusSerif-Bold-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerif-SemiboldItalic-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerif-Italic-normalized.sfd
┠┄ Finished make job for target: .fontship/last-commit
┠┄ Starting make job for target: .fontship/LibertinusSerif-BoldItalic-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusSerif-Bold-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSans-Regular-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusSerif-BoldItalic-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSans-Bold-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusSerif-Semibold-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSans-Italic-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusSerif-Regular-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusMath-Regular-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusSerif-Italic-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusMono-Regular-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusSerif-SemiboldItalic-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusKeyboard-Regular-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusMono-Regular-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerifDisplay-Regular-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusKeyboard-Regular-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerifInitials-Regular-normalized.sfd
┠┄ Finished make job for target: .fontship/LibertinusSans-Regular-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerif-Regular-instance.otf
┠┄ Finished make job for target: .fontship/LibertinusSans-Bold-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerif-Semibold-instance.otf
┠┄ Finished make job for target: .fontship/LibertinusSans-Italic-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerif-Bold-instance.otf
┠┄ Finished make job for target: .fontship/LibertinusSerifInitials-Regular-normalized.sfd
┠┄ Starting make job for target: .fontship/LibertinusSerif-Italic-instance.otf
┠┄ Failed make job for target: .fontship/LibertinusSerif-Regular-instance.otf
┠┄ Failed make job for target: .fontship/LibertinusSerif-Semibold-instance.otf
┠┄ Failed make job for target: .fontship/LibertinusSerif-Bold-instance.otf
┠┄ Finished make job for target: .fontship/LibertinusSerifDisplay-Regular-normalized.sfd
┠┄ Failed make job for target: .fontship/LibertinusSerif-Italic-instance.otf
┠┄ Finished make job for target: .fontship/LibertinusMath-Regular-normalized.sfd
┖┄ Dumping captured output of ‘make’
Traceback (most recent call last):
File "/tmp/libertinus/tools/build.py", line 273, in <module>
main()
File "/tmp/libertinus/tools/build.py", line 268, in main
font = Font(args.input, args.feature_file)
File "/tmp/libertinus/tools/build.py", line 14, in __init__
self._font = font = ufoLib2.Font(validate=False)
TypeError: Font.__init__() got an unexpected keyword argument 'validate'
make: *** [/usr/share/fontship/rules/rules.mk:282: .fontship/LibertinusSerif-Regular-instance.otf] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
File "/tmp/libertinus/tools/build.py", line 273, in <module>
main()
File "/tmp/libertinus/tools/build.py", line 268, in main
font = Font(args.input, args.feature_file)
File "/tmp/libertinus/tools/build.py", line 14, in __init__
self._font = font = ufoLib2.Font(validate=False)
TypeError: Font.__init__() got an unexpected keyword argument 'validate'
make: *** [/usr/share/fontship/rules/rules.mk:282: .fontship/LibertinusSerif-Semibold-instance.otf] Error 1
Traceback (most recent call last):
File "/tmp/libertinus/tools/build.py", line 273, in <module>
main()
File "/tmp/libertinus/tools/build.py", line 268, in main
font = Font(args.input, args.feature_file)
File "/tmp/libertinus/tools/build.py", line 14, in __init__
self._font = font = ufoLib2.Font(validate=False)
TypeError: Font.__init__() got an unexpected keyword argument 'validate'
make: *** [/usr/share/fontship/rules/rules.mk:282: .fontship/LibertinusSerif-Bold-instance.otf] Error 1
Traceback (most recent call last):
File "/tmp/libertinus/tools/build.py", line 273, in <module>
main()
File "/tmp/libertinus/tools/build.py", line 268, in main
font = Font(args.input, args.feature_file)
File "/tmp/libertinus/tools/build.py", line 14, in __init__
self._font = font = ufoLib2.Font(validate=False)
TypeError: Font.__init__() got an unexpected keyword argument 'validate'
make: *** [/usr/share/fontship/rules/rules.mk:282: .fontship/LibertinusSerif-Italic-instance.otf] Error 1
┎┄ End dump
┗━ Fontship run complete
Error: Custom { kind: InvalidInput, error: "Make failed to execute a recipe." }

Additional context The problem seems to lie in the following line: https://github.com/alerque/libertinus/blob/7625ca761348c857075b89115697053f3f70e3a6/tools/build.py#L14 I checked the ufoLib2 documentation and the parameter validate does not seem to exist anymore. From what I can tell, it was removed in https://github.com/fonttools/ufoLib2/commit/ecf9390f26ebf9c5984a2e9e3e5a739450885e91.

It seems to me that simply removing the parameter validate=False seems to be enough to make the build process work again. (I tested this on my local machine.) But I don’t understand the build process well enough to guarantee that this doesn’t break anything in the resulting font files.

alerque commented 2 years ago

I can confirm, there does seem to be some new problem and it does seem to be ufoLib2 related. There was a release a little while back so it may be in there. On the other hand I checked some UFO based projects such as Raleway that build with fontship but from UFO sources, so I'm guessing this might actually be specific to handling SFD sources. I'll look into it, but maybe not for a few days.

alerque commented 2 years ago

In case it is useful to you to build the font now as opposed to whenever I figure this out, I can confirm that the Docker images released at the time Fontship was last released still work to build this font. It is only local installs that have newer libraries that what was current when I released v0.8.2 that are causing trouble.

$ alias fontship-docker='docker run -it --volume "$(pwd):/data" --user "$(id -u):$(id -g)" theleagueof/fontship:latest'
$ fontship-docker make

Also the CI still works so if you submit a PR it will build remotely and you can download artifacts.

alerque commented 2 years ago

Thanks both for the report and for tracking down the cause @cionx. I hope you don't mind I marked you as the co-author of the fixing commit (51dc0ba) because after some review it seemed to me like that was the right solution. This should build easily again (tested with fontship most recent stable v0.8.2 and the current Git HEAD v0.8.2.r16.g33e4ab0).