Skip to content

Make it compile with MicroHs - #35

Merged
hasufell merged 4 commits into
haskell:masterfrom
augustss:master
Jan 20, 2026
Merged

Make it compile with MicroHs#35
hasufell merged 4 commits into
haskell:masterfrom
augustss:master

Conversation

@augustss

@augustss augustss commented Oct 4, 2025

Copy link
Copy Markdown
Contributor

The title say is all.

Comment thread System/OsString/Internal/Types.hs Outdated
#endif
#endif /* defined(__MHS__) */

#if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_lift)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_lift)
#if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_lift)

Comment thread System/OsString/Internal/Types.hs Outdated
#endif


#if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_lift)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_quasi_lift)
#if defined(MIN_VERSION_template_haskell) || defined(MIN_VERSION_template_haskell_lift)

@hasufell

Copy link
Copy Markdown
Member

I don't really know how to test this, because I can't build it with MicroCabal:

$ mcabal build
Building library os-string
mcabal: dependency not installed: exceptions
CallStack (from HasCallStack):
  error, called at src/MicroCabal/Main.hs:294:7 in MicroCabal-0.3.1.2-e-mcabal-75585738e395707ce7d72086104aab25ddc49e656edb72cd58633055f14fd4e2:MicroCabal.Main
HasCallStack backtrace:
  collectBacktraces, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:169:13 in ghc-internal:GHC.Internal.Exception
  toExceptionWithBacktrace, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:204:5 in ghc-internal:GHC.Internal.Exception
  error, called at src/MicroCabal/Main.hs:294:7 in MicroCabal-0.3.1.2-e-mcabal-75585738e395707ce7d72086104aab25ddc49e656edb72cd58633055f14fd4e2:MicroCabal.Main

$ mcabal install exceptions  
Build package exceptions
mcabal: getPackageInfo: no package exceptions
CallStack (from HasCallStack):
  error, called at src/MicroCabal/Main.hs:173:23 in MicroCabal-0.3.1.2-e-mcabal-75585738e395707ce7d72086104aab25ddc49e656edb72cd58633055f14fd4e2:MicroCabal.Main

@hasufell

Copy link
Copy Markdown
Member

I tried with compiling mhs/mcabal from github, but still get errors:

$ mcabal build 
mcabal: Building library os-string

mcabal: uncaught exception: error: "src/MicroCabal/Main.hs",356:7: dependency not installed: exceptions

$ mcabal install exceptions  
mcabal: Build package exceptions
mcabal: Building in /home/hasufell/.mcabal/packages/exceptions-0.10.9
mcabal: Building library exceptions
Changing package mtl to mtl-mhs

mcabal: uncaught exception: error: "src/MicroCabal/Main.hs",356:7: dependency not installed: mtl-mhs

$ mcabal install mtl 
Changing package mtl to mtl-mhs
mcabal: Build package mtl-mhs
mcabal: Package not found, running 'fetch mtl-mhs'
mcabal: Building in /home/hasufell/.mcabal/packages/mtl-mhs-2.3.1
mcabal: Building library mtl-mhs

mcabal: uncaught exception: error: "src/MicroCabal/Main.hs",356:7: dependency not installed: transformers

$ mcabal install transformers 
mcabal: Build package transformers
mcabal: Building in /home/hasufell/.mcabal/packages/transformers-0.6.2.0
mcabal: Building library transformers

mhs: uncaught exception: error: no location: Module not found: Mhs.Builtin
search path=[".","dist-mcabal/autogen"]
package path=["."]

mcabal: uncaught exception: error: "../MicroHs/lib/System/Process.hs",12:5: callCommand: failed 256, "mhs -Ptransformers-0.6.2.0 -odist-mcabal/transformers-0.6.2.0.pkg -i -i. -idist-mcabal/autogen '-DVERSION_base=\"4.19.1.0\"' '-DMIN_VERSION_base(x,y,z)=((x)<4||(x)==4&&(y)<19||(x)==4&&(y)==19&&(z)<=1)' -a. Control.Applicative.Backwards Control.Applicative.Lift Control.Monad.Signatures Control.Monad.Trans.Accum Control.Monad.Trans.Class Control.Monad.Trans.Cont Control.Monad.Trans.Except Control.Monad.Trans.Identity Control.Monad.Trans.Maybe Control.Monad.Trans.Reader Control.Monad.Trans.RWS Control.Monad.Trans.RWS.CPS Control.Monad.Trans.RWS.Lazy Control.Monad.Trans.RWS.Strict Control.Monad.Trans.Select Control.Monad.Trans.State Control.Monad.Trans.State.Lazy Control.Monad.Trans.State.Strict Control.Monad.Trans.Writer Control.Monad.Trans.Writer.CPS Control.Monad.Trans.Writer.Lazy Control.Monad.Trans.Writer.Strict Data.Functor.Constant Data.Functor.Reverse"

@augustss

Copy link
Copy Markdown
Contributor Author

You should clone augustss/MicroHs,
then rm -rf ~/.mcabal
and then make install

That will give you a consistent installation.

Doing mcabal -r build will recursively install dependencies.

@augustss

Copy link
Copy Markdown
Contributor Author

I can add MicroHs CI if you want.

@hasufell
hasufell merged commit fa24bcc into haskell:master Jan 20, 2026
24 of 26 checks passed
@augustss

Copy link
Copy Markdown
Contributor Author

Thank you

hasufell added a commit that referenced this pull request Jan 20, 2026
* support MicroHS wrt #35
* Switch from template-haskell to template-haskell-quasiquoter and -lift wrt #36
@hasufell

Copy link
Copy Markdown
Member

This is uploaded to hackage as 2.0.9

@hasufell

hasufell commented Jan 20, 2026

Copy link
Copy Markdown
Member

I can add MicroHs CI if you want.

I think you showed me a MicroHS yaml workflow file during ICFP. If you drop the link here again I can very well come up with something.

@augustss

Copy link
Copy Markdown
Contributor Author

I think this should work.

name: mhs-ci

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build-mhs-os-string:
    runs-on: ubuntu-latest
    steps:

    - name: checkout mhs repo
      uses: actions/checkout@v4
      with:
        repository: augustss/MicroHs
        ref: v0.15.0.0
        path: mhs
    - name: make and install mhs
      run: |
        cd mhs
        make minstall

    - name: checkout os-string repo
      uses: actions/checkout@v4
      with:
        path: os-string

    - name: compile and install os-string package
      run: |
        PATH="$HOME/.mcabal/bin:$PATH"
        cd os-string
        mcabal -r install

    - name: cleanup
      run: |
        rm -rf $HOME/.mcabal

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.

3 participants