Skip to content

[sonic_debian_extension] fix packages.json generation and make the build fail when packages.json is not generated#8044

Merged
lguohan merged 3 commits intosonic-net:masterfrom
stepanblyschak:fix-packages-json
Jul 9, 2021
Merged

[sonic_debian_extension] fix packages.json generation and make the build fail when packages.json is not generated#8044
lguohan merged 3 commits intosonic-net:masterfrom
stepanblyschak:fix-packages-json

Conversation

@stepanblyschak
Copy link
Collaborator

@stepanblyschak stepanblyschak commented Jul 2, 2021

Signed-off-by: Stepan Blyschak [email protected]

Why I did it

Closes issue #8032

After https://github.com/Azure/sonic-buildimage/pull/7598 the packages.json generation is broken. This change fixes it make the whole build fail in case generation failed.

How I did it

Fix and check if generation failed.

How to verify it

Build sonic image, verify presence of the file.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@stepanblyschak stepanblyschak requested a review from lguohan as a code owner July 2, 2021 15:35
@stepanblyschak
Copy link
Collaborator Author

Required to be backported to 202106.

@stepanblyschak stepanblyschak reopened this Jul 4, 2021
@stepanblyschak stepanblyschak reopened this Jul 4, 2021
@stepanblyschak stepanblyschak reopened this Jul 4, 2021
@stepanblyschak stepanblyschak changed the title [sonic_debian_extension] fix packages.json generation and make the build fail ild fail when packages.json is not generated [sonic_debian_extension] fix packages.json generation and make the build fail when packages.json is not generated Jul 5, 2021
{
{% for docker_installation_target in installer_images.strip().split() -%}
{% set pkgname, docker_build_path, image = docker_installation_target.split('|') -%}
{% set pkgname, docker_build_path, _, image = docker_installation_target.split('|') -%}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. I feel we need extract the machine and compare machine with $TARGET_MACHINE in j2 syntax in packages.json.j2. You could pass the TARGET_MACHINE as a environment variable when j2 command for generating packages.json is invoked.

MACHINE=$TARGET_MACHINE  j2 $BUILD_TEMPLATES/packages.json.j2 | sudo tee $FILESYSTEM_ROOT/$SONIC_PACKAGE_MANAGER_FOLDER/packages.json

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@judyjoseph Thanks for suggestion, I am not really familiar with new concept of machine. I'll investigate and reply.

Signed-off-by: Stepan Blyschak <[email protected]>
@lguohan lguohan merged commit a294bfb into sonic-net:master Jul 9, 2021
judyjoseph pushed a commit that referenced this pull request Jul 13, 2021
…ild fail when packages.json is not generated (#8044)

After #7598 the packages.json generation is broken. This change fixes it make the whole build fail in case generation failed.

Signed-off-by: Stepan Blyschak <[email protected]>
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…ild fail when packages.json is not generated (sonic-net#8044)

After sonic-net#7598 the packages.json generation is broken. This change fixes it make the whole build fail in case generation failed.

Signed-off-by: Stepan Blyschak <[email protected]>
@stepanblyschak stepanblyschak deleted the fix-packages-json branch September 23, 2022 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants