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

Set up CI and update cabal file #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kleidukos
Copy link

@Kleidukos Kleidukos commented Jul 27, 2024

This PR brings the following changes:

  • Declare the package as being tested with GHC 9.4, 9.6, and 9.8
  • Enable TypeOperators as the code uses the type equality operator (~)
  • Correct the location of the source code in the cabal file
  • Enable more flags to help with code quality
  • Require a recent version of the Cabal library

Bonus commits:

  • eee1c93 Removes redundant constraints from the API.
  • bdf29a5 Formats the cabal file with cabal-fmt

Closes #2 #3

@Kleidukos Kleidukos marked this pull request as draft July 27, 2024 09:10
@Kleidukos Kleidukos marked this pull request as ready for review July 27, 2024 10:17
Declare the package as being tested against the latest GHC 9.4, 9.6 and
9.8
@Kleidukos
Copy link
Author

@prolic This PR is now ready for review. :)

@prolic
Copy link
Owner

prolic commented Jul 27, 2024

I ran with cabal 3.10.3.0 and had to upgrade to cabal 3.12.1.0 so I can test these code changes, fair enough.

When compiling I see this:

Warning: [misplaced-c-opt] Instead of 'ghc-shared-options: -framework-path'
use 'extra-framework-dirs: /QT_ROOT/lib'

Compilation of the library works though. Next I tried the first demo app with this changes, so I updated github.com/prolic/hsqml-demo-notes cabal.project file and put this:

packages:
    ./

source-repository-package
  type: git
  location: https://github.com/Kleidukos/HsQML
  tag: bdf29a5b0666d9173fc903b442c91f457abd8133

and I see this build error:

cabal build
Cloning into '/home/sasa/code/hsqml-demo-notes/dist-newstyle/src/HsQML-b5741da83d597ac4'...
remote: Enumerating objects: 2074, done.
remote: Counting objects: 100% (37/37), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 2074 (delta 11), reused 28 (delta 8), pack-reused 2037
Receiving objects: 100% (2074/2074), 1.15 MiB | 1.18 MiB/s, done.
Resolving deltas: 100% (1137/1137), done.
HEAD is now at bdf29a5 Format the cabal file with cabal-fmt
Resolving dependencies...
Build profile: -w ghc-9.4.8 -O1
In order, the following will be built (use -v for more details):
 - hsqml-0.3.6.0 (lib:hsqml) (requires build)
 - hsqml-demo-notes-0.3.3.0 (exe:hsqml-notes-slow) (first run)
 - hsqml-demo-notes-0.3.3.0 (exe:hsqml-notes) (first run)
Starting     hsqml-0.3.6.0 (all, legacy fallback: build-type is Custom)
Building     hsqml-0.3.6.0 (all, legacy fallback: build-type is Custom)

Failed to build hsqml-0.3.6.0.
Build log (
/home/sasa/.cabal/logs/ghc-9.4.8/hsqml-0.3.6.0-143f7b9684631edf1eecd11d411090d3d9e6131b65c98bb26226396779a867aa.log
):
[1 of 2] Compiling Main             ( /home/sasa/code/hsqml-demo-notes/dist-newstyle/tmp/src-11438/hsqml-0.3.6.0/dist/setup/setup.hs, /home/sasa/code/hsqml-demo-notes/dist-newstyle/tmp/src-11438/hsqml-0.3.6.0/dist/setup/Main.o )
[2 of 2] Linking /home/sasa/code/hsqml-demo-notes/dist-newstyle/tmp/src-11438/hsqml-0.3.6.0/dist/setup/setup
Configuring hsqml-0.3.6.0...
Warning: [misplaced-c-opt] Instead of 'ghc-shared-options: -framework-path'
use 'extra-framework-dirs: /QT_ROOT/lib'
Preprocessing library for hsqml-0.3.6.0...
c2hs: Graphics/QML/Internal/BindPrim.chi not found in:
dist/build
.

Error: [Cabal-7125]
Failed to build hsqml-0.3.6.0 (which is required by exe:hsqml-notes-slow from hsqml-demo-notes-0.3.3.0 and exe:hsqml-notes from hsqml-demo-notes-0.3.3.0). See the build log above for details.

@Kleidukos any idea what's wrong? I might be able to look further into this Monday, but maybe you have an idea.

@Kleidukos
Copy link
Author

Kleidukos commented Jul 28, 2024

Good catch regarding misplaced-c-opt, I'll fix it.

I'll investigate the build error as well this week-end! This is a c2hs problem.

@prolic
Copy link
Owner

prolic commented Jul 28, 2024 via email

@Kleidukos
Copy link
Author

Not really, the cabal warning is for macOS framework paths, the build error is related to c2hs on my linux machine

@prolic
Copy link
Owner

prolic commented Aug 24, 2024

I am going to review this again ASAP

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.

Couldn't match type ‘[Char]’ with ‘Distribution.Simple.PreProcess.Types.Suffix’
2 participants