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

Flag portable does not work #88

Closed
Bodigrim opened this issue Nov 25, 2024 · 8 comments
Closed

Flag portable does not work #88

Bodigrim opened this issue Nov 25, 2024 · 8 comments

Comments

@Bodigrim
Copy link
Contributor

$ cabal get hashtables-1.4.0 && cd hashtables-1.4.0 && cabal build -w ghc-9.10 -fportable
Unpacking to hashtables-1.4.0/
Resolving dependencies...
Build profile: -w ghc-9.10.1 -O1
In order, the following will be built (use -v for more details):
 - hashtables-1.4.0 (lib) (first run)
 - hashtables-1.4.0 (test:testsuite) (first run)
Configuring library for hashtables-1.4.0...
Configuring test suite 'testsuite' for hashtables-1.4.0...
Preprocessing library for hashtables-1.4.0...
Building library for hashtables-1.4.0...
Preprocessing test suite 'testsuite' for hashtables-1.4.0...
Building test suite 'testsuite' for hashtables-1.4.0...
[ 1 of 12] Compiling Data.HashTable.Class
[ 1 of 14] Compiling Data.HashTable.Class
[ 2 of 12] Compiling Data.HashTable.Internal.Array
[ 2 of 14] Compiling Data.HashTable.Internal.Array
[ 3 of 12] Compiling Data.HashTable.Internal.IntArray
[ 3 of 14] Compiling Data.HashTable.Internal.IntArray
[ 4 of 12] Compiling Data.HashTable.Internal.UnsafeTricks
[ 4 of 14] Compiling Data.HashTable.Internal.UnsafeTricks
[ 5 of 12] Compiling Data.HashTable.Internal.Linear.Bucket
[ 5 of 14] Compiling Data.HashTable.Internal.Linear.Bucket
[ 6 of 12] Compiling Data.HashTable.Internal.Utils
[ 6 of 14] Compiling Data.HashTable.Internal.Utils
[ 7 of 12] Compiling Data.HashTable.Internal.CheapPseudoRandomBitStream
[ 7 of 14] Compiling Data.HashTable.Internal.CheapPseudoRandomBitStream
[ 8 of 12] Compiling Data.HashTable.Internal.CacheLine
src/Data/HashTable/Internal/CacheLine.hs:254:30: error: [GHC-83865]
    • Couldn't match expected type ‘Int#’ with actual type ‘Int8#’
    • In the first argument of ‘int2Word#’, namely ‘pos8#’
      In the expression: int2Word# pos8#
      In an equation for ‘posw#’: !posw# = int2Word# pos8#
    |
254 |     !posw#       = int2Word# pos8#
    |                              ^^^^^
<skipped>
@erikd
Copy link
Collaborator

erikd commented Nov 25, 2024

Kind of curious what you are using the portable flag for.

@Bodigrim
Copy link
Contributor Author

See https://www.reddit.com/r/haskell/comments/1gzg3tx/failed_to_build_hashtables_on_wasm32wasighc/ for context.

I think the original poster uses -fportable as a hack to get hashtables working on 32-bit arch; it would be nice to test and fix it if necessary. If you do not have a local 32-bit machine, https://github.com/haskell/text/blob/master/.github/workflows/i386.yml can be used as a template for CI job on i386.

@erikd
Copy link
Collaborator

erikd commented Nov 26, 2024

Oh no 😢. Supporting 32 bit is such a huge pain in the neck. It breaks horrible for most new GHC releases. I put a huge amount of effort into fixing wide-word many releases ago, only to have it break really horribly on the next major release.

@erikd
Copy link
Collaborator

erikd commented Nov 26, 2024

Fixing -fportable on x86-64 should not be too hard, but making sure it also works on 32 bit is probably going to be painful and I would be surprised if it doesn't break for the next major GHC release.

@Bodigrim
Copy link
Contributor Author

Well, WASM and JS are 32-bit targets and supporting them is not without a merit. But if you decide otherwise, I guess if arch(i386) || arch(arm) || arch(wasm) || arch(js) buildable: False would be helpful for users so that at least Cabal rejects a build plan.

@erikd
Copy link
Collaborator

erikd commented Nov 26, 2024

Is there any particular 32 bit WASM GHC version I should be supporting?

@angerman
Copy link

unsized types bite again :(

@erikd
Copy link
Collaborator

erikd commented Nov 26, 2024

Eeek, the compile error @Bodigrim posted is just the first of about 10, and that particular error does not occur with ghc-8.10.

erikd added a commit that referenced this issue Nov 26, 2024
Tested locally with GHC versions 8.10, 9.6, 9.8, 9.10 and 9.12.

Closes: #88
@erikd erikd closed this as completed in 59fb2bc Nov 26, 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

No branches or pull requests

3 participants