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

Missing modules in exposed-modules and linker errors #8902

Open
ffaf1 opened this issue Apr 8, 2023 · 3 comments
Open

Missing modules in exposed-modules and linker errors #8902

ffaf1 opened this issue Apr 8, 2023 · 3 comments
Labels
cabal-install: cmd/run re: user experience User experience (UX) issue re: warnings Concerning warnings printed by cabal type: enhancement

Comments

@ffaf1
Copy link
Collaborator

ffaf1 commented Apr 8, 2023

Describe the bug

Related: #1746

I recently have helped a user with a well know error, forgetting to put modules in exposed-modules (edit: actually, other-modules, but it is the same problem).

What we know:

  • a -Wmissing-home-modules warning gets printed.
  • The user is clearly not a newbie.

The hint got probably overlooked because of the barrage of abuse by the linker

⁝
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.text+0x9406): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Syntax_zdWMapLiteral_info'
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.text+0x9496): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Syntax_zdWIdentifier_info'
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.text+0xaf16): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Syntax_zdWStringLiteral_info'
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.text+0xb43e): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Syntax_zdWCharLiteral_info'
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.text+0xbab0): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Lexer_boolean1_info'
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.data+0xbd8): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Lexer_variable_closure'
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.data+0xbe8): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Lexer_comma1_closure'
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.data+0x11a0): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Lexer_boolean1_closure'
/tmp/aura_lang/dist-newstyle/build/x86_64-linux/ghc-9.2.1/aura-lang-0.1.0.0/build/libHSaura-lang-0.1.0.0-inplace.a(Parser.o)(.data+0x1458): error: undefined reference to 'aurazmlangzm0zi1zi0zi0zminplace_Lexer_arrow1_closure'
⁝

and the fact that warnings are not displayed again on a new cabal run.

Expected behavior

The user notices the error, is able to understand it and fix it by themselves.

I would not know precisely what to suggest though: upgrading the warning to error could be annoying to a number of developers. Redirecting linker output somewhere too could break some dev setups.

To reproduce

Create a lib/exe .cabal, forget to expose a module in the lib that is needed by the exe.

@ffaf1 ffaf1 added cabal-install: cmd/run re: warnings Concerning warnings printed by cabal re: user experience User experience (UX) issue labels Apr 8, 2023
@ffaf1
Copy link
Collaborator Author

ffaf1 commented Dec 4, 2023

See #9491 for similar problems.

@ulysses4ever
Copy link
Collaborator

Yes, I've got bitten by this and very much agree that there's a UX issue that can be solved to improve users' life.

@ffaf1
Copy link
Collaborator Author

ffaf1 commented Dec 31, 2023

More users having problems with mising modules in .cabal.

I wonder if this could help (UX: user gets a barrage of abuse from the linker, but also a “0 errors, 1 warning” message at the end, gets curious, reads the message, adds the missing module).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cabal-install: cmd/run re: user experience User experience (UX) issue re: warnings Concerning warnings printed by cabal type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants