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

Remove zip build dependency #77

Closed
wants to merge 1 commit into from

Conversation

jannis-baum
Copy link
Owner

Close #76

@jannis-baum
Copy link
Owner Author

Hey @tuurep let me know if this works for you and Arch has tar by default, i.e. if this would get rid of a build dependency :)

@jannis-baum jannis-baum force-pushed the issue/76-remove-zip-build-dependency branch from 9605444 to eb537d4 Compare July 12, 2024 08:03
@tuurep
Copy link
Collaborator

tuurep commented Jul 12, 2024

Lets be careful with this

I think there's a reason that the AUR system uses specifically bsdtar and not tar, and with tar you're creating a file with .zip extension but its file type is not that

^ warning - I don't really know what I'm talking about but here goes some testing and observations:

Case: tar

$ tar --auto-compress --create --file static.zip static

File type:

$ file static.zip
static.zip: POSIX tar archive (GNU)

Size:

$ du -sh static
1.2M	static
$ du -sh static.zip
1.2M	static.zip

Trying to extract using unzip:

$ unzip static.zip
Archive:  static.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of static.zip or
        static.zip.zip, and cannot find static.zip.ZIP, period.

Case: bsdtar

$ bsdtar --auto-compress --create --file static.zip static

File type:

$ file static.zip
static.zip: Zip archive data, at least v2.0 to extract, compression method=store

Size:

$ du -sh static
1.2M	static
$ du -sh static.zip
872K	static.zip

Trying to extract using unzip:

$ unzip static.zip
Archive:  static.zip
   creating: static/
  inflating: static/highlight.css
   creating: static/katex/
  inflating: static/client.js
  inflating: static/style.css
   creating: static/katex/fonts/
  inflating: static/katex/katex.css
  inflating: static/katex/fonts/KaTeX_Size4-Regular.woff
  inflating: static/katex/fonts/KaTeX_Size4-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Size2-Regular.woff2
  inflating: static/katex/fonts/KaTeX_Main-Italic.woff
  inflating: static/katex/fonts/KaTeX_SansSerif-Italic.woff
  inflating: static/katex/fonts/KaTeX_AMS-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Fraktur-Bold.ttf
  inflating: static/katex/fonts/KaTeX_Main-Bold.woff
  inflating: static/katex/fonts/KaTeX_Main-BoldItalic.woff
  inflating: static/katex/fonts/KaTeX_SansSerif-Italic.ttf
  inflating: static/katex/fonts/KaTeX_SansSerif-Regular.woff
  inflating: static/katex/fonts/KaTeX_SansSerif-Italic.woff2
  inflating: static/katex/fonts/KaTeX_Fraktur-Regular.woff
  inflating: static/katex/fonts/KaTeX_Typewriter-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Caligraphic-Regular.woff
  inflating: static/katex/fonts/KaTeX_Math-BoldItalic.woff
  inflating: static/katex/fonts/KaTeX_Size4-Regular.woff2
  inflating: static/katex/fonts/KaTeX_Fraktur-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Main-Bold.ttf
  inflating: static/katex/fonts/KaTeX_Script-Regular.woff2
  inflating: static/katex/fonts/KaTeX_Caligraphic-Bold.woff
  inflating: static/katex/fonts/KaTeX_Size3-Regular.woff2
  inflating: static/katex/fonts/KaTeX_Typewriter-Regular.woff2
  inflating: static/katex/fonts/KaTeX_AMS-Regular.woff2
  inflating: static/katex/fonts/KaTeX_Size1-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Script-Regular.woff
  inflating: static/katex/fonts/KaTeX_Caligraphic-Regular.woff2
  inflating: static/katex/fonts/KaTeX_Size2-Regular.woff
  inflating: static/katex/fonts/KaTeX_Fraktur-Bold.woff
  inflating: static/katex/fonts/KaTeX_Size1-Regular.woff2
  inflating: static/katex/fonts/KaTeX_Caligraphic-Bold.woff2
  inflating: static/katex/fonts/KaTeX_AMS-Regular.woff
  inflating: static/katex/fonts/KaTeX_Size3-Regular.woff
  inflating: static/katex/fonts/KaTeX_Math-BoldItalic.woff2
  inflating: static/katex/fonts/KaTeX_Size2-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Caligraphic-Bold.ttf
  inflating: static/katex/fonts/KaTeX_Math-BoldItalic.ttf
  inflating: static/katex/fonts/KaTeX_SansSerif-Regular.ttf
  inflating: static/katex/fonts/KaTeX_SansSerif-Regular.woff2
  inflating: static/katex/fonts/KaTeX_Main-BoldItalic.ttf
  inflating: static/katex/fonts/KaTeX_Main-Regular.woff
  inflating: static/katex/fonts/KaTeX_Main-BoldItalic.woff2
  inflating: static/katex/fonts/KaTeX_SansSerif-Bold.woff
  inflating: static/katex/fonts/KaTeX_Script-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Typewriter-Regular.woff
  inflating: static/katex/fonts/KaTeX_Math-Italic.woff
  inflating: static/katex/fonts/KaTeX_Caligraphic-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Main-Italic.woff2
  inflating: static/katex/fonts/KaTeX_Math-Italic.ttf
  inflating: static/katex/fonts/KaTeX_Main-Italic.ttf
  inflating: static/katex/fonts/KaTeX_Size1-Regular.woff
  inflating: static/katex/fonts/KaTeX_Size3-Regular.ttf
  inflating: static/katex/fonts/KaTeX_SansSerif-Bold.woff2
  inflating: static/katex/fonts/KaTeX_Main-Regular.ttf
  inflating: static/katex/fonts/KaTeX_Main-Bold.woff2
  inflating: static/katex/fonts/KaTeX_Main-Regular.woff2
  inflating: static/katex/fonts/KaTeX_SansSerif-Bold.ttf
  inflating: static/katex/fonts/KaTeX_Math-Italic.woff2
  inflating: static/katex/fonts/KaTeX_Fraktur-Bold.woff2
  inflating: static/katex/fonts/KaTeX_Fraktur-Regular.woff2

