Using organize to move a folder to a child folder fails due to recursion
Bug #1668555 reported by
James Henstridge
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
I created a part in my snapcraft.yaml file with the following directive:
plugin: dump
source: src
organize:
.: lib/python3.
The intention being to move all the source files to a subdirectory. However, in the process of reorganising the installed files, it was also trying to move lib/python3.
I could avoid the problem by changing the directive to the following, which I guess avoided the problem because the glob was expanded before trying to reorganise the tree.
organize:
'*': lib/python3.
To post a comment you must log in.
I've just hit this bug when snapping a project. Part1 works fine, but part2 fails with RecursionError.
parts:
part1:
plugin: dump
source: src
organize:
lib: lib2
part2:
plugin: dump
source: src
organize:
lib: lib/lib
When investigating this I came a cross another odd behavior: the organize section seems to be applied in the stage step and not in the install step.
$ snapcraft clean && snapcraft build part1 part1/src/ lib/hello. txt part1/state/ pull part1/state/ build part1/build/ lib/hello. txt part1/install/ lib/hello. txt
Cleaning up priming area
Cleaning up staging area
Cleaning up parts directory
Preparing to pull part1
Pulling part1
Preparing to build part1
Building part1
$ find parts stage -type f
parts/
parts/
parts/
parts/
parts/
Note the directory install/lib. I would expect it to be install/lib2 after build.
$ snapcraft clean && snapcraft stage part1 part1/src/ lib/hello. txt part1/state/ pull part1/state/ build part1/state/ stage part1/build/ lib/hello. txt part1/install/ lib2/hello. txt lib2/hello. txt
Cleaning up priming area
Cleaning up staging area
Cleaning up parts directory
Preparing to pull part1
Pulling part1
Preparing to build part1
Building part1
Staging part1
$ find parts stage -type f
parts/
parts/
parts/
parts/
parts/
parts/
stage/
Now, after staging the install dir has been renamed to install/lib2. This can't be right that stage modifies what is produced when building parts. However, the effect is that stage/lib2 comes out ok.
When staging part2 snapcraft fails with a RecursionError.
$ snapcraft clean && snapcraft stage part2 snapcraft" , line 9, in <module>
load_entry_ point(' snapcraft= =2.34', 'console_scripts', 'snapcraft')() python3/ dist-packages/ pkg_resources/ __init_ _.py", line 542, in load_entry_point n(dist) .load_entry_ point(group, name) python3/ dist-packages/ pkg_resources/ __init_ _.py", line 2569, in load_entry_point python3/ dist-packages/ pkg_resources/ __init_ _.py", line 2229, in load python3/ dist-packages/ pkg_resources/ __init_ _.py", line 2235, in resolve python3. 5/os.py" , line 416, in walk python3. 5/posixpath. py", line 76, in join
Cleaning up priming area
Cleaning up staging area
Cleaning up parts directory
Preparing to pull part2
Pulling part2
Preparing to build part2
Building part2
Staging part2
Traceback (most recent call last):
File "/usr/bin/
File "/usr/lib/
return get_distributio
File "/usr/lib/
return ep.load()
File "/usr/lib/
return self.resolve()
File "/usr/lib/
... trace removed ...
File "/usr/lib/
new_path = join(top, dirname)
File "/usr/lib/
sep = _get_sep(a)
RecursionError: maximum recursion depth exceeded