Skip to content

Add upper bound on ghcjs-base back into -jsffi#106

Merged
hamishmack merged 1 commit intomasterfrom
hkm/add-jsffi-ghcjs-base-bound-back
May 9, 2024
Merged

Add upper bound on ghcjs-base back into -jsffi#106
hamishmack merged 1 commit intomasterfrom
hkm/add-jsffi-ghcjs-base-bound-back

Conversation

@hamishmack
Copy link
Copy Markdown
Member

PR #105 relaxed the ghcjs-base bound on ghcjs-dom-jsffi, but the fix was for ghcjs-dom-javascript. We should not be using both ghcjs-dom-jsffi and ghcjs-dom-javascript at the same time.

Packages should either depend on ghcjs-dom only (and let it choose the correct implementation library) or do something like:

if impl(ghc >9)
  build-depends: ghcjs-dom-javascript
else
  build-depends: ghcjs-dom-jsffi

PR #105 relaxed the `ghcjs-base` bound on `ghcjs-dom-jsffi`, but the fix was for `ghcjs-dom-javascript`.  We should not be using both `ghcjs-dom-jsffi` and `ghcjs-dom-javascript` at the same time.

Packages should either depend on `ghcjs-dom` only (and let it choose the correct implementation library) or do something like:

```
if impl(ghc >9)
  build-depends: ghcjs-dom-javascript
else
  build-depends: ghcjs-dom-jsffi
```
@hamishmack
Copy link
Copy Markdown
Member Author

@sevanspowell can you please check adding this bound back will work for servant-jsaddle. I think something might be depending on ghcjs-dom-jsffi when it should not.

@sevanspowell
Copy link
Copy Markdown
Contributor

Of course. I was getting this error:

[__0] trying: ghcjs-base-0.8.0.0 (user goal)
[__1] next goal: ghcjs-dom-jsffi (user goal)
[__1] rejecting: ghcjs-dom-jsffi-0.9.9.0 (conflict: ghcjs-base==0.8.0.0,
ghcjs-dom-jsffi => ghcjs-base>=0.2.0.0 && <0.3)

After a bit of investigation, it's because I had added a cabal.project file to servant-jsaddle (my fork at least), that referenced the "ghcjs-dom-jsffi" subdir:

source-repository-package
    type: git
    location: https://github.com/ghcjs/ghcjs-dom.git
    tag: 7cdeedd873f76969f3144b7052c6f594d8b37bf8
    --sha256: 130cz1i77mjvicczn5yhci4b14z9gxk5xxi1b4ych5x0k3qvnnjb
    subdir:
      ghcjs-dom
      ghcjs-dom-jsaddle
      ghcjs-dom-javascript
      ghcjs-dom-jsffi

So having that subdir there added a constraint on the package, which I didn't expect. It was enough to remove them:

source-repository-package
    type: git
    location: https://github.com/ghcjs/ghcjs-dom.git
    tag: 7cdeedd873f76969f3144b7052c6f594d8b37bf8
    --sha256: 130cz1i77mjvicczn5yhci4b14z9gxk5xxi1b4ych5x0k3qvnnjb
    subdir:
      ghcjs-dom

Sorry about that. Good to go now. Thanks for clarifying that ghc > 9 ? ghcjs-dom-javascript : ghcjs-dom-jsffi, good to know.

sevanspowell added a commit to sambnt/haskell-js-templates that referenced this pull request May 7, 2024
- Adding the ghcjs-dom-jsffi package to the cabal.project file adds an implicit
  constraint on that package. In the case of ghcjs-dom, we don't want to depend
  on ghcjs-dom-jsffi unless we're using a much earlier version of ghc.
  - See ghcjs/ghcjs-dom#106.
@hamishmack hamishmack merged commit fa56093 into master May 9, 2024
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.

2 participants