Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix call to attr_deps_haskell_lib_infos
Summary: Haskell builds must always include the `template_deps` lib infos right? Leaving them out makes `common/hs/manifold:manifold_ghci` fail at evaluation time with: ``` $ buck2 run mode/dev common/hs/manifold:manifold_ghci GHCi, version 8.8.3: https://www.haskell.org/ghc/ :? for help package flags have changed, resetting and loading new packages... Loaded GHCi configuration from /tmp/manifold_ghci-3813794/start.ghci [1 of 5] Compiling Manifold.Exception ( common/hs/manifold/Manifold/Exception.hs, interpreted ) [2 of 5] Compiling Manifold.Metadata ( common/hs/manifold/Manifold/Metadata.hs, interpreted ) [3 of 5] Compiling Manifold.Option ( common/hs/manifold/Manifold/Option.hs, interpreted ) [4 of 5] Compiling Manifold.HTTP ( common/hs/manifold/Manifold/HTTP.hs, interpreted ) [5 of 5] Compiling Manifold.Client ( common/hs/manifold/Manifold/Client.hs, interpreted ) Ok, five modules loaded. *Manifold.Client> enumerateAll [startKey "ovrsource"] "glean_databases" "" unknown package: fbcode-common-hs-mangle-library ``` However, when we fix the code to include them we see a new error: ``` BUILD FAILED Error running analysis for `fbcode//common/hs/manifold:manifold_ghci (cfg:linux-x86_64-fbcode-platform010-no-san#17ac72a600bb636a)` Caused by: Traceback (most recent call last): File <builtin>, in <module> * fbcode/buck2/prelude/haskell/haskell_ghci.bzl:657, in haskell_ghci_impl symlinked_things = ctx.actions.symlinked_dir( error: Multiple artifacts and/or metadata files are declared at the same output location `manifold_ghci.packages/fbcode-common-hs-util-addressable` declared at `fbcode/buck2/prelude/haskell/haskell_ghci.bzl:657:32-660:14`. --> fbcode/buck2/prelude/haskell/haskell_ghci.bzl:657:32 | 657 | symlinked_things = ctx.actions.symlinked_dir( | ________________________________^ 658 | | lib_symlinks_root, 659 | | lib_symlinks, 660 | | ) | |_____________^ | ``` The problem is that there are two different configurations of `common/hs/util:addressable` being pulled: ``` buck2 cquery 'allpaths(common/hs/manifold:manifold, common/hs/util:addressable)' Buck UI: https://www.internalfb.com/buck2/a8612b6b-0237-417f-8dc8-0dee1fa6bb5c Network: Up: 0B Down: 0B Jobs completed: 2. Time elapsed: 0.2s. fbcode//common/hs/manifold:manifold (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//servicerouter/client/hs:client (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//servicerouter/client/hs:client-ServiceRouter/Client.hsc (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//servicerouter/client/hs:client-ServiceRouter/Client.hsc-deps (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//common/hs/util:hs_struct (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//common/hs/util:hs_std_variant (fbcode//buck2/platform/execution:linux-x86_64#88b1cd0143d85f1e) fbcode//common/hs/util:hs_set (fbcode//buck2/platform/execution:linux-x86_64#88b1cd0143d85f1e) fbcode//common/hs/util:hs_option (fbcode//buck2/platform/execution:linux-x86_64#88b1cd0143d85f1e) fbcode//common/hs/util:hs_map (fbcode//buck2/platform/execution:linux-x86_64#88b1cd0143d85f1e) fbcode//common/hs/util:hs_array (fbcode//buck2/platform/execution:linux-x86_64#88b1cd0143d85f1e) fbcode//common/hs/util:addressable (fbcode//buck2/platform/execution:linux-x86_64#88b1cd0143d85f1e) fbcode//common/hs/util:hs_struct-Foreign/CPP/HsStruct/Unsafe.hsc (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//common/hs/util:hs_struct-Foreign/CPP/HsStruct/Unsafe.hsc-deps (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//common/hs/util:hs_struct-Foreign/CPP/HsStruct/Types.hsc (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//common/hs/util:hs_struct-Foreign/CPP/HsStruct/Types.hsc-deps (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//common/hs/util:hs_std_tuple (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//common/hs/util:hs_option (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) fbcode//common/hs/util:addressable (cfg:linux-x86_64-fbcode-platform010-asan-ubsan-dev#2092a9d2d16c9cde) ``` {https://www.internalfb.com/intern/graphviz/?paste=P1030375195} TODO: fix the new error Reviewed By: simonmar Differential Revision: D52778012 fbshipit-source-id: e070f40b02c81b6522055b257e66120b03de4f2c
- Loading branch information