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

[MacOS][Test Runner] build #179

Open
AaronNGray opened this issue Feb 20, 2025 · 32 comments
Open

[MacOS][Test Runner] build #179

AaronNGray opened this issue Feb 20, 2025 · 32 comments
Assignees

Comments

@AaronNGray
Copy link

AaronNGray commented Feb 20, 2025

uconv is missing on :-
https://github.com/kermitt2/pdfalto/actions/runs/13424243421/job/37503837019#step:5:20

https://github.com/AaronNGray/pdfalto/actions/runs/13435341396/job/37536256574#step:4:263

Warning: No available formula with the name "uconv". Did you mean uggconv, ucon64, cconv or unoconv?
uconv is part of the icu4c formula:
  brew install icu4c

but uconv is still not found on either :-

brew install icu4c

or

brew reinstall icu4c@76
@lfoppiano
Copy link
Collaborator

lfoppiano commented Feb 21, 2025

I think I fixed the problem with macos. Not sure it's the best way, though. The build seems working now 😄

@lfoppiano lfoppiano self-assigned this Feb 21, 2025
@AaronNGray
Copy link
Author

AaronNGray commented Feb 21, 2025

Seems to be working with the ucon64 brew package.

There seems to be an issues with macos-14 binary object versions :-
ld: warning: object file (libs/image/png/mac/arm64/libpng.a[2](png.c.o)) was built for newer 'macOS' version (14.4) than being linked (14.0)
https://github.com/kermitt2/pdfalto/actions/runs/13457268780/job/37603922122#step:8:783

This will be sorted out with an ICU built for MacOS-14.4.

Also it looks like builds for macos-latest and macos-14 are exactly the same ?!
https://github.com/AaronNGray/github-arm64-action-runner-tests/blob/main/.github/workflows/github-action-runner-tests.yml#L40

@AaronNGray AaronNGray changed the title [MacOS][Test Runner] **uconv** is missing [MacOS][Test Runner] build Feb 21, 2025
@AaronNGray
Copy link
Author

@lfoppiano Do you know what this is and whether it can just be removed ?

clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
https://github.com/kermitt2/pdfalto/actions/runs/13457268780/job/37603922122#step:8:782

@AaronNGray
Copy link
Author

I have made a pull request to deal with sprinft buffer overflows.
#182

@AaronNGray
Copy link
Author

I think this needs modifying too, can you double check the logic :-
https://github.com/kermitt2/pdfalto/blob/master/src/XmlAltoOutputDev.cc#L4793

/Users/runner/work/pdfalto/pdfalto/src/XmlAltoOutputDev.cc:4793:34: warning: equality comparison result unused [-Wunused-comparison]
                        nextWord == NULL;
                        ~~~~~~~~~^~~~~~~
/Users/runner/work/pdfalto/pdfalto/src/XmlAltoOutputDev.cc:4793:34: note: use '=' to turn this equality comparison into an assignment
                        nextWord == NULL;
                                 ^~
                                 =

patch :-
AaronNGray@20848be

@AaronNGray
Copy link
Author

AaronNGray commented Feb 21, 2025

I modified all the wchar_t's to UChar32's in XmlAltoOutputDev.cc and now it will be compiling correctly for *nix platforms, but possibly or possibly not for Windows platforms ?

AaronNGray@9170d5b

This allows Ubuntu ARM64 to compile now, but there are linker errors with libs/image/png/linux/64/libpng.a as theres no Ubuntu/ARM64 of libpng avaliable.

https://github.com/AaronNGray/pdfalto/actions/runs/13462391056/job/37620573101#step:9:555

@AaronNGray
Copy link
Author

AaronNGray commented Feb 21, 2025

There is a regression in the Ubuntu-24.04/x64 ICU 77 binaries that were added, otherwise this should build.

https://github.com/AaronNGray/pdfalto/actions/runs/13462391056/job/37620572383#step:9:554

@AaronNGray
Copy link
Author

@lfoppiano Ideally we move xpdf to a separate project and linked with headers and binary as its built each time and should really be dealt with separately ?

@lfoppiano
Copy link
Collaborator

Seems to be working with the ucon64 brew package.

