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

Symbol not found when using a complicated backpack build: #4865

Closed
ekmett opened this Issue Nov 6, 2017 · 8 comments

Comments

Projects
None yet
4 participants
@ekmett
Member

ekmett commented Nov 6, 2017

Working off of this branch

https://github.com/ekmett/coda/tree/7caf26b3d1abe063f2a37358db99834dbe5c0860

I get the following error

mac:coda> cabal new-build
In order, the following will be built (use -v for more details):
 - coda-0.0.1 (lib:console) (first run)
 - coda-0.0.1 (lib:server) (first run)
 - coda-0.0.1 (exe:coda) (first run)
Preprocessing library 'console' for coda-0.0.1..
Building library 'console' for coda-0.0.1..
Preprocessing library 'server' for coda-0.0.1..
Building library 'server' for coda-0.0.1..
[1 of 2] Compiling Coda.Server.Options ( src/server/Coda/Server/Options.hs, /Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-0.0.1/c/server/build/server/Coda/Server/Options.o )
[1 of 6] Compiling Coda.Console.Options ( src/console/Coda/Console/Options.hs, /Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-0.0.1/c/console/build/console/Coda/Console/Options.o )
<command line>: can't load .so/.DLL for: /Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-syntax-dyck-mixin-0.0.1/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/build/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/libHScoda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK-ghc8.2.1.dylib (dlopen(/Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-syntax-dyck-mixin-0.0.1/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/build/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/libHScoda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK-ghc8.2.1.dylib, 5): Symbol not found: _codazmsyntaxzmtokenzm0zi0zi1zminplace_CodaziSyntaxziToken_LNone_closure
  Referenced from: /Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-syntax-dyck-mixin-0.0.1/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/build/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/libHScoda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK-ghc8.2.1.dylib
  Expected in: flat namespace
 in /Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-syntax-dyck-mixin-0.0.1/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/build/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/libHScoda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK-ghc8.2.1.dylib)
<command line>: can't load .so/.DLL for: /Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-syntax-dyck-mixin-0.0.1/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/build/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/libHScoda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK-ghc8.2.1.dylib (dlopen(/Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-syntax-dyck-mixin-0.0.1/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/build/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/libHScoda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK-ghc8.2.1.dylib, 5): Symbol not found: _codazmsyntaxzmtokenzm0zi0zi1zminplace_CodaziSyntaxziToken_LNone_closure
  Referenced from: /Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-syntax-dyck-mixin-0.0.1/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/build/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/libHScoda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK-ghc8.2.1.dylib
  Expected in: flat namespace
 in /Users/ekmett/coda/dist-newstyle/build/x86_64-osx/ghc-8.2.1/coda-syntax-dyck-mixin-0.0.1/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/build/coda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK/libHScoda-syntax-dyck-mixin-0.0.1-inplace+DP6ijucIVZM7FrKQh7G0eK-ghc8.2.1.dylib)
cabal: Failed to build lib:console from coda-0.0.1 (which is required by
exe:coda from coda-0.0.1).
Failed to build lib:server from coda-0.0.1 (which is required by exe:coda from

The previous couple of patches saw a similar error.

Symbol not found: _codazmsyntaxzmtokenzm0zi0zi1zminplace_CodaziSyntaxziToken_LNone_closure

At first I thought it was because I was using internal modules, so in the build shown there I split coda-syntax.cabal is split into several little sub-packages.

I thought at first that the reexported-modules: stanza isn't being respected properly, but in that latest build, that module is being directly imported from the source, so I'm somewhat at a loss.

It isn't clear to me how to shrink the example.

@23Skidoo

This comment has been minimized.

Show comment
Hide comment
@23Skidoo
Member

23Skidoo commented Nov 6, 2017

/cc @ezyang

@ekmett

This comment has been minimized.

Show comment
Hide comment
@ekmett

ekmett Nov 6, 2017

Member

There are a few variants of this forward and back in the commit history.

Notably, in the backpack branch's current HEAD, there are coda-algebra.cabal.bug and coda-syntax.cabal.bug and coda-syntax.cabal.bug2.

Using any of those (with appropriate changes to the cabal.project) leads to a similar bug where ghc fails to link correctly in the outer project.

Notably the coda-algebra.cabal project gets away with using a mixin as long as the libraries are internal libraries, but fails with separate packages, while coda-syntax.cabal fails both ways (but uses 3 separate mixin packages.)

The fact that I can't get coda-syntax to work is something I felt might have been me just not knowing how to use the tool right, somehow, but the fact that coda-algebra is broken seems to indicate something is very wrong.

Member

ekmett commented Nov 6, 2017

There are a few variants of this forward and back in the commit history.

Notably, in the backpack branch's current HEAD, there are coda-algebra.cabal.bug and coda-syntax.cabal.bug and coda-syntax.cabal.bug2.

Using any of those (with appropriate changes to the cabal.project) leads to a similar bug where ghc fails to link correctly in the outer project.

Notably the coda-algebra.cabal project gets away with using a mixin as long as the libraries are internal libraries, but fails with separate packages, while coda-syntax.cabal fails both ways (but uses 3 separate mixin packages.)

The fact that I can't get coda-syntax to work is something I felt might have been me just not knowing how to use the tool right, somehow, but the fact that coda-algebra is broken seems to indicate something is very wrong.

@ezyang

This comment has been minimized.

Show comment
Hide comment
@ezyang

ezyang Nov 6, 2017

Contributor
Contributor

ezyang commented Nov 6, 2017

@ezyang

This comment has been minimized.

Show comment
Hide comment
@ezyang

ezyang Nov 6, 2017

Contributor
Contributor

ezyang commented Nov 6, 2017

@ezyang

This comment has been minimized.

Show comment
Hide comment
@ezyang

ezyang Nov 6, 2017

Contributor
Contributor

ezyang commented Nov 6, 2017

@ekmett

This comment has been minimized.

Show comment
Hide comment
@ekmett

ekmett Nov 6, 2017

Member

The issue sounds related, at least. I'll give it a shot. There goes my ability to have actual users. =)

Member

ekmett commented Nov 6, 2017

The issue sounds related, at least. I'll give it a shot. There goes my ability to have actual users. =)

@thoughtpolice

This comment has been minimized.

Show comment
Hide comment
@thoughtpolice

thoughtpolice Nov 6, 2017

Member

FWIW, looks like it'll be slated for 8.2.2 as well, so the latest PPA from Herbert should work too if you're willing to spin up Linux.

Member

thoughtpolice commented Nov 6, 2017

FWIW, looks like it'll be slated for 8.2.2 as well, so the latest PPA from Herbert should work too if you're willing to spin up Linux.

@ekmett

This comment has been minimized.

Show comment
Hide comment
@ekmett

ekmett Nov 9, 2017

Member

This works with 8.2.2-rc2.

Member

ekmett commented Nov 9, 2017

This works with 8.2.2-rc2.

@ekmett ekmett closed this Nov 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment