------------------------------------------------------------------------------- |-- Module : Distribution.Simple.PreProcess-- Copyright : (c) 2003-2005, Isaac Jones, Malcolm Wallace---- Maintainer : cabal-devel@haskell.org-- Portability : portable---- This defines a 'PreProcessor' abstraction which represents a pre-processor-- that can transform one kind of file into another. There is also a-- 'PPSuffixHandler' which is a combination of a file extension and a function-- for configuring a 'PreProcessor'. It defines a bunch of known built-in-- preprocessors like @cpp@, @cpphs@, @c2hs@, @hsc2hs@, @happy@, @alex@ etc and-- lists them in 'knownSuffixHandlers'. On top of this it provides a function-- for actually preprocessing some sources given a bunch of known suffix-- handlers. This module is not as good as it could be, it could really do with-- a rewrite to address some of the problems we have with pre-processors.{- Copyright (c) 2003-2005, Isaac Jones, Malcolm Wallace
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Isaac Jones nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -}moduleDistribution.Simple.PreProcess(preprocessComponent,knownSuffixHandlers,ppSuffixes,PPSuffixHandler,PreProcessor(..),mkSimplePreProcessor,runSimplePreProcessor,ppCpp,ppCpp',ppGreenCard,ppC2hs,ppHsc2hs,ppHappy,ppAlex,ppUnlit)whereimportControl.MonadimportDistribution.Simple.PreProcess.Unlit(unlit)importDistribution.Package(Package(..),PackageName(..))importqualifiedDistribution.ModuleNameasModuleNameimportDistribution.PackageDescriptionasPD(PackageDescription(..),BuildInfo(..),Executable(..),Library(..),libModules,TestSuite(..),testModules,TestSuiteInterface(..))importqualifiedDistribution.InstalledPackageInfoasInstalled(InstalledPackageInfo_(..))importqualifiedDistribution.Simple.PackageIndexasPackageIndeximportDistribution.Simple.Compiler(CompilerFlavor(..),Compiler(..),compilerFlavor,compilerVersion)importDistribution.Simple.LocalBuildInfo(LocalBuildInfo(..),Component(..))importDistribution.Simple.BuildPaths(autogenModulesDir,cppHeaderName)importDistribution.Simple.Utils(createDirectoryIfMissingVerbose,withUTF8FileContents,writeUTF8File,die,setupMessage,intercalate,copyFileVerbose,findFileWithExtension,findFileWithExtension')importDistribution.Simple.Program(Program(..),ConfiguredProgram(..),programPath,lookupProgram,requireProgram,requireProgramVersion,rawSystemProgramConf,rawSystemProgram,greencardProgram,cpphsProgram,hsc2hsProgram,c2hsProgram,happyProgram,alexProgram,haddockProgram,ghcProgram,gccProgram)importDistribution.Simple.Test(writeSimpleTestStub,stubFilePath,stubName)importDistribution.System(OS(OSX,Windows),buildOS)importDistribution.TextimportDistribution.Version(Version(..),anyVersion,orLaterVersion)importDistribution.VerbosityimportData.Maybe(fromMaybe)importData.List(nub)importSystem.Directory(getModificationTime,doesFileExist)importSystem.Info(os,arch)importSystem.FilePath(splitExtension,dropExtensions,(</>),(<.>),takeDirectory,normalise,replaceExtension)-- |The interface to a preprocessor, which may be implemented using an-- external program, but need not be. The arguments are the name of-- the input file, the name of the output file and a verbosity level.-- Here is a simple example that merely prepends a comment to the given-- source file:---- > ppTestHandler :: PreProcessor-- > ppTestHandler =-- > PreProcessor {-- > platformIndependent = True,-- > runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->-- > do info verbosity (inFile++" has been preprocessed to "++outFile)-- > stuff <- readFile inFile-- > writeFile outFile ("-- preprocessed as a test\n\n" ++ stuff)-- > return ExitSuccess---- We split the input and output file names into a base directory and the-- rest of the file name. The input base dir is the path in the list of search-- dirs that this file was found in. The output base dir is the build dir where-- all the generated source files are put.---- The reason for splitting it up this way is that some pre-processors don't-- simply generate one output .hs file from one input file but have-- dependencies on other genereated files (notably c2hs, where building one-- .hs file may require reading other .chi files, and then compiling the .hs-- file may require reading a generated .h file). In these cases the generated-- files need to embed relative path names to each other (eg the generated .hs-- file mentions the .h file in the FFI imports). This path must be relative to-- the base directory where the genereated files are located, it cannot be-- relative to the top level of the build tree because the compilers do not-- look for .h files relative to there, ie we do not use \"-I .\", instead we-- use \"-I dist\/build\" (or whatever dist dir has been set by the user)---- Most pre-processors do not care of course, so mkSimplePreProcessor and-- runSimplePreProcessor functions handle the simple case.--dataPreProcessor=PreProcessor{-- Is the output of the pre-processor platform independent? eg happy output-- is portable haskell but c2hs's output is platform dependent.-- This matters since only platform independent generated code can be-- inlcuded into a source tarball.platformIndependent::Bool,-- TODO: deal with pre-processors that have implementaion dependent output-- eg alex and happy have --ghc flags. However we can't really inlcude-- ghc-specific code into supposedly portable source tarballs.runPreProcessor::(FilePath,FilePath)-- Location of the source file relative to a base dir->(FilePath,FilePath)-- Output file name, relative to an output base dir->Verbosity-- verbosity->IO()-- Should exit if the preprocessor fails}mkSimplePreProcessor::(FilePath->FilePath->Verbosity->IO())->(FilePath,FilePath)->(FilePath,FilePath)->Verbosity->IO()mkSimplePreProcessorsimplePP(inBaseDir,inRelativeFile)(outBaseDir,outRelativeFile)verbosity=simplePPinFileoutFileverbositywhereinFile=normalise(inBaseDir</>inRelativeFile)outFile=normalise(outBaseDir</>outRelativeFile)runSimplePreProcessor::PreProcessor->FilePath->FilePath->Verbosity->IO()runSimplePreProcessorppinFileoutFileverbosity=runPreProcessorpp(".",inFile)(".",outFile)verbosity-- |A preprocessor for turning non-Haskell files with the given extension-- into plain Haskell source files.typePPSuffixHandler=(String,BuildInfo->LocalBuildInfo->PreProcessor)-- | Apply preprocessors to the sources from 'hsSourceDirs' for a given-- component (lib, exe, or test suite).preprocessComponent::PackageDescription->Component->LocalBuildInfo->Bool->Verbosity->[PPSuffixHandler]->IO()preprocessComponentpdcomplbiisSrcDistverbosityhandlers=casecompof(CLiblib@Library{libBuildInfo=bi})->doletdirs=hsSourceDirsbi++[autogenModulesDirlbi]setupMessageverbosity"Preprocessing library"(packageIdpd)forM_(mapModuleName.toFilePath$libModuleslib)$predirs(buildDirlbi)(localHandlersbi)(CExeexe@Executable{buildInfo=bi,exeName=nm})->doletexeDir=buildDirlbi</>nm</>nm++"-tmp"dirs=hsSourceDirsbi++[autogenModulesDirlbi]setupMessageverbosity("Preprocessing executable '"++nm++"' for")(packageIdpd)forM_(mapModuleName.toFilePath$otherModulesbi)$predirsexeDir(localHandlersbi)pre(hsSourceDirsbi)exeDir(localHandlersbi)$dropExtensions(modulePathexe)CTesttest@TestSuite{testName=nm}->dosetupMessageverbosity("Preprocessing test suite '"++nm++"' for")(packageIdpd)casetestInterfacetestofTestSuiteExeV10_f->preProcessTesttestf$buildDirlbi</>testNametest</>testNametest++"-tmp"TestSuiteLibV09__->dolettestDir=buildDirlbi</>stubNametest</>stubNametest++"-tmp"writeSimpleTestStubtesttestDirpreProcessTesttest(stubFilePathtest)testDirTestSuiteUnsupportedtt->die$"No support for preprocessing test "++"suite type "++displayttwherebuiltinSuffixes|NHC==compilerFlavor(compilerlbi)=["hs","lhs","gc"]|otherwise=["hs","lhs"]localHandlersbi=[(ext,hbilbi)|(ext,h)<-handlers]predirsdirlhndlrsfp=preprocessFiledirsdirisSrcDistfpverbositybuiltinSuffixeslhndlrspreProcessTesttestexePathtestDir=doletbi=testBuildInfotestbiHandlers=localHandlersbisourceDirs=hsSourceDirsbi++[autogenModulesDirlbi]sequence_[preprocessFilesourceDirs(buildDirlbi)isSrcDist(ModuleName.toFilePathmodu)verbositybuiltinSuffixesbiHandlers|modu<-testModulestest]preprocessFile(testDir:(hsSourceDirsbi))testDirisSrcDist(dropExtensions$exePath)verbositybuiltinSuffixesbiHandlers--TODO: try to list all the modules that could not be found-- not just the first one. It's annoying and slow due to the need-- to reconfigure after editing the .cabal file each time.-- |Find the first extension of the file that exists, and preprocess it-- if required.preprocessFile::[FilePath]-- ^source directories->FilePath-- ^build directory->Bool-- ^preprocess for sdist->FilePath-- ^module file name->Verbosity-- ^verbosity->[String]-- ^builtin suffixes->[(String,PreProcessor)]-- ^possible preprocessors->IO()preprocessFilesearchLocbuildLocforSDistbaseFileverbositybuiltinSuffixeshandlers=do-- look for files in the various source dirs with this module name-- and a file extension of a known preprocessorpsrcFiles<-findFileWithExtension'(mapfsthandlers)searchLocbaseFilecasepsrcFilesof-- no preprocessor file exists, look for an ordinary source file-- just to make sure one actually exists at all for this module.-- Note: by looking in the target/output build dir too, we allow-- source files to appear magically in the target build dir without-- any corresponding "real" source file. This lets custom Setup.hs-- files generate source modules directly into the build dir without-- the rest of the build system being aware of it (somewhat dodgy)Nothing->dobsrcFiles<-findFileWithExtensionbuiltinSuffixes(buildLoc:searchLoc)baseFilecasebsrcFilesofNothing->die$"can't find source for "++baseFile++" in "++intercalate", "searchLoc_->return()-- found a pre-processable file in one of the source dirsJust(psrcLoc,psrcRelFile)->dolet(srcStem,ext)=splitExtensionpsrcRelFilepsrcFile=psrcLoc</>psrcRelFilepp=fromMaybe(error"Internal error in preProcess module: Just expected")(lookup(tailNotNullext)handlers)-- Preprocessing files for 'sdist' is different from preprocessing-- for 'build'. When preprocessing for sdist we preprocess to-- avoid that the user has to have the preprocessors available.-- ATM, we don't have a way to specify which files are to be-- preprocessed and which not, so for sdist we only process-- platform independent files and put them into the 'buildLoc'-- (which we assume is set to the temp. directory that will become-- the tarball).--TODO: eliminate sdist variant, just supply different handlerswhen(notforSDist||forSDist&&platformIndependentpp)$do-- look for existing pre-processed source file in the dest dir to-- see if we really have to re-run the preprocessor.ppsrcFiles<-findFileWithExtensionbuiltinSuffixes[buildLoc]baseFilerecomp<-caseppsrcFilesofNothing->returnTrueJustppsrcFile->dobtime<-getModificationTimeppsrcFileptime<-getModificationTimepsrcFilereturn(btime<ptime)whenrecomp$doletdestDir=buildLoc</>dirNamesrcStemcreateDirectoryIfMissingVerboseverbosityTruedestDirrunPreProcessorWithHsBootHackpp(psrcLoc,psrcRelFile)(buildLoc,srcStem<.>"hs")wheredirName=takeDirectorytailNotNull[]=[]tailNotNullx=tailx-- FIXME: This is a somewhat nasty hack. GHC requires that hs-boot files-- be in the same place as the hs files, so if we put the hs file in dist/-- then we need to copy the hs-boot file there too. This should probably be-- done another way. Possibly we should also be looking for .lhs-boot-- files, but I think that preprocessors only produce .hs files.runPreProcessorWithHsBootHackpp(inBaseDir,inRelativeFile)(outBaseDir,outRelativeFile)=dorunPreProcessorpp(inBaseDir,inRelativeFile)(outBaseDir,outRelativeFile)verbosityexists<-doesFileExistinBootwhenexists$copyFileVerboseverbosityinBootoutBootwhereinBoot=replaceExtensioninFile"hs-boot"outBoot=replaceExtensionoutFile"hs-boot"inFile=normalise(inBaseDir</>inRelativeFile)outFile=normalise(outBaseDir</>outRelativeFile)-- -------------------------------------------------------------- * known preprocessors-- ------------------------------------------------------------ppGreenCard::BuildInfo->LocalBuildInfo->PreProcessorppGreenCard_lbi=PreProcessor{platformIndependent=False,runPreProcessor=mkSimplePreProcessor$\inFileoutFileverbosity->rawSystemProgramConfverbositygreencardProgram(withProgramslbi)(["-tffi","-o"++outFile,inFile])}-- This one is useful for preprocessors that can't handle literate source.-- We also need a way to chain preprocessors.ppUnlit::PreProcessorppUnlit=PreProcessor{platformIndependent=True,runPreProcessor=mkSimplePreProcessor$\inFileoutFile_verbosity->withUTF8FileContentsinFile$\contents->either(writeUTF8FileoutFile)die(unlitinFilecontents)}ppCpp::BuildInfo->LocalBuildInfo->PreProcessorppCpp=ppCpp'[]ppCpp'::[String]->BuildInfo->LocalBuildInfo->PreProcessorppCpp'extraArgsbilbi=casecompilerFlavor(compilerlbi)ofGHC->ppGhcCpp(cppArgs++extraArgs)bilbi_->ppCpphs(cppArgs++extraArgs)bilbiwherecppArgs=getCppOptionsbilbippGhcCpp::[String]->BuildInfo->LocalBuildInfo->PreProcessorppGhcCppextraArgs_bilbi=PreProcessor{platformIndependent=False,runPreProcessor=mkSimplePreProcessor$\inFileoutFileverbosity->do(ghcProg,ghcVersion,_)<-requireProgramVersionverbosityghcProgramanyVersion(withProgramslbi)rawSystemProgramverbosityghcProg$["-E","-cpp"]-- This is a bit of an ugly hack. We're going to-- unlit the file ourselves later on if appropriate,-- so we need GHC not to unlit it now or it'll get-- double-unlitted. In the future we might switch to-- using cpphs --unlit instead.++(ifghcVersion>=Version[6,6][]then["-x","hs"]else[])++(ifuse_optP_Plbithen["-optP-P"]else[])++["-optP-include","-optP"++(autogenModulesDirlbi</>cppHeaderName)]++["-o",outFile,inFile]++extraArgs}ppCpphs::[String]->BuildInfo->LocalBuildInfo->PreProcessorppCpphsextraArgs_bilbi=PreProcessor{platformIndependent=False,runPreProcessor=mkSimplePreProcessor$\inFileoutFileverbosity->do(cpphsProg,cpphsVersion,_)<-requireProgramVersionverbositycpphsProgramanyVersion(withProgramslbi)rawSystemProgramverbositycpphsProg$("-O"++outFile):inFile:"--noline":"--strip":(ifcpphsVersion>=Version[1,6][]then["--include="++(autogenModulesDirlbi</>cppHeaderName)]else[])++extraArgs}-- Haddock versions before 0.8 choke on #line and #file pragmas. Those-- pragmas are necessary for correct links when we preprocess. So use-- -optP-P only if the Haddock version is prior to 0.8.use_optP_P::LocalBuildInfo->Booluse_optP_Plbi=caselookupProgramhaddockProgram(withProgramslbi)ofJust(ConfiguredProgram{programVersion=Justversion})|version>=Version[0,8][]->False_->TrueppHsc2hs::BuildInfo->LocalBuildInfo->PreProcessorppHsc2hsbilbi=PreProcessor{platformIndependent=False,runPreProcessor=mkSimplePreProcessor$\inFileoutFileverbosity->do(gccProg,_)<-requireProgramverbositygccProgram(withProgramslbi)rawSystemProgramConfverbosityhsc2hsProgram(withProgramslbi)$["--cc="++programPathgccProg,"--ld="++programPathgccProg]-- Additional gcc options++["--cflag="++opt|opt<-programDefaultArgsgccProg++programOverrideArgsgccProg]++["--lflag="++opt|opt<-programDefaultArgsgccProg++programOverrideArgsgccProg]-- OSX frameworks:++[what++"=-F"++opt|isOSX,opt<-nub(concatMapInstalled.frameworkDirspkgs),what<-["--cflag","--lflag"]]++["--lflag="++arg|isOSX,opt<-PD.frameworksbi++concatMapInstalled.frameworkspkgs,arg<-["-framework",opt]]-- Note that on ELF systems, wherever we use -L, we must also use -R-- because presumably that -L dir is not on the normal path for the-- system's dynamic linker. This is needed because hsc2hs works by-- compiling a C program and then running it.++["--cflag="++opt|opt<-hcDefines(compilerlbi)]++["--cflag="++opt|opt<-sysDefines]-- Options from the current package:++["--cflag=-I"++dir|dir<-PD.includeDirsbi]++["--cflag="++opt|opt<-PD.ccOptionsbi++PD.cppOptionsbi]++["--lflag=-L"++opt|opt<-PD.extraLibDirsbi]++["--lflag=-Wl,-R,"++opt|isELF,opt<-PD.extraLibDirsbi]++["--lflag=-l"++opt|opt<-PD.extraLibsbi]++["--lflag="++opt|opt<-PD.ldOptionsbi]-- Options from dependent packages++["--cflag="++opt|pkg<-pkgs,opt<-["-I"++opt|opt<-Installed.includeDirspkg]++[opt|opt<-Installed.ccOptionspkg]++["-I"++autogenModulesDirlbi,"-include",autogenModulesDirlbi</>cppHeaderName]]++["--lflag="++opt|pkg<-pkgs,opt<-["-L"++opt|opt<-Installed.libraryDirspkg]++["-Wl,-R,"++opt|isELF,opt<-Installed.libraryDirspkg]++["-l"++opt|opt<-Installed.extraLibrariespkg]++[opt|opt<-Installed.ldOptionspkg]]++["-o",outFile,inFile]}wherepkgs=PackageIndex.topologicalOrder(packageHacks(installedPkgslbi))isOSX=casebuildOSofOSX->True;_->FalseisELF=casebuildOSofOSX->False;Windows->False;_->True;packageHacks=casecompilerFlavor(compilerlbi)ofGHC->hackRtsPackage_->id-- We don't link in the actual Haskell libraries of our dependencies, so-- the -u flags in the ldOptions of the rts package mean linking fails on-- OS X (it's ld is a tad stricter than gnu ld). Thus we remove the-- ldOptions for GHC's rts package:hackRtsPackageindex=casePackageIndex.lookupPackageNameindex(PackageName"rts")of[(_,[rts])]->PackageIndex.insertrts{Installed.ldOptions=[]}index_->error"No (or multiple) ghc rts package is registered!!"ppC2hs::BuildInfo->LocalBuildInfo->PreProcessorppC2hsbilbi=PreProcessor{platformIndependent=False,runPreProcessor=\(inBaseDir,inRelativeFile)(outBaseDir,outRelativeFile)verbosity->do(c2hsProg,_,_)<-requireProgramVersionverbosityc2hsProgram(orLaterVersion(Version[0,15][]))(withProgramslbi)(gccProg,_)<-requireProgramverbositygccProgram(withProgramslbi)rawSystemProgramverbosityc2hsProg$-- Options from the current package:["--cpp="++programPathgccProg,"--cppopts=-E"]++["--cppopts="++opt|opt<-getCppOptionsbilbi]++["--include="++outBaseDir]-- Options from dependent packages++["--cppopts="++opt|pkg<-pkgs,opt<-["-I"++opt|opt<-Installed.includeDirspkg]++[opt|opt@('-':c:_)<-Installed.ccOptionspkg,c`elem`"DIU"]]--TODO: install .chi files for packages, so we can --include-- those dirs here, for the dependencies-- input and output files++["--output-dir="++outBaseDir,"--output="++outRelativeFile,inBaseDir</>inRelativeFile]}wherepkgs=PackageIndex.topologicalOrder(installedPkgslbi)--TODO: perhaps use this with hsc2hs too--TODO: remove cc-options from cpphs for cabal-version: >= 1.10getCppOptions::BuildInfo->LocalBuildInfo->[String]getCppOptionsbilbi=hcDefines(compilerlbi)++sysDefines++cppOptionsbi++["-I"++dir|dir<-PD.includeDirsbi]++[opt|opt@('-':c:_)<-PD.ccOptionsbi,c`elem`"DIU"]sysDefines::[String]sysDefines=["-D"++os++"_"++loc++"_OS"|loc<-locations]++["-D"++arch++"_"++loc++"_ARCH"|loc<-locations]wherelocations=["BUILD","HOST"]hcDefines::Compiler->[String]hcDefinescomp=casecompilerFlavorcompofGHC->["-D__GLASGOW_HASKELL__="++versionIntversion]JHC->["-D__JHC__="++versionIntversion]NHC->["-D__NHC__="++versionIntversion]Hugs->["-D__HUGS__"]_->[]whereversion=compilerVersioncomp-- TODO: move this into the compiler abstraction-- FIXME: this forces GHC's crazy 4.8.2 -> 408 convention on all the other-- compilers. Check if that's really what they want.versionInt::Version->StringversionInt(Version{versionBranch=[]})="1"versionInt(Version{versionBranch=[n]})=shownversionInt(Version{versionBranch=n1:n2:_})=-- 6.8.x -> 608-- 6.10.x -> 610lets1=shown1s2=shown2middle=cases2of_:_:_->""_->"0"ins1++middle++s2ppHappy::BuildInfo->LocalBuildInfo->PreProcessorppHappy_lbi=pp{platformIndependent=True}wherepp=standardPPlbihappyProgram(hcFlagshc)hc=compilerFlavor(compilerlbi)hcFlagsGHC=["-agc"]hcFlags_=[]ppAlex::BuildInfo->LocalBuildInfo->PreProcessorppAlex_lbi=pp{platformIndependent=True}wherepp=standardPPlbialexProgram(hcFlagshc)hc=compilerFlavor(compilerlbi)hcFlagsGHC=["-g"]hcFlags_=[]standardPP::LocalBuildInfo->Program->[String]->PreProcessorstandardPPlbiprogargs=PreProcessor{platformIndependent=False,runPreProcessor=mkSimplePreProcessor$\inFileoutFileverbosity->rawSystemProgramConfverbosityprog(withProgramslbi)(args++["-o",outFile,inFile])}-- |Convenience function; get the suffixes of these preprocessors.ppSuffixes::[PPSuffixHandler]->[String]ppSuffixes=mapfst-- |Standard preprocessors: GreenCard, c2hs, hsc2hs, happy, alex and cpphs.knownSuffixHandlers::[PPSuffixHandler]knownSuffixHandlers=[("gc",ppGreenCard),("chs",ppC2hs),("hsc",ppHsc2hs),("x",ppAlex),("y",ppHappy),("ly",ppHappy),("cpphs",ppCpp)]