* Re: [devel] re-writing GNU C; part1.4.1: .rpm produced @ 2016-02-16 13:27 Ivan Zakharyaschev 2016-02-17 8:19 ` Ivan Zakharyaschev 0 siblings, 1 reply; 4+ messages in thread From: Ivan Zakharyaschev @ 2016-02-16 13:27 UTC (permalink / raw) To: ALT Linux Team development discussions [-- Attachment #1: Type: text/plain, Size: 1457 bytes --] Чтобы поскорее иметь возможность подсовывать cuglify/Process в hasher, стал делать .rpm (дурацким временным способом). (Его можно взять в vb2:/home/imz/public/cuglify-WIP/language-c-uglify-1.4.1-1.x86_64.rpm или сделать командой make, приведённой ниже) On Tue, 9 Feb 2016, Ivan Zakharyaschev wrote: > Скачиваем код с хаками > ---------------------- > > $ mkdir cuglify-WIP > $ cd cuglify-WIP $ darcs clone http://hub.darcs.net/imz/cuglify --set-scripts-executable (или, конечно, если он уже склонирован, `darcs pull` внутри -- там новый контекст-файл), а потом: $ darcs clone --context=cuglify/ann1.4.1-language-c.context http://hub.darcs.net/imz/language-c_WIP $ git clone --branch=cuglify/ann1_4 https://github.com/imz/directory > Собираем библиотеку > ------------------- > Наконец, наша библиотека: > > $ pushd language-c_WIP/ > $ cabal sandbox --sandbox=/storage/imz/CABAL-SANDBOX-cuglify init > $ cabal install > $ popd > > Компилируем examples/Process > ---------------------------- > > $ pushd language-c_WIP/ > $ cabal exec -- make -C examples Process $ cabal exec -- make -C examples rpm > $ popd -- Best regards, Ivan ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [devel] re-writing GNU C; part1.4.1: .rpm produced 2016-02-16 13:27 [devel] re-writing GNU C; part1.4.1: .rpm produced Ivan Zakharyaschev @ 2016-02-17 8:19 ` Ivan Zakharyaschev 2016-02-17 9:04 ` Igor Vlasenko 0 siblings, 1 reply; 4+ messages in thread From: Ivan Zakharyaschev @ 2016-02-17 8:19 UTC (permalink / raw) To: ALT Linux Team development discussions [-- Attachment #1: Type: text/plain, Size: 5281 bytes --] On Tue, 16 Feb 2016, Ivan Zakharyaschev wrote: > Чтобы поскорее иметь возможность подсовывать cuglify/Process в hasher, стал > делать .rpm (дурацким временным способом). Я думал ставить в hasher специальный пакет, чтобы заставлять при сборке использовать нечто другое вместо gcc (например, cuglify/Process, clang -- в общем, есть варианты, на чём проверить). (Решил пока всё же в первую очередь доделкой фич в cuglify/Process заняться. Поэтому записываю соображения про подмену gcc в hasher, чтобы не забыть/было что пока обсудить.) При этом пакеты хотят для сборки gcc (иногда -- явно заданной версии). Так пусть эти gcc ставятся. Что-то похожее по смыслу происходит при использовании ccache и distcc: стоит настоящий gcc, но вызовы gcc обрабатываются сначала этими прослойками. (Между прочим, если пробовать это с clang, то gcc тоже должен стоять, потому что, как известно, он ему нужен по зависимости.) Вообще, вокруг gcc есть механизм alternatives для выбора варианта (и /usr/sbin/select-gcc , который ими манипулирует). Когда вчера рассуждал вслух в разговоре с mike@ о том, какая есть практика использования, к примеру, ccache вместо просто gcc в hasher, говорил, что странно, что не видно задокументированного надёжного прямолинейного способа сделать такую подмену, а, кажется, есть только какие-то rpm-макросы, которые по моему предположению меняли вызовы CC (если они соответствующе оформлены). Вчера я почему-то упустил из виду, что gcc и cpp и компания у нас -- символические ссылки, ведущие на gcc_wrapper (а не альтернативы, предосталяемые разными gccN.M). Так что всё под контролем gcc_wrapper. А ведь я давно об этом знал. $ readlink -f /usr/bin/gcc /usr/bin/gcc_wrapper $ readlink -f /usr/bin/cpp /usr/bin/gcc_wrapper $ rpm -q cpp5 -l | fgrep alter /etc/alternatives/packages.d/cpp5 $ cat /etc/alternatives/packages.d/cpp5 /usr/bin/x86_64-alt-linux-cpp /usr/bin/x86_64-alt-linux-cpp-5 511 /usr/share/man/man1/cpp.1.bz2 /usr/share/man/man1/cpp-5.1.bz2 /usr/bin/x86_64-alt-linux-cpp-5 $ Меня, навреное, вчера сбило то, что /usr/bin/gcc всё-таки тоже управляется альтернативами, и сейчас используемая альтернатива для него (gcc_wrapper) предоставляется пакетом gcc-common: $ l /usr/bin/gcc lrwxrwxrwx 1 root root 36 дек 29 2014 /usr/bin/gcc -> /etc/alternatives/links/|usr|bin|gcc $ Не знаю, есть ли в Сизифе другие пакеты, которые другую альтернативу для него дают. (BTW, не смог найти команду, которая бы показывала бы, какие есть установленные в системе альтернативы для определённого пути. Например: хочу знать, какие есть альтернативы для /usr/bin/x86_64-alt-linux-gcc . Только grep-ать /etc/alternatives/?) Какой-нибудь пакет dummy-gcc-clang или dummy-gcc-cuglify, который мы будем просить hasher установить в сборочную среду, мог бы как раз предоставлять альтернативу для /usr/bin/gcc (и /usr/bin/cpp) с очень большим приоритетом. Или задействовать существующий gcc_wrapper для того, что нам хочется (если в нём такое предусмотрено; и ещё бы как-нибудь запретить её переключать, если в gcc_wrapper есть такая возможность). И можно было бы передвигать другие пути к GCC вроде /usr/bin/gcc-5 или /usr/bin/*-gcc , чтобы гарантировать, что к ним напрямую не обращаются во время сборки. (Напимер, файл-триггером, потому что я не уверен, что в hasher есть hook для выполнения команды после установки сборочной среды.) -- Best regards, Ivan ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [devel] re-writing GNU C; part1.4.1: .rpm produced 2016-02-17 8:19 ` Ivan Zakharyaschev @ 2016-02-17 9:04 ` Igor Vlasenko 2016-02-17 9:46 ` [devel] querying alternatives providers; was: " Ivan Zakharyaschev 0 siblings, 1 reply; 4+ messages in thread From: Igor Vlasenko @ 2016-02-17 9:04 UTC (permalink / raw) To: ALT Linux Team development discussions On Wed, Feb 17, 2016 at 11:19:24AM +0300, Ivan Zakharyaschev wrote: > (BTW, не смог найти команду, которая бы показывала бы, какие есть > установленные в системе альтернативы для определённого пути. Например: хочу > знать, какие есть альтернативы для /usr/bin/x86_64-alt-linux-gcc . Только > grep-ать /etc/alternatives/?) По базе repocop можно пробить (базу можно скачать с repocop.altlinux.org: http://repocop.altlinux.org/pub/repocop/data/repocop-data-current.tar.gz ) $ sqlite3 .repocop/db/altlinux-alternatives.db sqlite> select * from altlinux_alternatives where altalternative = '/usr/bin/gcc'; gcc-common-1.4.20-alt1.x86_64|/etc/alternatives/packages.d/gcc-common|0|/usr/bin/gcc|/usr/bin/gcc_wrapper|40|1|0|0 -- I V ^ permalink raw reply [flat|nested] 4+ messages in thread
* [devel] querying alternatives providers; was: Re: re-writing GNU C; part1.4.1: .rpm produced 2016-02-17 9:04 ` Igor Vlasenko @ 2016-02-17 9:46 ` Ivan Zakharyaschev 0 siblings, 0 replies; 4+ messages in thread From: Ivan Zakharyaschev @ 2016-02-17 9:46 UTC (permalink / raw) To: ALT Linux Team development discussions [-- Attachment #1: Type: text/plain, Size: 2727 bytes --] On Wed, 17 Feb 2016, Igor Vlasenko wrote: > On Wed, Feb 17, 2016 at 11:19:24AM +0300, Ivan Zakharyaschev wrote: >> (BTW, не смог найти команду, которая бы показывала бы, какие есть >> установленные в системе альтернативы для определённого пути. Например: хочу >> знать, какие есть альтернативы для /usr/bin/x86_64-alt-linux-gcc . Только >> grep-ать /etc/alternatives/?) > > По базе repocop можно пробить (базу можно скачать с repocop.altlinux.org: > http://repocop.altlinux.org/pub/repocop/data/repocop-data-current.tar.gz ) > > $ sqlite3 .repocop/db/altlinux-alternatives.db > sqlite> select * from altlinux_alternatives where altalternative = '/usr/bin/gcc'; > gcc-common-1.4.20-alt1.x86_64|/etc/alternatives/packages.d/gcc-common|0|/usr/bin/gcc|/usr/bin/gcc_wrapper|40|1|0|0 Спасибо, полезно знать! Это такой глобальный запрос по всему Sisyphus получается, а не просто локальный в своей системе (про отсутствие команды для которого я удивлялся). Заметил, что подобную информацию можно и через APT получить. Заметил, что если пакет несёт альтернативу, то у него в provides есть этот путь с приоритетом в качестве версии: $ rpm -q gcc-common --provides /usr/bin/gcc = 40 gcc-common = 1.4.19-alt1 $ rpm -q gcc5 --provides gcc = 5.2.1 /usr/bin/gcc /usr/bin/x86_64-alt-linux-gcc = 511 /usr/bin/x86_64-alt-linux-gcc-ar = 511 /usr/bin/x86_64-alt-linux-gcc-nm = 511 /usr/bin/x86_64-alt-linux-gcc-ranlib = 511 /usr/bin/x86_64-alt-linux-gcov = 511 /usr/bin/x86_64-alt-linux-gcov-tool = 511 /usr/share/man/man1/gcc.1.bz2 = 511 /usr/share/man/man1/gcov.1.bz2 = 511 gcc5 = 5.2.1-alt1 $ Ну значит, можно по этим путям делать запросы к APT: apt> showpkg /usr/bin/gcc Package: /usr/bin/gcc Versions: Reverse Depends: libopencv2.4-examples,/usr/bin/gcc icfs,/usr/bin/gcc Dependencies: Provides: Reverse Provides: gcc5 5.3.1-alt1 gcc4.9 4.9.2-alt5 gcc4.8 4.8.2-alt5 gcc4.7 4.7.2-alt10 gcc4.6 4.6.3-alt11 gcc4.5 4.5.4-alt4 gcc4.4 4.4.7-alt4 gcc4.3 4.3.2-alt20 gcc4.1 4.1.2-alt11 gcc3.4 3.4.5-alt16 gcc-common 1.4.20-alt1 apt> showpkg /usr/bin/x86_64-alt-linux-gcc Package: /usr/bin/x86_64-alt-linux-gcc Versions: Reverse Depends: libginac-devel,/usr/bin/x86_64-alt-linux-gcc Dependencies: Provides: Reverse Provides: gcc5 5.3.1-alt1 gcc4.9 4.9.2-alt5 gcc4.8 4.8.2-alt5 gcc4.7 4.7.2-alt10 gcc4.6 4.6.3-alt11 gcc4.5 4.5.4-alt4 gcc4.4 4.4.7-alt4 gcc4.3 4.3.2-alt20 gcc4.1 4.1.2-alt11 gcc3.4 3.4.5-alt16 apt> Вот эта вот обнаружившаяся зависимость libginac-devel от можно сказать внутреннего /usr/bin/x86_64-alt-linux-gcc кажется не очень удачной (особенно для подмены gcc -- поэтому я думал передвигать как-то такие пути при пересборке с подменённым gcc, чтобы выявлять случаи прямого обращения.) -- Best regards, Ivan ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-17 9:46 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-02-16 13:27 [devel] re-writing GNU C; part1.4.1: .rpm produced Ivan Zakharyaschev 2016-02-17 8:19 ` Ivan Zakharyaschev 2016-02-17 9:04 ` Igor Vlasenko 2016-02-17 9:46 ` [devel] querying alternatives providers; was: " Ivan Zakharyaschev
ALT Linux Team development discussions This inbox may be cloned and mirrored by anyone: git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \ devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru public-inbox-index devel Example config snippet for mirrors. Newsgroup available over NNTP: nntp://lore.altlinux.org/org.altlinux.lists.devel AGPL code for this site: git clone https://public-inbox.org/public-inbox.git