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

jose doesn't build with new js backend #130

Open
tysonzero opened this issue Jun 19, 2024 · 3 comments
Open

jose doesn't build with new js backend #130

tysonzero opened this issue Jun 19, 2024 · 3 comments

Comments

@tysonzero
Copy link

Originally brought up this issue in servant-auth which depends on jose: haskell-servant/servant#1764

The actual build failure is in basement which jose transitively depends on via crypton/memory. It's unclear to me whether trying to get basement building directly will be easier or harder than removing the dependency on it, but I can definitely file an issue there too.

@ysangkok pointed out that I should bring it up here, in case it's practical to get jose building with the new backend.

@frasertweedale
Copy link
Owner

Any "kitchen sink" cryptography library will likely contain cbits or bind to system libs. It is not reasonable to expect them to support the JS backend (as pointed out at haskell-servant/servant#1764 (comment)).

I think if you need to do crypto in JS land, better to bind to whatever JS crypto implementation is appropriate.

If I'm missing something important please let me know! Otherwise, I will close this issue.

@tysonzero
Copy link
Author

One thing to consider is if the problem can be deferred to a runtime failure, as I'm fairly sure that other c-dep haskell libraries do still build ok with the js backend, you just generally can't use the functions that call into C unless a corresponding javascript function has been made.

In an ideal world you'd still get the error at compile time if you do actually use one of these functions, but wouldn't get an error if you just needed the types or other safe parts of the module, but it does not appear ghc has much support for that kind of approach.

@frasertweedale
Copy link
Owner

If there's a way to do it that does not affect the API and is not too time-consuming to implement, I'm open to that. Ideally the crypto library itself could handle that, rather than every consumer.

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

No branches or pull requests

2 participants