Bug 6258

Summary: svn fetch uses last changed revision instead of revision on a svn branch.
Product: [Build System, Metadata & Runtime] BitBake Reporter: Balagopal Ambalakkat <bambalakkat>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Low CC: liezhi.yang, poky.bs.watcher, poky.watcher, sgw, wenlin.kang
Version: 1.5.1   
Target Milestone: 4.99   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Attachments:
Description Flags
The patch fix Unable to fetch URL bug none

Description Balagopal Ambalakkat 2014-05-01 02:01:15 UTC
.../qfx/build/qfx/bitbake_build  $ bitbake --version
BitBake Build Tool Core version 1.20.0, bitbake version 1.20.0
.../qfx/build/qfx/bitbake_build  $ 

When you create a SVN branch , the last changed revision exist only on the parent branch or trunk. so the svn fetch fails

I had a svn trunk

Path: .
Working Copy Root Path: /home/ambalakkat/svn/yocto-src
URL: http://pkg.dcbg.juniper.net/fsgtools/yocto/trunk/yocto-src/qfx/initscripts
Repository Root: http://pkg.dcbg.juniper.net/fsgtools/yocto
Repository UUID: 33bd5da9-22e9-4ec1-aba5-5ffc8ebe5f2c
Revision: 73
Node Kind: directory
Schedule: normal
Last Changed Author: sbalraj
Last Changed Rev: 71
Last Changed Date: 2014-04-29 13:26:17 -0700 (Tue, 29 Apr 2014)



~/svn/yocto-src  $ 

I created a branch PVT_AMBALAKKAT_BRANCH from the trunk

Path: .
Working Copy Root Path: /home/ambalakkat/test/initscripts
URL: http://pkg.dcbg.juniper.net/fsgtools/yocto/branches/PVT_AMBALAKKAT_BRANCH/yocto-src/qfx/initscripts
Repository Root: http://pkg.dcbg.juniper.net/fsgtools/yocto
Repository UUID: 33bd5da9-22e9-4ec1-aba5-5ffc8ebe5f2c
Revision: 75
Node Kind: directory
Schedule: normal
Last Changed Author: sbalraj
Last Changed Rev: 71
Last Changed Date: 2014-04-29 13:26:17 -0700 (Tue, 29 Apr 2014)


Failed with error during fetch
| 
| WARNING: Fetcher failure: Fetch command failed with exit code 1, output:
| svn: E170000: URL 'http://pkg.dcbg.juniper.net/fsgtools/yocto/branches/PVT_AMBALAKKAT_BRANCH/yocto-src/qfx/initscripts' doesn't exist
| 
| DEBUG: Python function base_do_fetch finished
| DEBUG: Python function do_fetch finished
| ERROR: Function failed: Fetcher failure for URL: 'svn://pkg.dcbg.juniper.net/fsgtools/yocto/branches/PVT_AMBALAKKAT_BRANCH;module=yocto-src/qfx/initscripts;protocol=http'. Unable to fetch URL from any source.
ERROR: Task 0 (/mnt/ambalakkat-hd/workspace/wrlinux/qfx/layers/meta-qfx/recipes-qfx/platform-scripts/platform-scripts_0.1.bb, do_fetch) failed with exit code '1'
NOTE: Tasks Summary: Attempted 236 tasks of which 235 didn't need to be rerun and 1 failed.


The bitbake picks "Last Changed Rev: 71" when SRC_REV is $(AUTOREV) for SRC_URI and then the fetch fails.

The rev 71 exist only on the trunk not on the branch.
Comment 1 Saul Wold 2014-05-08 23:39:36 UTC
Can you provide an external SVN server that exibits this behavior along with a 
recipe example that recplicates this issue.
Comment 2 Stephen K Jolley 2014-06-18 17:45:15 UTC
Assigned to person we are requesting info from per RP.
Comment 3 vallen 2014-06-19 06:24:12 UTC
Created attachment 2011 [details]
The patch fix Unable to fetch URL bug

Follow the testing steps and instructions:

First, we need to create a svn server on the server side, eg, my is svnroot
$svnadmin create ~/workspace/svnroot

Second, on the client side:
$mkdir -p ~/workspace/svntest
$cd ~/workspace/svntest
$mkdir -p test/{trunk,branches,tag}
$mkdir -p test/trunk/tdir0/tdir1/tdir2
$touch test/trunk/hello.c
$touch test/trunk/tdir0/tdir1/tdir2/test2.c
$touch test/trunk/tdir0/tdir1/test1.c
$touch test/trunk/tdir0/test0.c

$svn import -m "create the project test" test/ svn://xxx.xxx.xxx.xxx/svnroot/test

Then, make some commit,...
Such, we now get "r15"

$svn cp -m "create a branch test_debug-1.0" svn://xxx.xxx.xxx.xxx/svnroot/test/trunk svn://xxx.xxx.xxx.xxx/svnroot/test/branches/test_debug-1.0

Now, we need to create a bb file(eg,mytest.bb) to download "tdir1" with the verion < test_debug-1.0 created time version,
eg, download r12, then in bb file has:

SRCREV = "12"
SRC_URI = "svn://xxx.xxx.xxx.xxx/svnroot/test/branches/test_debug-1.0;module=tdir0/tdir1"

Last, run fetch for mytest.bb
Comment 4 vallen 2014-06-19 06:30:19 UTC
I have made the patch, and add the steps and instructions to test, please see the mailing list:
http://patches.openembedded.org/patch/73099/
or
http://patchwork.openembedded.org/patch/73595/
Comment 5 Stephen K Jolley 2014-06-23 18:00:25 UTC
It appears that the information requested has been supplied and this should no longer be in NEEDINFO.  I have moved it to In Process Review.
Comment 6 Richard Purdie 2014-09-24 18:10:47 UTC
I did some research into this. The issue comes from the change:

http://git.openembedded.org/bitbake/commit/lib/bb/fetch/svn.py?id=42e57e467b8334230436f24dc4bdfff64b52d2b3

I'm having a hard time figuring out what the correct thing to do here is though.
Comment 7 Richard Purdie 2021-09-20 20:41:09 UTC
I've ended up adding a nopegrevision parameter which can be used in urls to choose the correct behaviour as there is no one correct answer that will work in every case.