Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/7.4 merge #4213

Merged
merged 9 commits into from
Jul 3, 2023
3 changes: 3 additions & 0 deletions extensions/desktop/common/desktop-exports
Original file line number Diff line number Diff line change
Expand Up @@ -467,3 +467,6 @@ ln -sfn "$REALHOME/.config/ibus/bus" "$IBUS_CONFIG_PATH"

# Set libgweather path
export LIBGWEATHER_LOCATIONS_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libgweather-4/Locations.bin"

# Set libthai dict path
export LIBTHAI_DICTDIR="$SNAP_DESKTOP_RUNTIME/usr/share/libthai/"
7 changes: 5 additions & 2 deletions snapcraft/parts/plugins/_ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ def get_build_commands(self) -> List[str]:
return (
self._get_workspace_activation_commands()
+ [
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; "
"then sudo rosdep init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
# Preserve http(s)_proxy env var in root for remote-build proxy since rosdep
# doesn't support proxy
# https://github.com/ros-infrastructure/rosdep/issues/271
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
"rosdep install --default-yes --ignore-packages-from-source "
'--from-paths "${CRAFT_PART_SRC_WORK}"',
Expand Down
2 changes: 1 addition & 1 deletion snapcraft/parts/plugins/kernel_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ def get_build_packages(self) -> Set[str]:
build_packages = {
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand Down Expand Up @@ -447,7 +448,6 @@ def get_build_environment(self) -> Dict[str, str]:
"ARCH": self._kernel_arch,
"DEB_ARCH": "${CRAFT_TARGET_ARCH}",
"UC_INITRD_DEB": "${CRAFT_PART_BUILD}/ubuntu-core-initramfs",
"SNAPD_UNPACKED_SNAP": "${CRAFT_PART_BUILD}/unpacked_snapd",
"KERNEL_BUILD_ARCH_DIR": f"${{CRAFT_PART_BUILD}}/arch/{self._kernel_arch}/boot",
"KERNEL_IMAGE_TARGET": self.kernel_image_target,
}
Expand Down
10 changes: 5 additions & 5 deletions snapcraft_legacy/plugins/v2/_kernel_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def _download_snap_bootstrap_cmd(target_arch: str) -> List[str]:
echo "Getting snapd deb for snap bootstrap..."
# only download again if files does not exist, otherwise
# assume we are re-running build
if [ ! -e ${{SNAPD_UNPACKED_SNAP}} ]; then
download_snap_bootstrap {arch} ${{SNAPD_UNPACKED_SNAP}}
if [ ! -e ${{UC_INITRD_DEB}}/usr/lib/snapd ]; then
download_snap_bootstrap {arch} ${{UC_INITRD_DEB}}
fi
""".format(
arch=target_arch
Expand Down Expand Up @@ -709,23 +709,23 @@ def _make_initrd_cmd(
" ".join(
[
"link_files",
'"${SNAPD_UNPACKED_SNAP}"',
'"${UC_INITRD_DEB}"',
'"usr/lib/snapd/snap-bootstrap"',
'"${uc_initrd_feature_snap_bootstratp}"',
]
),
" ".join(
[
"link_files",
'"${SNAPD_UNPACKED_SNAP}"',
'"${UC_INITRD_DEB}"',
'"usr/lib/snapd/info"',
'"${uc_initrd_feature_snap_bootstratp}"',
]
),
" ".join(
[
"cp",
"${SNAPD_UNPACKED_SNAP}/usr/lib/snapd/info",
"${UC_INITRD_DEB}/usr/lib/snapd/info",
f"{install_dir}/snapd-info",
]
),
Expand Down
6 changes: 5 additions & 1 deletion snapcraft_legacy/plugins/v2/_ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ def get_build_commands(self) -> List[str]:
return (
self._get_workspace_activation_commands()
+ [
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
# Preserve http(s)_proxy env var in root for remote-build proxy since rosdep
# doesn't support proxy
# https://github.com/ros-infrastructure/rosdep/issues/271
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
'rosdep install --default-yes --ignore-packages-from-source --from-paths "${SNAPCRAFT_PART_SRC_WORK}"',
]
Expand Down
2 changes: 1 addition & 1 deletion snapcraft_legacy/plugins/v2/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ def get_build_packages(self) -> Set[str]:
build_packages = {
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand Down Expand Up @@ -490,7 +491,6 @@ def get_build_environment(self) -> Dict[str, str]:
"ARCH": self._kernel_arch,
"DEB_ARCH": "${SNAPCRAFT_TARGET_ARCH}",
"UC_INITRD_DEB": "${SNAPCRAFT_PART_BUILD}/ubuntu-core-initramfs",
"SNAPD_UNPACKED_SNAP": "${SNAPCRAFT_PART_BUILD}/unpacked_snapd",
"KERNEL_BUILD_ARCH_DIR": f"${{SNAPCRAFT_PART_BUILD}}/arch/{self._kernel_arch}/boot",
"KERNEL_IMAGE_TARGET": self.kernel_image_target,
}
Expand Down
8 changes: 4 additions & 4 deletions tests/legacy/unit/plugins/v2/test_catkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class Options:
"fi",
'. /opt/ros/"${ROS_DISTRO}"/setup.sh',
'eval "${state}"',
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep "
"init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
'rosdep install --default-yes --ignore-packages-from-source --from-paths "${SNAPCRAFT_PART_SRC_WORK}"',
'state="$(set +o); set -$-"',
Expand Down Expand Up @@ -159,8 +159,8 @@ class Options:
"fi",
'. /opt/ros/"${ROS_DISTRO}"/setup.sh',
'eval "${state}"',
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep "
"init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
'rosdep install --default-yes --ignore-packages-from-source --from-paths "${SNAPCRAFT_PART_SRC_WORK}"',
'state="$(set +o); set -$-"',
Expand Down
8 changes: 4 additions & 4 deletions tests/legacy/unit/plugins/v2/test_catkin_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class Options:
"fi",
'. /opt/ros/"${ROS_DISTRO}"/setup.sh',
'eval "${state}"',
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep "
"init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
'rosdep install --default-yes --ignore-packages-from-source --from-paths "${SNAPCRAFT_PART_SRC_WORK}"',
'state="$(set +o); set -$-"',
Expand Down Expand Up @@ -155,8 +155,8 @@ class Options:
"fi",
'. /opt/ros/"${ROS_DISTRO}"/setup.sh',
'eval "${state}"',
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep "
"init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
'rosdep install --default-yes --ignore-packages-from-source --from-paths "${SNAPCRAFT_PART_SRC_WORK}"',
'state="$(set +o); set -$-"',
Expand Down
8 changes: 4 additions & 4 deletions tests/legacy/unit/plugins/v2/test_colcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class Options:
"fi",
'. /opt/ros/"${ROS_DISTRO}"/local_setup.sh',
'eval "${state}"',
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep "
"init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
'rosdep install --default-yes --ignore-packages-from-source --from-paths "${SNAPCRAFT_PART_SRC_WORK}"',
'state="$(set +o); set -$-"',
Expand Down Expand Up @@ -182,8 +182,8 @@ class Options:
"fi",
'. /opt/ros/"${ROS_DISTRO}"/local_setup.sh',
'eval "${state}"',
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep "
"init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
'rosdep install --default-yes --ignore-packages-from-source --from-paths "${SNAPCRAFT_PART_SRC_WORK}"',
'state="$(set +o); set -$-"',
Expand Down
24 changes: 14 additions & 10 deletions tests/legacy/unit/plugins/v2/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ def test_get_base_build_packages(self):
{
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand All @@ -285,6 +286,7 @@ def test_get_base_build_packages_lz4(self):
{
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand All @@ -304,6 +306,7 @@ def test_get_base_build_packages_xz(self):
{
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand All @@ -323,6 +326,7 @@ def test_get_base_build_packages_zfs(self):
{
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand All @@ -347,6 +351,7 @@ def test_get_base_build_packages_zfs_cross(self):
{
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand Down Expand Up @@ -503,7 +508,6 @@ def test_check_get_build_environment(self):
"ARCH": plugin._kernel_arch,
"DEB_ARCH": "${SNAPCRAFT_TARGET_ARCH}",
"UC_INITRD_DEB": "${SNAPCRAFT_PART_BUILD}/ubuntu-core-initramfs",
"SNAPD_UNPACKED_SNAP": "${SNAPCRAFT_PART_BUILD}/unpacked_snapd",
"KERNEL_BUILD_ARCH_DIR": f"${{SNAPCRAFT_PART_BUILD}}/arch/{plugin._kernel_arch}/boot",
"KERNEL_IMAGE_TARGET": plugin.kernel_image_target,
},
Expand All @@ -524,7 +528,6 @@ def test_check_get_build_environment_compiler_paths_cross(self):
"ARCH": "arm",
"DEB_ARCH": "${SNAPCRAFT_TARGET_ARCH}",
"UC_INITRD_DEB": "${SNAPCRAFT_PART_BUILD}/ubuntu-core-initramfs",
"SNAPD_UNPACKED_SNAP": "${SNAPCRAFT_PART_BUILD}/unpacked_snapd",
"KERNEL_BUILD_ARCH_DIR": "${SNAPCRAFT_PART_BUILD}/arch/arm/boot",
"KERNEL_IMAGE_TARGET": "Image.gz",
"PATH": "${SNAPCRAFT_STAGE}/gcc-11/bin:${PATH}",
Expand All @@ -544,7 +547,6 @@ def test_check_get_build_environment_compiler_paths(self):
"ARCH": plugin._kernel_arch,
"DEB_ARCH": "${SNAPCRAFT_TARGET_ARCH}",
"UC_INITRD_DEB": "${SNAPCRAFT_PART_BUILD}/ubuntu-core-initramfs",
"SNAPD_UNPACKED_SNAP": "${SNAPCRAFT_PART_BUILD}/unpacked_snapd",
"KERNEL_BUILD_ARCH_DIR": f"${{SNAPCRAFT_PART_BUILD}}/arch/{plugin._kernel_arch}/boot",
"KERNEL_IMAGE_TARGET": plugin.kernel_image_target,
"PATH": "${SNAPCRAFT_STAGE}/gcc-11/bin:${SNAPCRAFT_STAGE}/gcc-11/sbin:${PATH}",
Expand Down Expand Up @@ -1005,6 +1007,7 @@ def test_use_llvm(self):
{
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand Down Expand Up @@ -1037,6 +1040,7 @@ def test_use_llvm_specific_version(self):
{
"bc",
"binutils",
"debhelper",
"fakeroot",
"gcc",
"cmake",
Expand Down Expand Up @@ -1237,8 +1241,8 @@ def _is_sub_array(array, sub_array):
echo "Getting snapd deb for snap bootstrap..."
# only download again if files does not exist, otherwise
# assume we are re-running build
if [ ! -e ${{SNAPD_UNPACKED_SNAP}} ]; then
download_snap_bootstrap {arch} ${{SNAPD_UNPACKED_SNAP}}
if [ ! -e ${{UC_INITRD_DEB}}/usr/lib/snapd ]; then
download_snap_bootstrap {arch} ${{UC_INITRD_DEB}}
fi
""".format(
arch=_DEB_ARCH_TRANSLATIONS[platform.machine()]
Expand All @@ -1252,8 +1256,8 @@ def _is_sub_array(array, sub_array):
echo "Getting snapd deb for snap bootstrap..."
# only download again if files does not exist, otherwise
# assume we are re-running build
if [ ! -e ${{SNAPD_UNPACKED_SNAP}} ]; then
download_snap_bootstrap {arch} ${{SNAPD_UNPACKED_SNAP}}
if [ ! -e ${{UC_INITRD_DEB}}/usr/lib/snapd ]; then
download_snap_bootstrap {arch} ${{UC_INITRD_DEB}}
fi
""".format(
arch="armhf"
Expand Down Expand Up @@ -1662,12 +1666,12 @@ def _is_sub_array(array, sub_array):
" ".join(
[
"link_files",
'"${SNAPD_UNPACKED_SNAP}" "usr/lib/snapd/snap-bootstrap"',
'"${UC_INITRD_DEB}" "usr/lib/snapd/snap-bootstrap"',
'"${uc_initrd_feature_snap_bootstratp}"',
],
),
'link_files "${SNAPD_UNPACKED_SNAP}" "usr/lib/snapd/info" "${uc_initrd_feature_snap_bootstratp}"',
"cp ${SNAPD_UNPACKED_SNAP}/usr/lib/snapd/info ${SNAPCRAFT_PART_INSTALL}/snapd-info",
'link_files "${UC_INITRD_DEB}" "usr/lib/snapd/info" "${uc_initrd_feature_snap_bootstratp}"',
"cp ${UC_INITRD_DEB}/usr/lib/snapd/info ${SNAPCRAFT_PART_INSTALL}/snapd-info",
]

_clean_old_initrd_cmd = [
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/parts/plugins/test_colcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def test_get_build_commands(self, setup_method_fixture, new_dir, monkeypatch):
"fi",
'. "/opt/ros/${ROS_DISTRO}/local_setup.sh"',
'eval "${state}"',
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep "
"init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
"rosdep install --default-yes --ignore-packages-from-source "
'--from-paths "${CRAFT_PART_SRC_WORK}"',
Expand Down Expand Up @@ -218,8 +218,8 @@ def test_get_build_commands_with_all_properties(
"fi",
'. "/opt/ros/${ROS_DISTRO}/local_setup.sh"',
'eval "${state}"',
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep "
"init; fi",
"if [ ! -f /etc/ros/rosdep/sources.list.d/20-default.list ]; then",
"sudo --preserve-env=http_proxy,https_proxy rosdep init; fi",
'rosdep update --include-eol-distros --rosdistro "${ROS_DISTRO}"',
"rosdep install --default-yes --ignore-packages-from-source "
'--from-paths "${CRAFT_PART_SRC_WORK}"',
Expand Down
Loading