Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 269491 - git.eclass Invent some robust yet fast way to clone from ${DISTDIR} to ${S}
Summary: git.eclass Invent some robust yet fast way to clone from ${DISTDIR} to ${S}
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Tomáš Chvátal (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-12 04:17 UTC by Sergey Ilinykh
Modified: 2011-04-20 21:59 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
trivial patch (git.eclass.diff,612 bytes, patch)
2009-07-21 16:37 UTC, Benedikt Böhm (RETIRED)
Details | Diff
fixed storing submodules sources (git.eclass,11.22 KB, text/plain)
2009-11-15 14:04 UTC, Nikoli
Details
diff (git.eclass.patch,3.96 KB, patch)
2009-11-15 14:12 UTC, Nikoli
Details | Diff
git.eclass.diff (git.eclass.diff,5.15 KB, text/plain)
2009-11-15 15:49 UTC, Tomáš Chvátal (RETIRED)
Details
git.eclass.patch (git.eclass.patch,2.30 KB, patch)
2010-01-20 21:13 UTC, Tomáš Chvátal (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Ilinykh 2009-05-12 04:17:48 UTC
of course portage itself has quite few 9999.ebuild's for git based sources.
but there are lots of other packages in overlays which use git.

git has cool feature like svn externals. its "submodule". And i need it atm. because of portage misses submodule feature i can't determine needed revision and therefore sources may be broken.

i can write patch. but i sure you guys can do that much better ;-)

Reproducible: Always
Comment 1 Tomáš Chvátal (RETIRED) gentoo-dev 2009-05-13 20:46:46 UTC
Hi,
mine activity for big things expect massive breakages is much reduced until mid june.
So write up patch and attach it here so we can review, i bet donnie dont have much time too :]
or just let this bug wait till mid of june where i will be at full presence :]

Cheers
Comment 2 Benedikt Böhm (RETIRED) gentoo-dev 2009-07-21 16:37:55 UTC
Created attachment 198718 [details, diff]
trivial patch
Comment 3 Tomáš Chvátal (RETIRED) gentoo-dev 2009-08-06 12:38:01 UTC
Added to x11 overlay for testing.
Comment 4 Tomáš Chvátal (RETIRED) gentoo-dev 2009-08-24 21:49:30 UTC
Added to main tree finaly :]
Comment 5 Sergey Ilinykh 2009-08-25 04:48:20 UTC
buggy implementation.
eclass redownloads submodule sources each time on unpack, but should just update existing.

please rollback this changes from main tree or do that proper way.
Comment 6 Nikoli 2009-11-15 14:04:15 UTC
Created attachment 210312 [details]
fixed storing submodules sources

Changed eclass - now it does not redownload all submodules every time. It works for me, but still needs more testing.
Comment 7 Nikoli 2009-11-15 14:12:50 UTC
Created attachment 210313 [details, diff]
diff
Comment 8 Tomáš Chvátal (RETIRED) gentoo-dev 2009-11-15 15:49:09 UTC
Created attachment 210322 [details]
git.eclass.diff

Updated patch.
Please test and report issues.
Comment 9 Sergey Ilinykh 2009-11-16 05:01:27 UTC
(In reply to comment #7)
> Created an attachment (id=210313) [details]
> diff
> 

I'm not sure "git submodule update" is enough to update modules. AFAIK git archive won't always work on such modules since they are detached and after next update may be broken (outdated).
I don't quite understand how this works, but for me i found solution, its something like "git submodule update --merge".
Comment 10 Tomáš Chvátal (RETIRED) gentoo-dev 2009-11-23 00:52:49 UTC
Ok x11 overlay got even more updates for the eclass, so anyone willing to test the feature it might be good time to report if it is not behaving well and so on :]
Comment 11 Tomáš Chvátal (RETIRED) gentoo-dev 2009-12-16 20:35:52 UTC
added to main tree
Comment 12 Sergey Ilinykh 2010-01-15 07:06:01 UTC
just to make you know
1) strange function name - git_sumbodules
2) it seems its broken again. i see submodules sources in git-src but there are just empty folders in /var/tmp/portage after unpack
3) caching fetched submodules sources never worked for me.
Comment 13 Nikoli 2010-01-16 15:45:10 UTC
>2) it seems its broken again. i see submodules sources in git-src but there are
just empty folders in /var/tmp/portage after unpack

confirm:
...
A    mplayer/libdvdnav/remap.h                                                                                                                               
Exported revision 1188.                                                                                                                                      
>>> Source unpacked in /mnt/g/portage/media-video/mplayer-git-9999/work                                                                                      
>>> Preparing source in /mnt/g/portage/media-video/mplayer-git-9999/work/mplayer-git-9999 ...                                                                
 * Starting bootstrap                                                                                                                                        
