cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Add js-options field to cabal file to allow passing custom preprocessing options for js (#10721)

Open Swordlash opened this issue 11 months ago • 9 comments

The PR fixes the issue (#10721) by adding a new js-options field to cabal file that are passed to componentJsGhcOptions.

Please advise on the testing strategy, if any. Thank you @hsyl20 for investigation and suggestion how to fix it.

Swordlash avatar Jan 06 '25 18:01 Swordlash

Please let me know if this is an acceptable feature at all, if so I'm gonna add any needed doc changes / changelogs.

Swordlash avatar Jan 06 '25 18:01 Swordlash

Can you please add some tests?

  • js-options used with old cabal-spec version
  • js-options used with correct cabal-spec version

mpickering avatar Jan 07 '25 11:01 mpickering

@mpickering: are you satisfied with the PR now?

Let me rebase in order to prod CI.

Mikolaj avatar Feb 01 '25 07:02 Mikolaj

@mergify rebase

Mikolaj avatar Feb 01 '25 07:02 Mikolaj

rebase

✅ Branch has been successfully rebased

mergify[bot] avatar Feb 01 '25 07:02 mergify[bot]

Hah, it seems the whitespace check is failing.

Mikolaj avatar Feb 01 '25 07:02 Mikolaj

Should this be closed after https://github.com/haskell/cabal/pull/10949 ?

ulysses4ever avatar May 11 '25 16:05 ulysses4ever

@ulysses4ever I've taken a look at the PR, and if the tests pass then yes, it fixes the issue.

Swordlash avatar May 11 '25 16:05 Swordlash

To summarize what we have now:

  1. The name js-options is incorrect, since we don't pass any options for js here.
  2. It should be called jsp-options with automatic addition of -optJSP.
  3. It’s worth making a proposal in the CApiFFI style. (JavaScriptApiFFI)

We can start doing 1 and 2 already 👀

zlonast avatar May 18 '25 18:05 zlonast