Skip to content

Latest commit

 

History

History
84 lines (76 loc) · 5.27 KB

tasks.org

File metadata and controls

84 lines (76 loc) · 5.27 KB

Tasks

Implement zw3rks Cross Compilation Tutorials

Results: CrossCompilationBlogTutorial/

Android

iOS

  • Installed xcode.
  • Downloaded cross compiler.
  • Created scripts.
  • Downloaded libraries for machine.
  • Compiled statically linked archive file of the HS library.
  • Setup xcode to link app.
  • Ran app.

Compile Haskell with libraries, using most straightforward approach

Using cabal and cross-compilation flags. https://log.zw3rk.com/posts/2017-05-17-the-haskell-cabal-and-cross-compilation/ https://github.com/ghc-ios/ghc-ios-scripts

Morritz tool-chain wrapper has the wrapped ld, clang, it also has cabal, so no need to use ghc-ios-scripts.

Seems like need patched ld to link against the mobile OS libraries.

Package resolver quite essential for wide range of users.

Create a HTTP request with a haskell HTTP library.

CrossCompilationBlogTutorial/iOSProjectCabal/

Perfrom SQLite operations with Haskell SQLite library.

  • Adding the ‘sqlite’ library fails to compile due to an ambiguos function usage error (with a function (namely <>) from base).
  • Although when compiling for a newer ghc, it doesn’t get that error. This could be because cabal used a base for ghc 8.4.0 that was different for ghc 8.10.0.
  • Seems vital to be able to have flexible ghc versions so that it can integrate fully with the package resolver eco system.
  • Got ‘direct-sqlite’ to compile and link. Although haven’t properly tried creating a database, but for now assuming that it’s enough.

Attempt to compile simplex libraries and observe blocks.

  • Manually trying to change the .cabal file to work is extremely time consuming, a lot of version conflicts.
    • A stack LTS reslover for GHC 8.4.0 didn’t exist, so an older version of the resolver was used but that still caused problems, namely with the hand pinned versions of the packages.
  • Maybe with a bit of effort, can port it down to GHC 8.4.0.
  • But can see that would be much more freeing having an arbitrary version of the GHC compiler available.
    • https://github.com/simplex-chat/simplex-chat
      • GHC version 8.4.0 does not support BlockArguments
    • I havan’t gotten to the point of the error, but there it’s highly likely that template haskell would stop me from compiling the project as well.

SUSPENDED Compile Mobile Projects Using Moritzs New Solutions (GHC 8.10.7)

  • ChristmasStoryLogs/README.org
  • Perhaps not the best use of time reimplementing already implemented solution.
    • Maybe better to disect and understand the compilation steps of nix expressions that seem to have the solution for CI of android and iOS.

IN_PROGRESS Inspect what the existing Nix expressions are doing: Reflex-FRP, Haskell.nix

UNREFINED_TASK Compling GHC Cross Compiler of arbitrary versions

UNREFINED_TASK Compile a GHC Cross Compiler of arbitrary versions

  • Understand the process of compilation through the blogs zw3rk Blog.
  • Create/Gather scripts for compiling a cross compiler.

UNREFINED_TASK Create a ‘compiling a cross compiler for mobile’ Wiki entry.

  • Things involved when compiling Haskell and what are the relevant steps for cross compile for a platform.

Understand what the toolchain wrappers are doing

  • For darwin, essentially passing flags to cabal, and wrapping clang with xcrun clang –sdk iphoneos/macos ..
    • toolchain-wrapper / ghc iOS scripts

SUSPENDED Handle Template Haskell (Suspended in order to implement up to date non TH cross compilation solution, whereas this task was aiming to build upon old GHC)

SUSPENDED Implement zw3rk template haskell solutions for iOS.

Compile iserv-proxy

IN_PROGRESS Compile cross compile GHCSlave

IN_PROGRESS Setup Nix expressions for reproducability

SUSPENDED Implement zw3rk template haskell solutions for Android.

UNREFINED_TASK Create a ‘dealing with Template Haskell’ Wiki entry.

UNREFINED_TASK Create a ‘using Haskell libraries’ Wiki entry.

UNREFINED_TASK Create a ‘common OS Haskell interop patches’ Wiki entry, detailing how to patch a library to work for mobile.

UNREFINED_TASK Create a ‘Worflow for compiling and developing mobile Haskell projects’ wiki entry.

UNREFINED_TASK Create scripts for compiling and developing mobile Haskell projects.

UNREFINED_TASK Create Github CI workflow for compiling projects.

UNREFINED_TASK Create nix expression for compiling cross compilers.

UNREFINED_TASK Create nix cache service for Haskell mobile packages and compilers.

UNREFINED_TASK Investigate performance and binary size properties and how to improve performance and reduce size