Submodule 'ffmpeg' (git://repo.or.cz/FFMpeg-mirror/mplayer-patches.git) registered for path 'ffmpeg'                                                         
Submodule 'ffmpeg-mt' (git://repo.or.cz/FFMpeg-mirror/mplayer-patches.git) registered for path 'ffmpeg-mt'                                                   
Submodule 'libass' (git://repo.or.cz/libass.git) registered for path 'libass'                                                                                
Submodule 'mplayer' (git://repo.or.cz/mplayer.git) registered for path 'mplayer'                                                                             
fatal: destination path 'mplayer' already exists and is not an empty directory.                                                                              
Traceback (most recent call last):                                                                                                                           
  File "./init", line 77, in <module>                                                                                                                        
    main()                                                                                                                                                   
  File "./init", line 59, in main                                                                                                                            
    git.submodule_clone('mplayer')                                                                                                                           
  File "/mnt/g/portage/media-video/mplayer-git-9999/work/mplayer-git-9999/script/helpers.py", line 66, in submodule_clone                                    
    check_call('git clone'.split() + shallow_args + [repo_addr, name])                                                                                       
  File "/usr/lib64/python2.6/subprocess.py", line 488, in check_call                                                                                         
    raise CalledProcessError(retcode, cmd)                                                                                                                   
subprocess.CalledProcessError: Command '['git', 'clone', 'git://repo.or.cz/mplayer.git\n', 'mplayer']' returned non-zero exit status 128                     
Already up-to-date.                                                                                                                                          
 * Bootstrap finished
...

We should not use this:

	# unpack to the ${S}
	popd &> /dev/null
	debug-print "git clone -l -s \"${GIT_DIR}\" \"${S}\""
	git clone -l -s "${GIT_DIR}" "${S}"

'git clone -l -s' does not copy submodules, we can use 'cp -pr' or 'rsync -rlpgo', which work fine for me.
Comment 14 Manuel Nickschas 2010-01-17 21:22:10 UTC
I've tried it with rsync. Now qt-core fails:

>>> Unpacked to /var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/work/qt-x11-opensource-src-4.6.9999                                                                     
/var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/temp/environment: line 3772: /var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/work/qt-x11-opensource-src-4.6.9999/src/plugins/codecs/kr/kr.pro: No such file or directory                                                                                                                          
/var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/temp/environment: line 3772: /var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/work/qt-x11-opensource-src-4.6.9999/src/plugins/codecs/jp/jp.pro: No such file or directory                                                                                                                          
/var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/temp/environment: line 3772: /var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/work/qt-x11-opensource-src-4.6.9999/src/plugins/codecs/cn/cn.pro: No such file or directory                                                                                                                          
/var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/temp/environment: line 3772: /var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/work/qt-x11-opensource-src-4.6.9999/src/plugins/codecs/tw/tw.pro: No such file or directory                                                                                                                          
>>> Source unpacked in /var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/work                                                                                              
>>> Preparing source in /var/tmp/portage/x11-libs/qt-core-4.6.9999-r1/work/qt-x11-opensource-src-4.6.9999 ...                                                          
Can't open perl script "bin/syncqt": No such file or directory                                                                                                         
sed: can't read configure: No such file or directory

So rsync doesn't get all needed files.

Note that both rsync and cp are not really acceptable, because they add several minutes to unpack time. While the approach using git clone just does a normal checkout, cp and rsync first copy the whole repository (potentially several hundred MB) and then check out the files. For each of the Qt packages, this added about 7 minutes last time I tried (with cp), which amounts to more than 90 minutes just for needlessly copying stuff around in order to emerge Qt. Not acceptable.

Since this is *only* needed (it seems) for submodules, can't we make this optional and only have packages actually needing the feature use this, rather than adding a huge penalty for every package using git? I don't particularly look forward to adding several hours to my emerge @live-rebuild just because one or two packages use git submodules.
Comment 15 Tomáš Chvátal (RETIRED) gentoo-dev 2010-01-20 21:13:50 UTC
Created attachment 217009 [details, diff]
git.eclass.patch

Please test this yet another attempt to make everything work.
Comment 16 Nikoli 2010-01-20 22:34:31 UTC
Tested with mplayer from git, works fine for me.
Comment 17 Sergey Ilinykh 2010-01-21 05:28:30 UTC
seems to work fine for me too =)
Comment 18 Tomáš Chvátal (RETIRED) gentoo-dev 2011-04-20 21:59:11 UTC
This bug is obsoleted by git-2 eclass. Where the things are fast enough and should make everyone happy :)