@jannis-baum
Copy link
Owner Author

Oh, very interesting and also strange... On my system it's different

» tar --auto-compress --create --file test.zip static      
» file test.zip 
test.zip: Zip archive data, at least v2.0 to extract, compression method=store
» du -sh test.zip 
872K	test.zip
» du -sh static  
1.2M	static

and then the unzipping definitely works through the Node library.

But actually, running tar --version gives me

bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8

so it seems my tar is actually also bsdtar...

@tuurep
Copy link
Collaborator

tuurep commented Jul 12, 2024

so it seems my tar is actually also bsdtar...

Ohh... very good that you found that out

@jannis-baum
Copy link
Owner Author

jannis-baum commented Jul 12, 2024

so it seems my tar is actually also bsdtar...

Ohh... very good that you found that out

Haha yes maybe but now I'm more confused than before. Does the linux CI-build on this branch work for you? That way we could take a guess on what kind of tar the CI has. The macOS build here works, but I assume the macOS CI also has the undercover bsdtar ^^

@jannis-baum
Copy link
Owner Author

But anyways, I guess we can just close this PR then and leave it as it was? Or do you think it's worth it to further investigate? Seems like the intersection of tools that

  1. can properly and consistently zip,
  2. are available on GitHub's ubuntu-latest runners and
  3. by default on Arch

is a very small if not empty set

@tuurep
Copy link
Collaborator

tuurep commented Jul 12, 2024

Haha yes maybe but now I'm more confused than before.

Yeah it makes sense because Linux tar = GNU tar *(usually)

Same goes for a bunch of tooling:

https://ponderthebits.com/2017/01/know-your-tools-linux-gnu-vs-mac-bsd-command-line-utilities-grep-strings-sed-and-find/

@jannis-baum
Copy link
Owner Author

Makes sense. On macOS we have the GNU tools (if at all) with a g prefix, e.g. gsed. I don't actually have gtar though ^^

Anyways, what do you think about dropping this vs. trying to find a solution that fulfills the three cases?

  1. can properly and consistently zip,
  2. are available on GitHub's ubuntu-latest runners and
  3. by default on Arch

@tuurep
Copy link
Collaborator

tuurep commented Jul 12, 2024

But anyways, I guess we can just close this PR then and leave it as it was? Or do you think it's worth it to further investigate? Seems like the intersection of tools that

1. can properly and consistently zip,

2. are available on GitHub's `ubuntu-latest` runners and

3. by default on Arch

is a very small if not empty set

Yeah here's what I think:

I can use bsdtar directly in the AUR PKGBUILD if I want to avoid the zip build dependency and it's fine that it's just my problem 😄

@jannis-baum
Copy link
Owner Author

Oki sounds good! Closing this then

@jannis-baum jannis-baum deleted the issue/76-remove-zip-build-dependency branch July 13, 2024 02:55
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

Successfully merging this pull request may close these issues.

Remove zip build dependency
2 participants