All of lore.kernel.org
 help / color / mirror / Atom feed
* Issue with bitbake fetch/unpack when using MIRRORS rewrite
@ 2018-03-09  9:40 Bach, Pascal
  2018-03-11 13:36 ` Richard Purdie
  0 siblings, 1 reply; 9+ messages in thread
From: Bach, Pascal @ 2018-03-09  9:40 UTC (permalink / raw)
  To: bitbake-devel@lists.openembedded.org

Hello Everyone

I finally got to pin down an issue that I occasionally observed in the past:

When using the git fetcher with shallow tarballs (BB_GIT_SHALLOW,BB_GIT_SHALLOW_DEPTH) experience the following issues during the do_unpack task:

ERROR: pseudo-native-1.9.0+gitAUTOINC+d7c31a25e4-r0 do_unpack: Fetcher failure: [...]
tar (child): /home/projects/ccp3-labs/oe/build/../../../downloads2/gitshallow_git.yoctoproject.org.pseudo_d7c31a2-1_master.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now

The issue is that the do_unpack is trying to find the following file in the downloads directory:
downloads2/gitshallow_git.yoctoproject.org.pseudo_d7c31a2-1_master.tar.gz

However this file doesn't exist, instead the following file was created by the fetch task:
downloads2/gitshallow_git.yoctoproject.org.git.pseudo_d7c31a2-1_master.tar.gz

After some digging I suspect that the following rewrite rule is causing the issue:
MIRRORS += "git://git.yoctoproject.org/.*                               git://git.yoctoproject.org/git/PATH;protocol=https \n"

The line exists because we don't have access to git.yoctoproject.org via the git protocol. So we use the above rule to make access work via HTTPS.
However due to the way the Yocto git server is structured the rewrite causes the URL path to change from / to /git which causes the additional .git in the
resulting tarball, which then makes the unpack task look for the wrong file.

I think the proper behavior would be to always name the tarball after the original SRC_URI not the rewritten one.

BTW: I was able to reproduce the issue with the shallow git tarballs but I think it also applies to normal git tarballs and possibly other fetchers.

The issue still exists with bitbake 1.37.0 on Poky master.

Regards
Pascal


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Issue with bitbake fetch/unpack when using MIRRORS rewrite
@ 2018-07-17 11:15 Urs Fässler
  2018-07-17 11:24 ` richard.purdie
  0 siblings, 1 reply; 9+ messages in thread
From: Urs Fässler @ 2018-07-17 11:15 UTC (permalink / raw)
  To: bitbake-devel

Hi,
I investigated the issue that the unpack step fails when using mirror
rewrite rules.

The root of the problem is, that the download step uses the
mirrored url to create the local filename while the unpack step uses
the url from the recipe to create the local filename.

As I understand the code, the link between the filename from
download and the filename from unpack is missing. It seems to work
because they are usually the same.

I tried both solutions proposed by Richard: Using symlinks and the
recipe-url.
The symlink solution is nice since it follows the same methods as for
git clones. Unfortunately, it is not practical for us. We like to store
the tarballs on a SMB share or S3 storage. Both do not support
symlinks.
The recipe-url naming method is nice since the tarball is named after
the url as it is written in the recipe. This is easy understandable.
But unfortunately this method breaks the test
"FetcherNetworkTest.test_gitfetch_premirror", which tests the
following: when 2 different recipe-urls point to the same mirrored-url, 
the repository is cloned only once.

Now the question is which solution we should implement. For us, it is
the second one (tarball naming after recipe-url). It comes with the
downside that the one mentioned test fails and has to be removed. In a
real scenario this results in downloading a repository twice and having
2 tarballs with the same content. But I expect this to be unlikely in a
real world scenario.

A third solution may be that we add a link between the download and
unpack task. But this would be the most intrusive solution for Bitbake.

Thanks,
Urs



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-07-18 18:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-09  9:40 Issue with bitbake fetch/unpack when using MIRRORS rewrite Bach, Pascal
2018-03-11 13:36 ` Richard Purdie
2018-07-02 12:29   ` Urs Fässler
2018-07-03 13:59     ` Urs Fässler
  -- strict thread matches above, loose matches on Subject: below --
2018-07-17 11:15 Urs Fässler
2018-07-17 11:24 ` richard.purdie
2018-07-17 13:39   ` Urs Fässler
2018-07-17 14:00     ` richard.purdie
2018-07-18 12:38       ` Urs Fässler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.