There seems to be an issues with macos-14 binary object versions :- ld: warning: object file (libs/image/png/mac/arm64/libpng.a[2](png.c.o)) was built for newer 'macOS' version (14.4) than being linked (14.0) https://github.com/kermitt2/pdfalto/actions/runs/13457268780/job/37603922122#step:8:783

This is probably because i built the libpng on my mac and I was using 14.4. If we automate the build of those libraries too we should solve the issue, but we can deal with this later.

This will be sorted out with an ICU built for MacOS-14.4.

Also it looks like builds for macos-latest and macos-14 are exactly the same ?! https://github.com/AaronNGray/github-arm64-action-runner-tests/blob/main/.github/workflows/github-action-runner-tests.yml#L40

Oh 😮

@lfoppiano
Copy link
Collaborator

There is a regression in the Ubuntu-24.04/x64 ICU 77 binaries that were added, otherwise this should build.

https://github.com/AaronNGray/pdfalto/actions/runs/13462391056/job/37620572383#step:9:554

@AaronNGray I think the ICU was updated only on mac, not the Linux binaries 🤔 edf1944

@lfoppiano
Copy link
Collaborator

@lfoppiano Do you know what this is and whether it can just be removed ?

clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument] https://github.com/kermitt2/pdfalto/actions/runs/13457268780/job/37603922122#step:8:782

I've no idea, but it's a warning so let's leave it for the moment

https://stackoverflow.com/questions/47778099/what-is-no-pie-used-for

@lfoppiano
Copy link
Collaborator

@lfoppiano Ideally we move xpdf to a separate project and linked with headers and binary as its built each time and should really be dealt with separately ?

Sure, but after everything else works 😄

@lfoppiano
Copy link
Collaborator

I've cleaned up the cmake build so that the linux ARM architecture is correctly recognised. It fails now because the arm64 directory under libs does not exists.

The linux 64 fails on certain problems with icu-77, I cannot identify the issue there, but this build should work as all the libraries are there. I'm not sure 🤔

@AaronNGray
Copy link
Author

Okay I have been having tooling issues with GitHub Actions and have had to raise a couple of issues with GitHub. Sorry I got distracted by tooling issues. I will bypass this and will have a go at both generate ICU binaries for Ubuntu/ARM64 and continue with getting ICU patches for MacOS and Ubuntu as a pull request.

@lfoppiano
Copy link
Collaborator

No problem, absolutely, I'm working on other part of pdfalto which I can handle.
I could take care of the build, later one, as C/C++ problems are not within my expertise.

@AaronNGray
Copy link
Author

AaronNGray commented Feb 27, 2025

icu_77 namespace is not being found which means the headers are 77-1 (main) and the binary libraries are probably 76-1 ?

https://github.com/kermitt2/pdfalto/blob/feature/update-external-libraries/libs/icu/common/unicode/uvernum.h#L56

https://github.com/kermitt2/pdfalto/actions/runs/13564890492/job/37915687473#step:8:181

  "icu_77::Normalizer2::getNFKCInstance(UErrorCode&)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UnicodeString::UnicodeString(int)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UnicodeString::~UnicodeString()", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      ...
  "icu_77::UnicodeString::operator=(icu_77::UnicodeString&&)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UnicodeString::operator=(icu_77::UnicodeString const&)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UMemory::operator delete(void*)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UMemory::operator new(unsigned long)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      ...
  "vtable for icu_77::UnicodeString", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
Undefined symbols for architecture arm64:
   "icu_77::Normalizer2::getNFKCInstance(UErrorCode&)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UnicodeString::UnicodeString(int)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UnicodeString::~UnicodeString()", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      ...
  "icu_77::UnicodeString::operator=(icu_77::UnicodeString&&)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UnicodeString::operator=(icu_77::UnicodeString const&)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UMemory::operator delete(void*)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
  "icu_77::UMemory::operator new(unsigned long)", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      ...
  "vtable for icu_77::UnicodeString", referenced from:
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextWord::TextWord(GList*, int, int, int, int, int, GfxState*, TextFontInfo*, double, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
      TextRawWord::addChar(GfxState*, double, double, double, double, unsigned int, unsigned int, int, int, TextFontInfo*, double, SplashFont*, int, int, int) in XmlAltoOutputDev.cc.o
   NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "_iconv", referenced from:
      _xmlIconvWrapper in libxml2.a[8](encoding.c.o)
  "_iconv_close", referenced from:
      _xmlCharEncCloseFunc in libxml2.a[8](encoding.c.o)
      _xmlCharEncCloseFunc in libxml2.a[8](encoding.c.o)
      _xmlCreateIconvHandler in libxml2.a[8](encoding.c.o)
      _xmlCreateIconvHandler in libxml2.a[8](encoding.c.o)
  "_iconv_open", referenced from:
      _xmlCreateIconvHandler in libxml2.a[8](encoding.c.o)
      _xmlCreateIconvHandler in libxml2.a[8](encoding.c.o)
  "_u_iscntrl_77", referenced from:
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
  "_u_isdefined_77", referenced from:
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o
      TextPage::dumpFragment(unsigned int*, int, UnicodeMap*, GString*) in XmlAltoOutputDev.cc.o

@AaronNGray
Copy link
Author

AaronNGray commented Feb 27, 2025

@lfoppiano - Not sure what is going on here ?

I would get it working with the old versions of the libraries first, then make sure everything compiles and links, before then check for any security vulnerabilities in the libraries before updating them. And on updating the libraries make sure the headers are the same version obviously.

https://github.com/kermitt2/pdfalto/actions/runs/13564890492/job/37915687473#step:8:171

Undefined symbols for architecture arm64:
  "_BZ2_bzDecompress", referenced from:
      _ft_bzip2_file_fill_output in libfreetype.a[22](ftbzip2.c.o)
  "_BZ2_bzDecompressEnd", referenced from:
      _ft_bzip2_file_reset in libfreetype.a[22](ftbzip2.c.o)
      _ft_bzip2_file_done in libfreetype.a[22](ftbzip2.c.o)
  "_BZ2_bzDecompressInit", referenced from:
      _ft_bzip2_file_init in libfreetype.a[22](ftbzip2.c.o)
      _ft_bzip2_file_reset in libfreetype.a[22](ftbzip2.c.o)
  "_BrotliDecoderDecompress", referenced from:
      _woff2_decompress in libfreetype.a[35](sfnt.c.o)

https://github.com/kermitt2/pdfalto/actions/runs/13564890492/job/37915687473#step:8:229

  "_hb_blob_create", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
      _hb_ft_reference_table_ in libfreetype.a[2](autofit.c.o)
  "_hb_blob_destroy", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_add_utf8", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_clear_contents", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_create", referenced from:
      _af_shaper_buf_create in libfreetype.a[2](autofit.c.o)
      _af_face_globals_new in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_destroy", referenced from:
      _af_shaper_buf_destroy in libfreetype.a[2](autofit.c.o)
      _af_face_globals_free in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_get_glyph_infos", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_elem in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_get_glyph_positions", referenced from:
      _af_shaper_get_elem in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_get_length", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_guess_segment_properties", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_face_create", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_face_create_for_tables", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_face_destroy", referenced from:
      _hb_ft_font_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_face_set_index", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_face_set_upem", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_font_create", referenced from:
      _hb_ft_font_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_font_destroy", referenced from:
      _af_face_globals_free in libfreetype.a[2](autofit.c.o)
  "_hb_font_get_face", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_font_set_scale", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_ot_layout_collect_lookups", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_ot_layout_lookup_collect_glyphs", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_ot_layout_lookup_would_substitute", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_ot_tags_from_script_and_language", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_create", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_destroy", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_is_empty", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_next", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_subtract", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_shape", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)

@lfoppiano
Copy link
Collaborator

lfoppiano commented Feb 28, 2025

@AaronNGray Indeed, there was a compromise between having obsolete libraries and getting them working for ARM, so I guess we can try to make these latest libraries working?

I think the ICU libs/icu/commons/unicode was updated by you in edf1944, maybe you used 77-1? I updated the static library to the latest released version, I did not feel like updating to the master version

The includes under libs were updated only for libpng and zlib if I'm not mistaken.

@lfoppiano
Copy link
Collaborator

OK, so I've updated the include in icu (please check that I did not wipe out anything you added (sorry in advance for that)), libxml and freetype (I will include them in the static library build).

Now for mac we have one error:

 /Users/runner/work/pdfalto/pdfalto/src/Parameters.cc:93:15: error: use of undeclared identifier 'malloc'
        tmp=(char*)malloc(10*sizeof(char));
                   ^
/Users/runner/work/pdfalto/pdfalto/src/Parameters.cc:168:2: error: use of undeclared identifier 'free'
        free(tmp);
        ^
2 errors generated.
make[2]: *** [CMakeFiles/pdfalto.dir/src/Parameters.cc.o] Error 1
make[1]: *** [CMakeFiles/pdfalto.dir/all] Error 2

Also Linux build complains about (IMHO) the same issue, it seems we're getting close, hopefully

I'm going to stop doing anything here, leaving to you. 😅 If you have particular issues I'm available for help.

@AaronNGray
Copy link
Author

AaronNGray commented Feb 28, 2025 via email

@lfoppiano
Copy link
Collaborator

Yes, I added it and now only the linux build are working 😭 😂 but the macos build it does not 🤔

@AaronNGray
Copy link
Author

AaronNGray commented Feb 28, 2025

Looks like cstdlib is fine on XCode, it should be.

Theres two separate issues, one with libfreetype which looks like it might be a versioning issue, either between the binary and the headers or its an update in ./lib

clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
Undefined symbols for architecture arm64:
  "_BZ2_bzDecompress", referenced from:
      _ft_bzip2_file_fill_output in libfreetype.a[22](ftbzip2.c.o)
  "_BZ2_bzDecompressEnd", referenced from:
      _ft_bzip2_file_reset in libfreetype.a[22](ftbzip2.c.o)
      _ft_bzip2_file_done in libfreetype.a[22](ftbzip2.c.o)
  "_BZ2_bzDecompressInit", referenced from:
      _ft_bzip2_file_init in libfreetype.a[22](ftbzip2.c.o)
      _ft_bzip2_file_reset in libfreetype.a[22](ftbzip2.c.o)
  "_BrotliDecoderDecompress", referenced from:
      _woff2_decompress in libfreetype.a[35](sfnt.c.o)
  "_hb_blob_create", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
      _hb_ft_reference_table_ in libfreetype.a[2](autofit.c.o)
  "_hb_blob_destroy", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_add_utf8", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_clear_contents", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_create", referenced from:
      _af_shaper_buf_create in libfreetype.a[2](autofit.c.o)
      _af_face_globals_new in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_destroy", referenced from:
      _af_shaper_buf_destroy in libfreetype.a[2](autofit.c.o)
      _af_face_globals_free in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_get_glyph_infos", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_elem in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_get_glyph_positions", referenced from:
      _af_shaper_get_elem in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_get_length", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_buffer_guess_segment_properties", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_face_create", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_face_create_for_tables", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_face_destroy", referenced from:
      _hb_ft_font_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_face_set_index", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_face_set_upem", referenced from:
      _hb_ft_face_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_font_create", referenced from:
      _hb_ft_font_create_ in libfreetype.a[2](autofit.c.o)
  "_hb_font_destroy", referenced from:
      _af_face_globals_free in libfreetype.a[2](autofit.c.o)
  "_hb_font_get_face", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_font_set_scale", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
  "_hb_ot_layout_collect_lookups", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_ot_layout_lookup_collect_glyphs", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_ot_layout_lookup_would_substitute", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_ot_tags_from_script_and_language", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_create", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_destroy", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_is_empty", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_next", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_set_subtract", referenced from:
      _af_shaper_get_coverage in libfreetype.a[2](autofit.c.o)
  "_hb_shape", referenced from:
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)
      _af_shaper_get_cluster in libfreetype.a[2](autofit.c.o)

The other with libxml2 and iconv, again a versioning issue.
not sure if this is relevant :-
NOTE: /Users/runner/.ucon64rc not found: creating...OK
https://github.com/kermitt2/pdfalto/actions/runs/13587226035/job/37984797196#step:5:19

  "_iconv", referenced from:
      _xmlIconvWrapper in libxml2.a[8](encoding.c.o)
  "_iconv_close", referenced from:
      _xmlCharEncCloseFunc in libxml2.a[8](encoding.c.o)
      _xmlCharEncCloseFunc in libxml2.a[8](encoding.c.o)
      _xmlCreateIconvHandler in libxml2.a[8](encoding.c.o)
      _xmlCreateIconvHandler in libxml2.a[8](encoding.c.o)
  "_iconv_open", referenced from:
      _xmlCreateIconvHandler in libxml2.a[8](encoding.c.o)
      _xmlCreateIconvHandler in libxml2.a[8](encoding.c.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@AaronNGray
Copy link
Author

AaronNGray commented Feb 28, 2025

I am thinking it might have been better to fetch the libraries at build time and build them to use them rather than building and storing in ./lib ?

@lfoppiano
Copy link
Collaborator

All static libraries and includes are coming from the same version. Ideally the include population should be also automated, however, there was an issue with the flags of Libxml2 so after correcting that there is the issue with freetype and ftbzip2.

The /lib comes from history, we can change that too.
There is a makefile being worked on which could replace the install_depts.sh script , @flydutch, could you please push or create a PR to share the makefile you were working on?

@AaronNGray
Copy link
Author

AaronNGray commented Feb 28, 2025 via email

@lfoppiano
Copy link
Collaborator

Apologize for the mess.

Yes, I did create a branch called feature/working-build but then I found the problem, the flag for cmake for freetype have changed so fixing that produced a working static library. I wonder why on Linux this did not happens 🤔

https://github.com/kermitt2/pdfalto/actions/runs/13598462738

@AaronNGray
Copy link
Author

Cool, well done, now we can move forward again !

@lfoppiano
Copy link
Collaborator

IMHO, suggestion for the next steps (not in order) are:

  • build on mac x86 (I feel I should not break compatibility 😭 as many more people than I though are using) - I really cannot find how this could be done without pay for the github action large instances
  • replace the build-deps.sh with a makefile that can download and build locally, and that copy the right include in the right place. Then we could update the github actions using that. Does it make sense?
  • improve pdfalto versioning (the pdfalto version is hardcoded somewhere)
  • once the pdfalto build are streamlined, we should compare the output text across architectures and with the previous linux x86_64 pdfalto output

@AaronNGray
Copy link
Author

AaronNGray commented Mar 1, 2025

suggestion for the next steps (not in order) are:

Maybe we create a separate master issue with tick box todos ? ala ...

  • build on mac x86 (I feel I should not break compatibility 😭 as many more people than I though are using) - I really cannot find how this could be done without pay for the github action large instances [help needed] Build on macOS x86_64 #187

I have x64 Mac but it's stuck back on MacOS Catalina. Dunno if we can run GitHub self runner actions on x64 MacOS ?

  • replace the build-deps.sh with a makefile that can download and build locally, and that copy the right include in the right place.

Can this be done by a GitHub action rather than makefile ?

  • Then we could update the github actions using that. Does it make sense?

As I say if it's not too complex a GitHub action is more appropriate and easier debugged.

We can automate this properly once we have everything working with GROBID.

I have meant to be working on learning GitHub automation, but examples and documentation for doing releases are not very obvious. I need to have a go at writing an example repo that does what we need for the projects.

We ideally need some form of testing yes. Is there a make check for pdfalto if so use that. If not yes some form of comparison based tests across a number of different PDF sample types.

@lfoppiano
Copy link
Collaborator

I've added issues for each of the elements, for the Makefile, it was suggested by @flydutch, the rationale is that the full build will be reproducible locally. We can think about it later

@AaronNGray
Copy link
Author

We will need Docker file scripts for GROBID. Not sure how pdfalto works with this as It have not looked at that area in about 3 or 4 years !

@lfoppiano
Copy link
Collaborator

lfoppiano commented Mar 5, 2025

We will need Docker file scripts for GROBID. Not sure how pdfalto works with this as It have not looked at that area in about 3 or 4 years !

@AaronNGray I did not understand what you mean 🤔 . the Makefile would be only for building pdfalto + dependencies

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