Re: [Launchpad-reviewers] [Merge] ~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master

2024-04-23 Thread Talha Can Havadar
Yep just rebased, it was weird maybe from the fork I dont know but it 
should be ok now

On 23-04-2024 16:53, Hector CAO wrote:
> The unmerged commits list seems strange, perhaps is it work to rebase 
> properly 
> onhttps://code.launchpad.net/~launchpad/launchpad-buildd/+git/launchpad-buildd/+ref/master
>   ?
-- 
Canonical-20th-anniversary

Talha Can Havadar

Email:



talha.can.hava...@canonical.com

Location:



The Netherlands

canonical.com



ubuntu.com



https://code.launchpad.net/~tchavadar/launchpad-buildd/+git/launchpad-buildd/+merge/464761
Your team Launchpad code reviewers is requested to review the proposed merge of 
~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master.


___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Launchpad-reviewers] [Merge] ~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master

2024-04-23 Thread Hector CAO
The unmerged commits list seems strange, perhaps is it work to rebase properly 
on 
https://code.launchpad.net/~launchpad/launchpad-buildd/+git/launchpad-buildd/+ref/master
 ?
-- 
https://code.launchpad.net/~tchavadar/launchpad-buildd/+git/launchpad-buildd/+merge/464761
Your team Launchpad code reviewers is requested to review the proposed merge of 
~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master.


___
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : launchpad-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help   : https://help.launchpad.net/ListHelp


[Launchpad-reviewers] [Merge] ~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master

2024-04-22 Thread Talha Can Havadar
Talha Can Havadar has proposed merging 
~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~tchavadar/launchpad-buildd/+git/launchpad-buildd/+merge/464761

Exposing LB_USE_UBUNTU_IMAGES_DEB env variable to be configurable by lpbuildd. 
Details about the relevant change can be found in 
https://code.launchpad.net/~tchavadar/livecd-rootfs/+git/livecd-rootfs/+merge/464755

Change is proposed to make LB_USE_UBUNTU_IMAGES_DEB configurable through livefs 
build metadata.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of 
~tchavadar/launchpad-buildd:use-ubuntu-images-deb into launchpad-buildd:master.
diff --git a/lpbuildd/livefs.py b/lpbuildd/livefs.py
index 6e8da92..68dc40c 100644
--- a/lpbuildd/livefs.py
+++ b/lpbuildd/livefs.py
@@ -37,6 +37,7 @@ class LiveFilesystemBuildManager(DebianBuildManager):
 self.repo_snapshot_stamp = extra_args.get("repo_snapshot_stamp")
 self.cohort_key = extra_args.get("cohort-key")
 self.debug = extra_args.get("debug", False)
+self.use_ubuntu_images_deb = extra_args.get("use_ubuntu_images_deb")
 
 super().initiate(files, chroot, extra_args)
 
@@ -77,6 +78,8 @@ class LiveFilesystemBuildManager(DebianBuildManager):
 pass
 if self.debug:
 args.append("--debug")
+if self.use_ubuntu_images_deb:
+args.extend(["--use-ubuntu-images-deb", self.use_ubuntu_images_deb])
 self.runTargetSubProcess("buildlivefs", *args)
 
 def iterate_BUILD_LIVEFS(self, retcode):
diff --git a/lpbuildd/target/build_livefs.py b/lpbuildd/target/build_livefs.py
index ed94328..ad31838 100644
--- a/lpbuildd/target/build_livefs.py
+++ b/lpbuildd/target/build_livefs.py
@@ -109,6 +109,12 @@ class BuildLiveFS(SnapStoreOperationMixin, Operation):
 action="store_true",
 help="enable detailed live-build debugging",
 )
+parser.add_argument(
+"--use-ubuntu-images-deb",
+dest="use_ubuntu_images_deb",
+metavar="USE_UBUNTU_IMAGES_DEV",
+help="Use specified ubuntu-images package instead of git repository"
+)
 
 def install(self):
 deps = ["livecd-rootfs"]
@@ -198,6 +204,8 @@ class BuildLiveFS(SnapStoreOperationMixin, Operation):
 }
 lb_env.update(proxy_dict)
 base_lb_env.update(proxy_dict)
+if self.args.use_ubuntu_images_deb:
+lb_env["LB_USE_UBUNTU_IMAGES_DEB"] = self.args.use_ubuntu_images_deb
 self.run_build_command(["lb", "config"], env=lb_env)
 self.run_build_command(["lb", "build"], env=base_lb_env)
 
diff --git a/lpbuildd/target/tests/test_build_livefs.py b/lpbuildd/target/tests/test_build_livefs.py
index ad220c3..c62408a 100644
--- a/lpbuildd/target/tests/test_build_livefs.py
+++ b/lpbuildd/target/tests/test_build_livefs.py
@@ -440,3 +440,61 @@ class TestBuildLiveFS(TestCase):
 build_livefs = parse_args(args=args).operation
 build_livefs.backend.run = FailBuild()
 self.assertEqual(RETCODE_FAILURE_BUILD, build_livefs.run())
+
+def test_run_build_with_ubuntu_images_package(self):
+args = [
+"buildlivefs",
+"--backend=fake",
+"--series=noble",
+"--arch=arm64",
+"--project=ubuntu-cpc",
+"1",
+"--use-ubuntu-images-deb=ubuntu-images",
+]
+expected_env = {
+"ARCH": "arm64",
+"SUITE": "noble",
+"PROJECT": "ubuntu-cpc",
+"LB_USE_UBUNTU_IMAGES_DEB": "ubuntu-images",
+}
+build_livefs = parse_args(args=args).operation
+build_livefs.build()
+
+self.assertThat(
+build_livefs.backend.run.calls,
+MatchesListwise(
+[
+RanBuildCommand(["rm", "-rf", "auto", "local"]),
+RanBuildCommand(["mkdir", "-p", "auto"]),
+RanBuildCommand(
+[
+"ln",
+"-s",
+"/usr/share/livecd-rootfs/live-build/auto/config",
+"auto/",
+]
+),
+RanBuildCommand(
+[
+"ln",
+"-s",
+"/usr/share/livecd-rootfs/live-build/auto/build",
+"auto/",
+]
+),
+RanBuildCommand(
+[
+"ln",
+"-s",
+"/usr/share/livecd-rootfs/live-build/auto/clean",
+"auto/",
+