Skip to content
Snippets Groups Projects
Verified Commit 09aec51b authored by Rodrigo Mesquita's avatar Rodrigo Mesquita :seedling:
Browse files

Location stack

parent 6cca1642
No related branches found
No related tags found
1 merge request!26Location migration
......@@ -82,7 +82,7 @@ index f5e64fd..0000000
-testDeps xs ys = map fst $ nub $ componentPackageDeps xs ++ componentPackageDeps ys
diff --git a/SetupHooks.hs b/SetupHooks.hs
new file mode 100644
index 0000000..cfd0445
index 0000000..8ca1acf
--- /dev/null
+++ b/SetupHooks.hs
@@ -0,0 +1,119 @@
......@@ -123,7 +123,7 @@ index 0000000..cfd0445
+ ( unUnqualComponentName )
+import Distribution.Verbosity ( Verbosity, normal )
+import System.FilePath ( takeDirectory, (</>) )
+import Distribution.Utils.Path ( getSymbolicPath )
+import Distribution.Utils.Path ( getSymbolicPath, makeRelativePathEx )
+
+setupHooks :: SetupHooks
+setupHooks =
......@@ -193,36 +193,18 @@ index 0000000..cfd0445
+
+ pkg = localPkgDescr lbi
+ verbosity = buildingWhatVerbosity flags
+ buildModulePath = uncurry (</>) (buildModuleResult lbi mainLibTargetInfo pkg)
+ buildModulePath = getSymbolicPath $ location (buildModuleResult lbi mainLibTargetInfo pkg)
+
+buildModuleResult :: LocalBuildInfo -> TargetInfo -> PackageDescription -> Location
+buildModuleResult lbi tgt pkg = (autogendir, "Build_" ++ pkgNm ++ ".hs")
+buildModuleResult lbi tgt pkg = Location autogendir (makeRelativePathEx $ "Build_" ++ pkgNm ++ ".hs")
+ where
+ unPackageName' = unPackageName . packageName
+ pkgNm = unPackageName' $ package pkg
+ -- We want the symbolic path relative to the package.
+ autogendir = getSymbolicPath $ autogenComponentModulesDir lbi (targetCLBI tgt)
+ autogendir = autogenComponentModulesDir lbi (targetCLBI tgt)
+
+testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [UnitId]
+testDeps xs ys = map fst $ nub $ componentPackageDeps xs ++ componentPackageDeps ys
diff --git a/cabal.project b/cabal.project
index a5a8c2b..9f7bc65 100644
--- a/cabal.project
+++ b/cabal.project
@@ -35,6 +35,11 @@
-- confirmed by reviewing the snapshot on Stackage. For example, at:
-- https://www.stackage.org/lts-21.13/cabal.config.
--
-with-compiler: ghc-9.4.7
-import: cabal.config
+-- with-compiler: ghc-9.4.7
+-- import: cabal.config
packages: .
+ ~/ghc-dev/cabal-stf/cabal/Cabal
+ ~/ghc-dev/cabal-stf/cabal/Cabal-hooks/
+ ~/ghc-dev/cabal-stf/cabal/Cabal-syntax/
+
+allow-newer: base, Cabal, ghc-bignum, ghc-boot, ghc-boot-th, ghc-prim, parsec, text, template-haskell, containers, process
diff --git a/src/Stack/ComponentFile.hs b/src/Stack/ComponentFile.hs
index 774de84..0ac57c4 100644
--- a/src/Stack/ComponentFile.hs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment