Skip to content

Commit

Permalink
Only run upgrade checks when building with a supporting LF version
Browse files Browse the repository at this point in the history
  • Loading branch information
dylant-da committed Jul 10, 2024
1 parent 1ec643d commit d3864b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sdk/compiler/damlc/daml-compiler/src/DA/Daml/Compiler/Dar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ buildDar service PackageConfigFields {..} ifDir dalfInput warnBadInterfaceInstan
Nothing -> mergePkgs pMeta lfVersion . map fst <$> usesE GeneratePackage files
Just _ -> generateSerializedPackage pName pVersion pMeta files

MaybeT $
runDiagnosticCheck $ diagsToIdeResult (toNormalizedFilePath' pSrc) $
TypeChecker.Upgrade.checkUpgrade lfVersion pTypecheckUpgrades warnBadInterfaceInstances pkg mbUpgradedPackage
when (lfVersion `LF.supports` LF.featurePackageUpgrades) $
MaybeT $
runDiagnosticCheck $ diagsToIdeResult (toNormalizedFilePath' pSrc) $
TypeChecker.Upgrade.checkUpgrade lfVersion pTypecheckUpgrades warnBadInterfaceInstances pkg mbUpgradedPackage
MaybeT $ finalPackageCheck (toNormalizedFilePath' pSrc) pkg

let pkgModuleNames = map (Ghc.mkModuleName . T.unpack) $ LF.packageModuleNames pkg
Expand Down

0 comments on commit d3864b7

Please sign in to comment.