diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Revision history for hpc-codecov
 
+## 0.6.2.0 -- 2024-07-09
+
+- Support searching under the build directory made by
+  ``cabal-install`` 3.12.1.0.
+
 ## 0.6.1.0 -- 2024-05-29
 
 - Suppress warning messages when compiling with ghc 9.10.
diff --git a/hpc-codecov.cabal b/hpc-codecov.cabal
--- a/hpc-codecov.cabal
+++ b/hpc-codecov.cabal
@@ -1,6 +1,6 @@
 cabal-version:       2.0
 name:                hpc-codecov
-version:             0.6.1.0
+version:             0.6.2.0
 synopsis:            Generate reports from hpc data
 license:             BSD3
 license-file:        LICENSE
@@ -68,6 +68,7 @@
                      , GHC == 9.4.8
                      , GHC == 9.6.5
                      , GHC == 9.8.2
+                     , GHC == 9.10.1
 
 library
   hs-source-dirs:      src
diff --git a/src/Trace/Hpc/Codecov/Discover.hs b/src/Trace/Hpc/Codecov/Discover.hs
--- a/src/Trace/Hpc/Codecov/Discover.hs
+++ b/src/Trace/Hpc/Codecov/Discover.hs
@@ -233,7 +233,9 @@
          then do
            let f xs = [mix </> x| x <- xs, x `notElem` ignored]
            contents <- f <$> listDirectory mix
-           return (mb_tix, contents ++ dirs)
+           -- From cabal-install 3.12, the 'mix' directory itself is
+           -- used as the root directory of .mix files.
+           return (mb_tix, mix : contents ++ dirs)
          else return (mb_tix, dirs)
     else return acc
 
diff --git a/src/Trace/Hpc/Codecov/Options.hs b/src/Trace/Hpc/Codecov/Options.hs
--- a/src/Trace/Hpc/Codecov/Options.hs
+++ b/src/Trace/Hpc/Codecov/Options.hs
@@ -198,14 +198,14 @@
       -- argument at this point, to show help and version messages
       -- without specifying ".tix" file.
       let opts0 = foldr ($) emptyOptions flags
-          opts1 = fillDefaultIfNotGiven opts0
+          opts1 = fillDefaultsIfNotGiven opts0
       in  case rest of
             []      -> Right opts1
             (tix:_) -> Right (opts1 {optTix = tix})
     (_, _, errs)  -> Left errs
 
-fillDefaultIfNotGiven :: Options -> Options
-fillDefaultIfNotGiven opts = opts
+fillDefaultsIfNotGiven :: Options -> Options
+fillDefaultsIfNotGiven opts = opts
   { optMixDirs = fillIf null optMixDirs
   , optSrcDirs = fillIf null optSrcDirs
   }
@@ -260,10 +260,9 @@
         , reportExprOnly = optExprOnly opt
         , reportIgnoreDittos = optIgnoreDittos opt
         }
-      tix = optTix opt
       verbose = optVerbose opt
   format <- parseFormat (optFormat opt)
-  target <- parseTarget tix
+  target <- parseTarget (optTix opt)
   case target of
     TixFile path -> pure (rpt1 {reportTix = path
                                ,reportFormat = format})
diff --git a/test/Test/Main.hs b/test/Test/Main.hs
--- a/test/Test/Main.hs
+++ b/test/Test/Main.hs
@@ -11,10 +11,10 @@
 import           System.Environment          (getExecutablePath, lookupEnv,
                                               setEnv, unsetEnv, withArgs)
 import           System.Exit                 (ExitCode)
+import           System.Info                 (os)
 import           System.IO                   (IOMode (..), hClose,
                                               hGetContents, openBinaryFile,
                                               openTempFile)
-import           System.Info                 (os)
 
 #if !MIN_VERSION_base(4,11,0)
 import           Data.Monoid                 ((<>))
@@ -28,7 +28,6 @@
 -- directory
 import           System.Directory            (canonicalizePath,
                                               doesDirectoryExist,
-                                              listDirectory,
                                               removeDirectoryRecursive,
                                               removeFile,
                                               withCurrentDirectory)
@@ -246,6 +245,7 @@
 data SRA =
   SRA { sra_tix      :: FilePath
       , sra_mixs     :: [FilePath]
+      , sra_build    :: Maybe FilePath
       , sra_excludes :: [String]
       , sra_verbose  :: Bool
       , sra_format   :: Format
@@ -256,6 +256,7 @@
 emptySRA = SRA { sra_tix = ""
                , sra_mixs = []
                , sra_excludes = []
+               , sra_build = Nothing
                , sra_verbose = False
                , sra_format = Codecov
                , sra_out = Nothing }
@@ -321,20 +322,8 @@
 getSelfReportCabalArgs :: (FilePath -> IO ()) -> FilePath -> IO SRA
 getSelfReportCabalArgs setup bd = do
   setup bd
-  mb_tix <- findUnder (\p -> takeFileName p == "test-main.tix") bd
-  putStrLn $ "tix: " ++ show mb_tix
-  mb_vanilla <- findUnder (\p -> takeFileName p == "vanilla") bd
-  putStrLn $ "vanilla: " ++ show mb_vanilla
-  case (mb_tix, mb_vanilla) of
-    (Nothing, Nothing) -> error "failed to find tix and vanilla"
-    (Nothing, _) -> error "failed to find tix"
-    (_, Nothing) -> error "failed to find vanilla"
-    (Just tix, Just vanilla) -> do
-      let mixdir = vanilla </> "mix"
-      mixs <- map (mixdir </>) <$> listDirectory mixdir
-      return emptySRA { sra_tix = tix
-                      , sra_mixs = mixs
-                      , sra_excludes = ["Main", "Paths_hpc_codecov"] }
+  pure emptySRA { sra_tix = "cabal:test-main"
+                , sra_build = Just bd }
 
 selfReport :: IO SRA -> TestTree
 selfReport getArgs = testGroup "self"
@@ -367,7 +356,7 @@
                  shouldFail (sraMain args'))
   ]
   where
-    tixOnly sra = emptySRA { sra_tix = sra_tix sra }
+    tixOnly _sra = emptySRA { sra_tix = "test-main.tix" }
 
 
 -- ------------------------------------------------------------------------
@@ -551,6 +540,7 @@
     args =
       map ("--mix=" ++) (sra_mixs sra) ++
       map ("--exclude=" ++) (sra_excludes sra) ++
+      maybe [] (\d -> ["--build=" ++ d]) (sra_build sra) ++
       maybe [] (\p -> ["--out=" ++ p]) (sra_out sra) ++
       ["--verbose" | sra_verbose sra] ++
       ["--format=" ++ asFormat (sra_format sra)] ++
diff --git a/test/data/project1/stack.yaml b/test/data/project1/stack.yaml
--- a/test/data/project1/stack.yaml
+++ b/test/data/project1/stack.yaml
@@ -17,7 +17,7 @@
 #
 # resolver: ./custom-snapshot.yaml
 # resolver: https://example.com/snapshots/2018-01-01.yaml
-resolver: lts-22.23
+resolver: lts-22.28
 
 # User packages to be built.
 # Various formats can be used as shown in the example below.
