-
Notifications
You must be signed in to change notification settings - Fork 164
Fix ambiguous data files on duplicate idir #3117
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
Conversation
martijnbastiaan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR! I'm not sure I understand:
When library and simulator code share the same hs-source-dirs
You mean when you have a Cabal file with a library and executable (simulator) that source from the same source dir, you get this error?
|
Yes, I'm not entirely sure how this happens, but with the following cabal file font.cabal: $ cabal run sim-vga
Build profile: -w ghc-9.6.7 -O1
In order, the following will be built (use -v for more details):
- font-0.1 (exe:sim-vga) (first run)
[1 of 2] Compiling Main ( /srv/codeberg.org/TristanCacqueray/clash-lcd-examples/dist-newstyle/build/x86_64-linux/ghc-9.6.7/font-0.1/setup/setup.hs, /srv/codeberg.org/TristanCacqueray/clash-lcd-examples/dist-newstyle/build/x86_64-linux/ghc-9.6.7/font-0.1/setup/Main.o )
[2 of 2] Linking /srv/codeberg.org/TristanCacqueray/clash-lcd-examples/dist-newstyle/build/x86_64-linux/ghc-9.6.7/font-0.1/setup/setup
Configuring font-0.1...
GHC: Setting up GHC took: 0.327s
GHC: Compiling and loading modules took: 8.450s
Clash: Parsing and compiling primitives took 0.312s
GHC+Clash: Loading modules cumulatively took 11.126s
Clash: Compiling Board.topEntity
Clash: Normalization took 0.870s
[WARNING] Dubious primitive instantiation for GHC.Num.Integer.integerToInt#: GHC.Num.Integer.integerToInt#: Integers are dynamically sized in simulation, but fixed-length after synthesis. Use carefully. (disable with -fclash-no-prim-warn)
Clash: Netlist generation took 0.039s
<no location info>: error:
Clash error call:
Multiple data files for "font.bin" found. The following candidates were found:
["./font.bin","./font.bin"]
Please disambiguate data files.
CallStack (from HasCallStack):
error, called at src/Clash/Netlist/BlackBox/Util.hs:343:20 in clash-lib-1.8.4-EKPE2lvISh6Fa3UkCiavz5:Clash.Netlist.BlackBox.UtilPerhaps this is caused by clashilator? Moving the executable to a dedicated directory fixes the issue, but then it happens again with clash-shake. |
6eabc15 to
2607ff9
Compare
When library and simulator code share the same hs-source-dirs,
clash fails to resolve data file with the following error:
Multiple data files for "font.bin" found. The following candidates were found:
["./font.bin","./font.bin"]
This change fix that bug by removing duplicated source dirs.
Fixes clash-lang#3141
2607ff9 to
eb9b462
Compare
martijnbastiaan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a regression test and immediately found another issue. When you pass different -i arguments that point to the same directory (e.g., -ifoo and -ifoo/bar/..). I didn't immediately see a great place to canonicalize the directories, so I've amended the test to only test for your case.
In any case, thanks for the contribution! :) LGTM!
|
You are welcome, thank you for integrating this change! |
When library and simulator code share the same hs-source-dirs, clash fails to resolve data file with the following error:
This change fix that bug by removing duplicated source dirs.
Fixes #3141
Still TODO: