Missing files declared in filesets should result in an error
Bug #1524846 reported by
XiaoGuo, Liu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Snapcraft | Status tracked in Trunk | |||||
1.x |
Won't Fix
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Medium
|
Sergio Schvezov |
Bug Description
I have a basic project at https:/
When I build in different ways, it shows me different results.
1) http://
2) http://
For the same project, I used different commands, I got different results.
Also, I used the same project from different repository at https:/
I got different result too when I tried to build the same project. The build sequence is at http://
Thanks & best regards,
XiaoGuo
Changed in snapcraft: | |
importance: | Undecided → Medium |
summary: |
- Different results obtained when building the same project + Missing files declared in filesets should result in an error |
To post a comment you must log in.
I believe the problem here is the presence of "test/bin/test_app" within the `stage` map. That file doesn't exist within the built part, so staging actually fails complaining about the fact that the file isn't present. Here's the key though: the order in which items in the `stage` map are processed isn't deterministic. They can be processed in any order, and the stage STOPS when it hits a file it can't stage[1]. Similarly, since `$binaries` are defined as everything within bin/* and usr/bin/*, `snap` tries to pull those files out of the staged package, but since `stage` failed at some point (again, a different place every time), usually SOME files were missing (which `snap` complained about). This was confusing simply because the stage failed at a different point every time, changing the error message and the final .snap every time as well.
The simple fix is to remove the "test/bin/test_app" string from the stage[2]. In the future, a good way to debug this would have been to walk through the lifecycle manually rather than running `snapcraft`. You would have noticed:
1. `snapcraft pull`: Okay, everything looks good.
2. `snapcraft build`: Okay, still good.
3. `snapcraft stage`: Wait... it couldn't stage something.
You would have stopped there and investigated, whereas running through the whole lifecycle the error message that jumps out is the one from `snap`, which was different every time.
[1]: https:/ /github. com/ubuntu- core/snapcraft/ blob/master/ snapcraft/ lifecycle. py#L206 pastebin. ubuntu. com/13894721/
[2]: http://