fix(release): a snap built in a clone of its own is packed without --output, into the clone
snapcraft builds in LXD with the project mounted at /root/project and passes --output on unchanged: naming the clone itself, it took the clone for a file in the folder above, outside the project, and refused it again. Without --output it packs into the clone (checked with snapcraft 9.2.1 in Todo's clone), from where the release tool moves it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
34001b1aff
commit
c8d94d0ceb
2 changed files with 17 additions and 29 deletions
|
|
@ -216,13 +216,12 @@ final class const SnapRelease({
|
|||
/// otherwise analyse.
|
||||
String projectPath(String home) => '$home/.cache/halkyon-release/snap/$name';
|
||||
|
||||
/// Where `snapcraft pack` writes the snap: the release's folder ([out] in
|
||||
/// [root]) for the root's, its clone for any other, as snapcraft packs
|
||||
/// nowhere outside the project it builds (found releasing Todo 0.1.0, 3 Nov
|
||||
/// 2026); the release tool moves it into the release's folder from there.
|
||||
String packPath({
|
||||
required String home,
|
||||
required String root,
|
||||
required String out,
|
||||
}) => atRoot ? '$root/$out' : projectPath(home);
|
||||
/// The folder `snapcraft pack --output` names: the release's folder ([out]
|
||||
/// in [root]) for the root's; none for any other, which snapcraft then packs
|
||||
/// into its clone, where the release tool takes it from. snapcraft builds in
|
||||
/// LXD with the project mounted elsewhere, and takes an `--output` naming the
|
||||
/// clone itself for a file in the folder above it, outside the project, so
|
||||
/// refuses it (found releasing Todo 0.1.0, 3 Nov 2026).
|
||||
String? packOutput({required String root, required String out}) =>
|
||||
atRoot ? '$root/$out' : null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -454,18 +454,13 @@ final class Releaser({
|
|||
'clean',
|
||||
snap.part,
|
||||
], workingDirectory: project);
|
||||
final packed = snap.packPath(
|
||||
home: Platform.environment['HOME'] ?? '',
|
||||
root: root.path,
|
||||
out: out,
|
||||
);
|
||||
final output = snap.packOutput(root: root.path, out: out);
|
||||
await _run('snapcraft', [
|
||||
'pack',
|
||||
'--output',
|
||||
packed,
|
||||
if (output != null) ...['--output', output],
|
||||
], workingDirectory: project);
|
||||
if (!snap.atRoot) {
|
||||
File(p.join(packed, snapFile))
|
||||
if (output == null) {
|
||||
File(p.join(project, snapFile))
|
||||
..copySync(p.join(root.path, out, snapFile))
|
||||
..deleteSync();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue