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

Package too big, is there a work-around? #20

Closed
fsvaren opened this issue Jun 13, 2024 · 11 comments
Closed

Package too big, is there a work-around? #20

fsvaren opened this issue Jun 13, 2024 · 11 comments
Assignees

Comments

@fsvaren
Copy link

fsvaren commented Jun 13, 2024

Describe the bug
When trying to use this, I always run into this problem:

go: downloading github.com/gmlewis/go-fonts v0.0.14
go: github.com/gmlewis/go-fonts/fonts: create zip: module source tree too large (max size is 524288000 bytes)

Probably because of all the fonts included, is there a way around it except forking and remove things not needed?

To Reproduce
Create an empty file and paste what is in the example:

import (
  "github.com/gmlewis/go-fonts/fonts"
  _ "github.com/gmlewis/go-fonts/fonts/ubuntumonoregular"
)

go get github.com/gmlewis/go-fonts/fonts

Expected behavior
A usable package downloaded to use the fonts

@gmlewis gmlewis self-assigned this Jun 13, 2024
@gmlewis
Copy link
Owner

gmlewis commented Jun 13, 2024

Thank you for the report, @fsvaren !

According to this: golang/go#40780 (comment)
if I add a go.mod to each font subdirectory, then this should fix the problem.

@fsvaren
Copy link
Author

fsvaren commented Jun 13, 2024

Lovely!
I realize you are doing this in your spare time and it is open source and all that, but when do you think you will be able to do it?

@gmlewis
Copy link
Owner

gmlewis commented Jun 13, 2024

I'm working on it right now... It looks like it might have to be a two-step process... two separate releases.
I'll report back when it appears to work.

@fsvaren
Copy link
Author

fsvaren commented Jun 13, 2024

Awesome, would it be possible to use an older release with fewer fonts in the meantime?

@gmlewis
Copy link
Owner

gmlewis commented Jun 13, 2024

Sure.

@gmlewis
Copy link
Owner

gmlewis commented Jun 13, 2024

I believe this issue is now solved with release v0.16.0:

glenn@glenn-OMEN-875 /tmp/i20  $ cat main.go
import (
  "github.com/gmlewis/go-fonts/fonts"
  _ "github.com/gmlewis/go-fonts/fonts/ubuntumonoregular"
)
glenn@glenn-OMEN-875 /tmp/i20  $ go get github.com/gmlewis/go-fonts/fonts
go: downloading github.com/gmlewis/go-fonts v0.16.0
go: added github.com/fogleman/gg v1.3.0
go: added github.com/gmlewis/go-fonts v0.16.0
go: added github.com/gmlewis/go3d v0.0.4
go: added github.com/gmlewis/ponoko2d v0.0.0-20190404133045-d77d370bec9a
go: added github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
go: added github.com/yofu/dxf v0.0.0-20190710012328-5a6d1e83f16c
go: added golang.org/x/image v0.15.0
go: added google.golang.org/protobuf v1.34.1

Closing as fixed.

@gmlewis gmlewis closed this as completed Jun 13, 2024
@fsvaren
Copy link
Author

fsvaren commented Jun 14, 2024

Fantastic, thank you!
Do you know if https://pkg.go.dev/github.com/gmlewis/go-fonts will be updated automatically or if some manual steps are required to release it?

@gmlewis
Copy link
Owner

gmlewis commented Jun 14, 2024

Fantastic, thank you! Do you know if https://pkg.go.dev/github.com/gmlewis/go-fonts will be updated automatically or if some manual steps are required to release it?

I had to visit the URL: https://pkg.go.dev/github.com/gmlewis/[email protected]
and request that it grab the latest, but it appears to refuse to update even after many attempts, and I'm not sure what is wrong.
So I went ahead and filed an issue here: golang/go#67996

Thank you, @fsvaren ... you are greatly appreciated!

@gmlewis
Copy link
Owner

gmlewis commented Jun 28, 2024

It turns out that this repo is just too large
and I need to move the fonts out to separate repos.

Reopening issue in order to work on this.

@gmlewis gmlewis reopened this Jun 28, 2024
@gmlewis
Copy link
Owner

gmlewis commented Jun 28, 2024

For the least disruptive change, I'm thinking of breaking this up by the first letter of the name of the font... lowercase a-z:

github.com/gmlewis/go-fonts-a/fonts/aaarghnormal
...
github.com/gmlewis/go-fonts-b/fonts/baloo
...
github.com/gmlewis/go-fonts-z/fonts/znikomitno24

Please let me know if there are any objections.

@gmlewis
Copy link
Owner

gmlewis commented Jun 29, 2024

I believe this is now resolved and the documentation is available here:
https://pkg.go.dev/github.com/gmlewis/[email protected]/fonts

From the README.md:

As of version v0.18.0, all fonts have been moved to separate repos
due to the original repo being just too huge.

They are now organized by the first letter of the name of the font:

github.com/gmlewis/go-fonts-a/fonts/aaarghnormal
...
github.com/gmlewis/go-fonts-b/fonts/baloo
...
github.com/gmlewis/go-fonts-z/fonts/znikomitno24

Closing issue as resolved.

@gmlewis gmlewis closed this as completed Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants