{-# LANGUAGE DeriveDataTypeable, PatternGuards, RecordWildCards, ConstraintKinds #-}-- | Errors seen by the usermoduleDevelopment.Shake.Internal.Errors(ShakeException (..),throwM ,throwImpure ,errorInternal ,errorStructured ,errorNoRuleToBuildType ,errorRuleDefinedMultipleTimes ,errorMultipleRulesMatch ,errorRuleRecursion ,errorComplexRecursion ,errorNoApply ,errorDirectoryNotFile ,errorNoHash )whereimportData.Tuple.ExtraimportControl.Exception.ExtraimportControl.Monad.IO.ClassimportGeneral.Extra importData.TypeableimportData.List.ExtraimportData.MaybethrowM::MonadIOm =>SomeException->m a throwM =liftIO.throwIOthrowImpure::SomeException->a throwImpure =throwerrorInternal::Partial=>String->SomeExceptionerrorInternal msg =toException$ErrorCall$unlines$("Development.Shake: Internal error, please report to Neil Mitchell ("++msg ++")"):callStackFull alternatives =let(* )=(,)in["_rule_"* "oracle","_Rule_"* "Oracle","_key_"* "question","_Key_"* "Question","_result_"* "answer","_Result_"* "Answer","_addBuiltinRule_"* "addOracle","_apply_"* "askOracle"]errorStructured::String->[(String,MaybeString)]->String->SomeExceptionerrorStructured msg args hint =toException$ErrorCall$unlines$[msg ++(ifnullargs then"."else":")]++[" "++a ++[':'|a /=""]++replicate(as-lengtha +2)' '++b |(a ,b )<-args2 ]++[hint |hint /=""]whereas=maximum$0:map(length.fst)args2 args2 =[(a ,b )|(a ,Justb )<-args ]structured::Bool->String->[(String,MaybeString)]->String->SomeExceptionstructured alt msg args hint =errorStructured (f msg )(map(firstf )args )(f hint )wheref =filter(/='_').(ifalt theng elseid)g xs |res :_<-[to ++g rest |(from ,to )<-alternatives ,Justrest <-[stripPrefixfrom xs ]]=res g(x :xs )=x :g xs g[]=[]errorDirectoryNotFile::FilePath->SomeExceptionerrorDirectoryNotFile dir =errorStructured "Build system error - expected a file, got a directory"[("Directory",Justdir )]"Probably due to calling 'need' on a directory. Shake only permits 'need' on files."errorNoRuleToBuildType::TypeRep->MaybeString->MaybeTypeRep->SomeExceptionerrorNoRuleToBuildType tk k tv =structured (specialIsOracleKey tk )"Build system error - no _rule_ matches the _key_ type"[("_Key_ type",Just$showtk ),("_Key_ value",k ),("_Result_ type",fmapshowtv )]"You are missing a call to _addBuiltinRule_, or your call to _apply_ has the wrong _key_ type"errorRuleDefinedMultipleTimes::TypeRep->[String]->SomeExceptionerrorRuleDefinedMultipleTimes tk locations =structured (specialIsOracleKey tk )"Build system error - _rule_ defined twice at one _key_ type"(("_Key_ type",Just$showtk ):[("Location "++showi ,Justx )|(i ,x )<-zipFrom1locations ])"You have called _addBuiltinRule_ more than once on the same key type"errorMultipleRulesMatch::TypeRep->String->[MaybeString]->SomeExceptionerrorMultipleRulesMatch tk k names =errorStructured ("Build system error - key matches "++(ifnullnames then"no"else"multiple")++" rules")([("Key type",Just$showtk ),("Key value",Justk ),("Rules matched",Just$show$lengthnames )]++[("Rule "++showi ,x )|anyisJustnames ,(i ,x )<-zipFrom1names ])(ifnullnames then"Either add a rule that produces the above key, or stop requiring the above key"else"Modify your rules so only one can produce the above key")errorNoHash::SomeExceptionerrorNoHash =errorStructured "Cannot use shakeChange=ChangeModTime with shakeShare"[]""errorRuleRecursion::TypeRep->String->SomeException-- may involve both rules and oracle, so report as only ruleserrorRuleRecursion tk k =errorStructured "Build system error - recursion detected"[("Key type",Just$showtk ),("Key value",Justk )]"Rules may not be recursive"errorComplexRecursion::[String]->SomeExceptionerrorComplexRecursion ks =errorStructured "Build system error - indirect recursion detected"[("Key value "++showi ,Justk )|(i ,k )<-zipFrom1ks ]"Rules may not be recursive"errorNoApply::TypeRep->MaybeString->String->SomeExceptionerrorNoApply tk k msg =errorStructured "Build system error - cannot currently introduce a dependency (e.g. calling 'apply')"[("Reason",Justmsg ),("Key type",Just$showtk ),("Key value",k )]"Move the call earlier/later"-- Should be in Special, but then we get an import cyclespecialIsOracleKey::TypeRep->BoolspecialIsOracleKey t =con =="OracleQ"wherecon =show$fst$splitTyConAppt -- | Error representing all expected exceptions thrown by Shake.-- Problems when executing rules will be raising using this exception type.dataShakeException =ShakeException {shakeExceptionTarget ::String-- ^ The target that was being built when the exception occured.,shakeExceptionStack ::[String]-- ^ A description of the call stack, one entry per line.,shakeExceptionInner ::SomeException-- ^ The underlying exception that was raised.}derivingTypeableinstanceExceptionShakeException instanceShowShakeException whereshow ShakeException {..}=unlines$"Error when running Shake build system:":shakeExceptionStack ++[displayExceptionshakeExceptionInner ]

AltStyle によって変換されたページ (->オリジナル) /