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

shared lib #149

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

shared lib #149

wants to merge 3 commits into from

Conversation

Drezil
Copy link
Contributor

@Drezil Drezil commented Jul 20, 2022

this also bundles the c-parts and the generated inline-library for dynamic linking in sub-projects.

Minor caveat: Setup.hs line 14 still needs a dynamic compiler-version-string to vendor the right .so in the right directories.

After that change this could be merged without problems.

Setup.hs Outdated Show resolved Hide resolved
@Drezil
Copy link
Contributor Author

Drezil commented Jul 21, 2022

@dpwiz i have no idea why the nix-build in the github-actions fails.. because (and i don't use nix) locally with cabal for me both .a and -ghc8.10.7.so are in the dist-directory after building. Do you have a clue?

@Drezil Drezil marked this pull request as ready for review July 21, 2022 23:10
@Drezil
Copy link
Contributor Author

Drezil commented Jul 22, 2022

Ah.. i now have recreated the error locally.

Seems like cabal new-clean & rm -rf dist-newstyle is not enough to clean everything because there are things cached in the submodules as well..
i will work on a fix & report back ;)

@Drezil
Copy link
Contributor Author

Drezil commented Jul 22, 2022

Now i understand.

cabal build & cabal exec work flawlessly. But cabal install can't find the file to vendor it, because it is in the "lib" directory.
Thats what the Setup.hs would fix with the cp.

I only used cabal build & cabal exec in my tests & had no problems. But the nix-script uses cabal install & that fails.

Trying that stuff now.

@Drezil
Copy link
Contributor Author

Drezil commented Jul 22, 2022

It finally works with the right incantation.
I could even continue to use build-type: Simple instead of Custom.

Thing i did: i merged the internal-library into the main library so build-types are switchable. But nothing is visible from the outside, because all those modules do not get exposed & just listed.

@Drezil Drezil closed this Aug 8, 2022
@Drezil Drezil deleted the sharedLib branch August 8, 2022 15:53
@dpwiz
Copy link
Member

dpwiz commented Aug 8, 2022

Have you found another workaround?

@Drezil
Copy link
Contributor Author

Drezil commented Aug 8, 2022

oh .. 😅 .. i thought this was already merged ...

@Drezil Drezil restored the sharedLib branch August 8, 2022 18:32
@Drezil Drezil reopened this Aug 8, 2022
@dpwiz
Copy link
Member

dpwiz commented Aug 9, 2022

FTR: I would like to merge this (or something like it), but I don't quite understand the effects of such shuffle on packaging.
Running the examples on Nix, Windows and Macs may help with the confidence.

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