marhop / pandoc-unicode-math

Replace Unicode symbols by equivalent Latex commands
BSD 3-Clause "New" or "Revised" License
26 stars 7 forks source link

MacOS binaries? #5

Closed RobertGoulding closed 1 year ago

RobertGoulding commented 5 years ago

Any chance of getting a binary for MacOS?

marhop commented 5 years ago

I don't have access to a MacOS computer, so I asked a friend to build binaries for me. He will see what he can do. But if you don't want to wait and decide to build from source yourself, I would gladly add your binaries to my GitHub release page. ;-)

RobertGoulding commented 5 years ago

Thank you!

On Tue, Sep 3, 2019 at 3:51 PM Martin Hoppenheit notifications@github.com wrote:

I don't have access to a MacOS computer, so I asked a friend to build binaries for me. He will see what he can do. But if you don't want to wait and decide to build from source yourself, I would gladly add your binaries to my GitHub release page. ;-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marhop/pandoc-unicode-math/issues/5?email_source=notifications&email_token=AFNDSDTL2F5N5ZLAJXPW54LQH2557A5CNFSM4IS6QEG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5ZLSRY#issuecomment-527612231, or mute the thread https://github.com/notifications/unsubscribe-auth/AFNDSDQ2GI7QA3DDXHTGYUTQH2557ANCNFSM4IS6QEGQ .

-- Robert Goulding Director, John J. Reilly Center for Science, Technology, and Values; Director, Program in History and Philosophy of Science; Assoc. Professor, Program of Liberal Studies, Fellow, Medieval Institute, University of Notre Dame.

pilattebe commented 3 years ago

Binaries for 1.2.0 pandoc-unicode-math-1.2.0-macos64.zip

But you should not trust me, I am just an otter 🦦. I suggest using GitHub Actions for automagically building binaries for Windows/Linux/Mac. I can set that up for you if you want. (Currently I've got some exams but at the end of January, I can do that)

marhop commented 3 years ago

Great, thank you! I added the binaries to the release.

Setting up GitHub actions would definitely be nice. I haven't yet had an opportunity to figure out how to do this, so I'd be grateful for a pull request if you find the time.

RobertGoulding commented 3 years ago

Thanks all - will try these out - Robert.

On Tue, Jan 5, 2021 at 3:54 PM Martin Hoppenheit notifications@github.com wrote:

Great, thank you! I added the binaries to the release https://github.com/marhop/pandoc-unicode-math/releases/tag/v1.2.0.

Setting up GitHub actions would definitely be nice. I haven't yet had an opportunity to figure out how to do this, so I'd be grateful for a pull request if you find the time.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/marhop/pandoc-unicode-math/issues/5#issuecomment-754893011, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNDSDXKZFQH6SS652WTQHLSYN4AHANCNFSM4IS6QEGQ .

-- Robert Goulding Director, John J. Reilly Center for Science, Technology, and Values; Director, Program in History and Philosophy of Science; Assoc. Professor, Program of Liberal Studies, Fellow, Medieval Institute, University of Notre Dame.

pilattebe commented 3 years ago

@marhop

I may have spoken too soon, the binaries are built according to the doc (stack setup, build, install), but I was unable to use them in a project.

pandoc-unicode-math: Error in $: Incompatible API versions: encoded with [1,20] but attempted to decode with [1,17,6,1].
CallStack (from HasCallStack):
  error, called at ./Text/Pandoc/JSON.hs:106:64 in pandoc-types-1.17.6.1-6OqhlmOaK7t1wFyRc1dc2J:Text.Pandoc.JSON
Error running filter /Users/user/.local/bin/pandoc-unicode-math:
Filter returned error status 1
pilattebe commented 3 years ago

I may have missed compiling flags or something, the binaries are unexpectedly small.

Screen Shot 2021-01-05 at 22 42 07
marhop commented 3 years ago

Don't worry, that looks more like my fault. The resolver version in stack.yaml is pretty old, that probably leads to incompatible library versions. I will try to fix this tomorrow.

pilattebe commented 3 years ago

👌 Perfect 👌 That will happen less when GitHub Actions are enabled. I want to do it but I really have to focus on my exams right now.

Looks like GitHub Actions environment come with everything necessary: GHC 8.10.2 Cabal 3.2.0.0 Stack 2.5.1

This issue should be closed in favor of a new one when the versioning is fixed to avoid spamming Robert

pilattebe commented 3 years ago

Can compiling to LLVM make the binaries more portable ? https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/code-generators.html That would mean a program compiled on linux would run on macOS (and vice versa) which would bypass this issue entirely (still got to see how llvm works with pandoc but it should run fine)

pilattebe commented 3 years ago

Urg ! I'm sorry, my brain bugged, I thought the last commit in December 2019 was last month and this repo was in active development.

Anyway, I'm interested in this project but I'm not sure I can do much with GitHub Actions unless I have the "collaborator" role.

marhop commented 3 years ago

Hi there, I'm still busy updating the dependency versions which requires more changes in the source code than I anticipated, so I will probably need one (or maybe two) more evenings to do it properly ... I'll get back to you as soon as possible!

marhop commented 3 years ago

OK, so I published two new releases, one for compatibility with Pandoc 2.8 and 2.9 (release 2.0.0, this should work with your setup), and one for Pandoc 2.10 (release 3.0.0).

Please note that I also changed the build process - Stack is not necessary anymore, just Cabal (which you should have installed already if Stack works for you).

PS: Now that I think of it, you might run into problems during the build because I possibly set the version bounds in the *.cabal file too tight. It worked for me with GHC 8.8.4 but YMMV ... I'll check with GHC 8.10 in the next days. You should be able to work around this by removing all version constraints (in the build-depends field) except the one for pandoc-types though.

pilattebe commented 3 years ago

like you said...

Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: pandoc-unicode-math-3.0.0 (user goal)
[__1] next goal: base (dependency of pandoc-unicode-math)
[__1] rejecting: base-4.14.0.0/installed-4.14.0.0 (conflict:
pandoc-unicode-math => base>=4.13 && <4.14)
[__1] skipping: base-4.14.1.0, base-4.14.0.0 (has the same characteristics
that caused the previous version to fail: excluded by constraint '>=4.13 &&
<4.14' from 'pandoc-unicode-math')
[__1] rejecting: base-4.13.0.0, base-4.12.0.0, base-4.11.1.0, base-4.11.0.0,
base-4.10.1.0, base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0,
base-4.8.1.0, base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0,
base-4.6.0.1, base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0,
base-4.4.0.0, base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1,
base-4.2.0.0, base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1
(constraint from non-upgradeable package requires installed instance)
[__1] fail (backjumping, conflict set: base, pandoc-unicode-math)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, pandoc-unicode-math
pilattebe commented 3 years ago

I've massaged the versions until it worked for me:

-- Calling this pandoc-unicode-math-to-latex would neither be pretty nor
-- backwards compatible.
executable pandoc-unicode-math
  hs-source-dirs:    src
  main-is:           UnicodeToLatex.hs
  ghc-options:       -main-is UnicodeToLatex
  build-depends:     base >= 4.13
                   , containers >= 0.6.2 
                   , pandoc-types == 1.20
                   , text
  other-modules:     MathFilter
                   , Symbols
  default-language:  Haskell2010

executable pandoc-unicode-math-from-latex
  hs-source-dirs:    src
  main-is:           LatexToUnicode.hs
  ghc-options:       -main-is LatexToUnicode
  build-depends:     base >= 4.13
                   , containers >= 0.6.2
                   , pandoc-types == 1.20
                   , pcre-heavy >= 1.0.0
                   , text
  other-modules:     MathFilter
                   , Symbols
  default-language:  Haskell2010

(I had no idea what I was doing, but hey, it works)

So here are the macOS binaries (I wasn't able to make it work with any other version of pandoc-types == 1.20): pandoc-unicode-math-3.0-macos64.zip

marhop commented 3 years ago

Again, two new releases, one for compatibility with Pandoc 2.8 and 2.9 (release 2.0.1), and one for Pandoc 2.10 (release 3.0.1). In both releases I relaxed the dependency version bounds, particularly the version constraints on the base library which is more or less tied to GHC versions - this was probably the main reason your build failed yesterday. So it should work now even without your changes, sorry for the mess so far!

PS: And thanks for the binary! Though I think it should be for release 2.0.0 (which depends on pandoc-types 1.20), not 3.0.0 (depends on pandoc-types 1.21). The distinction is important because the pandoc-types version determines compatibility with specific Pandoc versions:

If Pandoc and pandoc-types versions don't match this leads to the error you encountered above.

pilattebe commented 3 years ago

Ok, I can confirm the binary were for 2.0.0. I will recompile and double check everything tomorrow.