ghcup DEPRECATED IN FAVOR OF haskell/ghcup-hs开源项目

我要开发同款
匿名用户2021年11月23日
49阅读
开发技术SHELL
所属分类终端/远程登录、应用工具
授权协议BSD-3-Clause License

作品详情

THISPROJECTISNOWDEPRECATEDINFAVOROFghcup-hs

--

ghcupmakesiteasytoinstallspecificversionsofghconGNU/LinuxaswellasmacOS(akaDarwin),andcanalsobootstrapafreshHaskelldeveloperenvironmentfromscratch.ItfollowstheunixUNIXphilosophyofdoonethinganddoitwell.

Similarinscopetorustup,pyenvandjenv.

Ubuntuusersmaypreferhvr'sppa.

ThisprojectwasstartedwhenCMwasswitchingfromstacktocabalnix-stylebuilds.

TableofContentsInstallationUsageManpagesDesigngoalsHowKnownusersKnownproblemsFAQInstallation

Chooseoneofthefollowinginstallationmethods.

Simplebootstrapofghcup,GHCandcabal-install#completebootstrapcurlhttps://gitlab.haskell.org/haskell/ghcup/raw/master/bootstrap-haskell-sSf|sh#prepareyourenvironment."$HOME/.ghcup/env"echo'.$HOME/.ghcup/env'>>"$HOME/.bashrc"#orsimilar#nowcreateaproject,suchas:mkdirmyproject&&cdmyprojectcabalinit-n--is-executablecabalv2-runManualinstall

JustplacetheghcupshellscriptintoyourPATHanywhere.

E.g.:

(mkdir-p~/.ghcup/bin&&curlhttps://gitlab.haskell.org/haskell/ghcup/raw/master/ghcup>~/.ghcup/bin/ghcup&&chmod+x~/.ghcup/bin/ghcup)&&echo"Success"

ThenadjustyourPATHin~/.bashrc(orsimilar,dependingonyourshell)likeso,forexample:

exportPATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$PATH"

Securityawareusersmaywanttousethefilesfromthereleasepageandverifythegpgsignatures.

Usage

Seeghcup--help.

Commonusecasesare:

#installthelastknown"best"GHCversionghcupinstall#installaspecificGHCversionghcupinstall8.2.2#setthecurrently"active"GHCversionghcupset8.4.4#installcabal-installghcupinstall-cabal#updatecabal-installcabalnew-installcabal-install

Generallythisismeanttobeusedwithcabal-install,whichhandlesyourhaskellpackagesandcandemandthataspecificversionofghcisavailable,whichghcupcando.

Manpages

Formanpagestoworkyouneedman-dbasyourmanprovider,thenissuemanghc.Manpagesonlyworkforthecurrentlysetghc.MANPATHmayberequiredtobeunset.

Designgoalssimplicitynon-interactiveportabledoonethinganddoitwell(UNIXphilosophy)Non-goalsinvokingsudo,apt-getoranypackagemanagerhandlingsystempackageshandlingcabalprojectsbeingastackalternativeHow

InstallsaspecifiedGHCversioninto~/.ghcup/ghc/<ver>,andplacesghc-<ver>symlinksin~/.ghcup/bin/.

Optionally,anunversionedghclinkcanpointtoadefaultversionofyourchoice.

ThisusesprecompiledGHCbinariesthathavebeencompiledonfedora/debianbyupstreamGHC.

Alternatively,youcanalsotellittocompilefromsource(notethatthismightfailduetomissingrequirements).

Inadditionthisscriptcanalsoinstallcabal-install.

KnownusersvabalKnownproblemsLimiteddistributionssupported

CurrentlyonlyGNU/LinuxdistributionscompatiblewiththeupstreamGHCbinariesaresupported.

Precompiledbinaries

Sincethisusesprecompiledbinariesyoumayrunintoseveralproblems.

Missinglibtinfo(ncurses)

Youmayrunintoproblemswithncursesandmissinglibtinfo,incaseyourdistributiondoesn'tusethelegacywayofbuildingncursesandhasnocompatibilitysymlinksinplace.

Askyourdistributoronhowtosolvethisortrytocompilefromsourceviaghcupcompile<version>.

Libnumarequired

ThiswasabuginthebuildsystemofsomeGHCversionsthatleadtounconditionallyenabledlibnumasupport.Tomitigatethisyoumighthavetoinstallthelibnumapackageofyourdistribution.Seehereforadiscussion.

Compilation

AlthoughthisscriptcancompileGHCforyou,it'sjustaverythinwrapperaroundthebuildsystem.Itmakesnoeffortintryingtofigureoutwhetheryouhavethecorrecttoolchainandthecorrectdependencies.RefertotheofficialdocsonhowtoprepareyourenvironmentforbuildingGHC.

FAQWhyreimplementstack?

ghcupisnotareimplementationofstack.TheonlycommonpartisautomaticinstallationofGHC,buteventhatdiffersinscopeanddesign.

Whynotcontributetostackandcreatealibraryforthecommonpart?

Whilethismightbeaninterestingidea,ghcupisaboutsimplicity.

Whywritea>1000kLOCbashscript?

ghcupisPOSIXsh.

Whywritea>1000kLOCPOSIXshscript?

Mainlybecausetheimplementationisfairlystraight-forwardandthescriptishighlyportable.NoneedtobootstrapanythingorsetupyetanotherCItobuildghcupbinariesforallpossiblearchesanddistrosjusttoperformaverysimpletask:identifydistroandplatformanddownloadaGHCbindist.

Whynotsupportwindows?

ConsiderusingChocolateyorghcups.

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论