Skip to content

cabal 3.8.1.0 compiles temporary build path for datadir into alex, happy, other tools #8482

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

Closed
essandess opened this issue Sep 18, 2022 · 5 comments

Comments

@essandess
Copy link

essandess commented Sep 18, 2022

Describe the bug

I’m migrating several MacPorts Haskell builds from stack to cabal to get native arm64 binaries linked to MacPorts libraries.

I observe that cabal version 3.8.1.0 compiles a temporary build path for datadir from store-dir into alex, happy, other binaries it compiles. This breaks projects for which datadir is required.

I’ve tried many different approaches to setting datadir To the correct, permanent location, but none of these methods work:

Because these tools are necessary to bootstrap and use Haskell world, I’ve thrown in the towel and just used an ugly hack of replacing this incorrect path in the binary with the correct path padded with extraneous /‘s. See: macports/macports-ports#16154

How can cabal compile a project like alex from source and set the correct datadir?

Likely related: #3586

To Reproduce

Compile cabal build/install of alex, happy, and so forth.

System information

  • macOS 12.6 21G115 x86_64
  • Xcode 14.0 14A309
  • cabal 3.8.1.0, ghc 9.4.2

Additional context
MacPorts build commands:

@gbaz
Copy link
Collaborator

gbaz commented Sep 19, 2022

The linked ticket cross-links to a large other number of related issues. I really do think we should tackle this for the next cabal release. The problem is I'm not sure what the right design to implement is! If someone wants to propose the exact semantics (perhaps with more flags) that cabal implement, this seems tractable and worthwhile.

@gbaz gbaz added this to the Considered for 3.10 milestone Sep 19, 2022
@essandess
Copy link
Author

The linked ticket cross-links to a large other number of related issues. I really do think we should tackle this for the next cabal release. The problem is I'm not sure what the right design to implement is! If someone wants to propose the exact semantics (perhaps with more flags) that cabal implement, this seems tractable and worthwhile.

Thanks you—that would be much appreciated. I’ve discovered that the slash hack doesn’t work on arm architectures, and even this hack doesn’t provide a viable alternative on that platform. See macports/macports-ports#16228.

@gbaz
Copy link
Collaborator

gbaz commented Oct 4, 2022

Based on the discussion there, could you just override this by setting $alex_datadir etc in the environment?

@gbaz
Copy link
Collaborator

gbaz commented Jan 6, 2023

I believe this is resolved by #8556

@Mikolaj
Copy link
Member

Mikolaj commented Jan 12, 2023

Could anybody kindly verify using master branch (or cabal 3.10 when it gets released)? Let me close, but please open a new ticket if problems still occur.

@Mikolaj Mikolaj closed this as completed Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants