Notes on Conan

Notes on Conan

I will continuously update this article as soon as I have something in my mind

Overview

Conan provides a well-established client to ease the use of packages. Comparing to Nuget, Conan offers ability to automatically create, deploy and install packages, which is much better than Nuget. I have used Nuget for two years in my previous company, it proved to be a nightmare to use Nuget(you need to write your own script to install the downloaded packages to the right location for Nuget).

Install by pip

For windows need to call chcp 866 to change the code page to 866 in command line otherwise wrapt cannot be installed successfully.

While calling conan on command line, wrapt.wrapper module cannot be found error will be reported. No solution yet.

It seems that the installer for Windows x86_x64 works fine. I can use conan command line without any problem.

Bincrafter and adding remote

Literally, bincrafter sounds like a game. But it is a public repository for Conan with much more packages than conan-center. To use bincrafter the correct URL needs to be added. The syntax is quite similar as Git's:

conan remote add bincrafters "https://api.bintray.com/conan/bincrafters/public-conan"

More information on how to use Bincrafter could be found on this. I just successfully downloaded boost::asio. The good news is that you do not need to download the whole boost library, just the parts you need for your project.

Integration

My way to use the Conan is to create a pkg package under the project folder. Normally my projects have the following folder structure:

MyProject
|--src
|--test
?? |-- unit test
?? |-- system test
|--pkg

src folder contains all source codes, test folder all test cases, ** pkg** folder Conan package recipes. In this way, I could easily create a Conan package and manage the corresponding recipes in Git along with the source codes.

Packaging

To create your own package, you need to first create the package recipe by calling command conan new. About the using of the usage of the conan command could be found on official site. After the running of conan new command, the recipe file - conanfile.py will be generate, say, in my case, it locates in pkg folder. However, the conanfile.py is just some default settings, if you want it to work as your expectation, you need to tweak it a bit:

  • You need to correct the path, including the git repo path, source folder path, etc. The default path is Hello.
  • You need to add requires manually if your package depends on other conan packages. At the beginning I expected the conan could automatically analyze the conanfile.txt, but it would't.

Uploading

Because my team only has 5 members(a really small team), we could use the officially provided conan_server as local package server. I installed a Ubuntu server on VirtualBox and conan_server as well . Just enter conan_server the server will be launched at port 9300. Tweaks needs to be done to assure the working of conan_server:

  • Configure the port mapping between VBox and its host
  • Edit ~/.conan_server/server.conf, changing Write Permission to allow the write access, changing host_name to the IP of VBox host.
  • You can add your own account instead of default demo:demo, but make sure configure the write permission and read permission correctly.
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末巷燥,一起剝皮案震驚了整個(gè)濱河市岁歉,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌指煎,老刑警劉巖,帶你破解...
    沈念sama閱讀 211,265評(píng)論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)兰怠,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,078評(píng)論 2 385
  • 文/潘曉璐 我一進(jìn)店門梦鉴,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人揭保,你說我怎么就攤上這事肥橙。” “怎么了秸侣?”我有些...
    開封第一講書人閱讀 156,852評(píng)論 0 347
  • 文/不壞的土叔 我叫張陵存筏,是天一觀的道長(zhǎng)。 經(jīng)常有香客問我味榛,道長(zhǎng)椭坚,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,408評(píng)論 1 283
  • 正文 為了忘掉前任搏色,我火速辦了婚禮善茎,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘频轿。我一直安慰自己垂涯,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,445評(píng)論 5 384
  • 文/花漫 我一把揭開白布航邢。 她就那樣靜靜地躺著耕赘,像睡著了一般。 火紅的嫁衣襯著肌膚如雪膳殷。 梳的紋絲不亂的頭發(fā)上操骡,一...
    開封第一講書人閱讀 49,772評(píng)論 1 290
  • 那天,我揣著相機(jī)與錄音,去河邊找鬼当娱。 笑死吃既,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的跨细。 我是一名探鬼主播鹦倚,決...
    沈念sama閱讀 38,921評(píng)論 3 406
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼冀惭!你這毒婦竟也來了震叙?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,688評(píng)論 0 266
  • 序言:老撾萬榮一對(duì)情侶失蹤散休,失蹤者是張志新(化名)和其女友劉穎媒楼,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體戚丸,經(jīng)...
    沈念sama閱讀 44,130評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡划址,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,467評(píng)論 2 325
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了限府。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片夺颤。...
    茶點(diǎn)故事閱讀 38,617評(píng)論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖胁勺,靈堂內(nèi)的尸體忽然破棺而出世澜,到底是詐尸還是另有隱情,我是刑警寧澤署穗,帶...
    沈念sama閱讀 34,276評(píng)論 4 329
  • 正文 年R本政府宣布寥裂,位于F島的核電站,受9級(jí)特大地震影響案疲,放射性物質(zhì)發(fā)生泄漏封恰。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,882評(píng)論 3 312
  • 文/蒙蒙 一褐啡、第九天 我趴在偏房一處隱蔽的房頂上張望俭驮。 院中可真熱鬧,春花似錦春贸、人聲如沸混萝。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,740評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽逸嘀。三九已至,卻和暖如春允粤,著一層夾襖步出監(jiān)牢的瞬間崭倘,已是汗流浹背翼岁。 一陣腳步聲響...
    開封第一講書人閱讀 31,967評(píng)論 1 265
  • 我被黑心中介騙來泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留司光,地道東北人琅坡。 一個(gè)月前我還...
    沈念sama閱讀 46,315評(píng)論 2 360
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像残家,于是被迫代替她去往敵國(guó)和親榆俺。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,486評(píng)論 2 348

推薦閱讀更多精彩內(nèi)容