Skip to content

[build] Fix bookworm reproducible build issue. #18789

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

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

liushilongbuaa
Copy link
Contributor

@liushilongbuaa liushilongbuaa commented Apr 24, 2024

Why I did it

Bookworm involved new file /etc/apt/sources.list.d/debian.sources to setup debian mirror repo.
Reproducible build need to support this scenario.

Work item tracking
  • Microsoft ADO (number only): 27792318

How I did it

How to verify it

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

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

@liushilongbuaa liushilongbuaa marked this pull request as ready for review April 24, 2024 13:12
Copy link
Collaborator

@xumia xumia left a comment

Choose a reason for hiding this comment

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

LGTM

@liushilongbuaa
Copy link
Contributor Author

@xumia , kvmtest-t0 is a known issue. Please ignore.

@xumia xumia merged commit c3899ef into sonic-net:master Apr 25, 2024
18 of 20 checks passed
@xumia
Copy link
Collaborator

xumia commented Apr 25, 2024

Bypass the known test case failure to fix build broken issue.

@k-v1
Copy link
Contributor

k-v1 commented May 19, 2024

@xumia @liushilongbuaa

I got this error message for sonic-slave-bookworm container:

BLDENV=bookworm make -f Makefile.work list
...
"PTF_ENV_PY_VER"                  : "mixed"

mv: cannot move '/etc/apt/sources.list.d/debian.sources' to '/etc/apt/sources.list.d/debian.sources.back': Permission denied
"SONIC_DPKG_CACHE_METHOD"         : "cache"

Maybe you should use $SUDO here?

@liushilongbuaa
Copy link
Contributor Author

@xumia @liushilongbuaa

I got this error message for sonic-slave-bookworm container:

BLDENV=bookworm make -f Makefile.work list
...
"PTF_ENV_PY_VER"                  : "mixed"

mv: cannot move '/etc/apt/sources.list.d/debian.sources' to '/etc/apt/sources.list.d/debian.sources.back': Permission denied
"SONIC_DPKG_CACHE_METHOD"         : "cache"

Maybe you should use $SUDO here?

Oh.

@xumia @liushilongbuaa

I got this error message for sonic-slave-bookworm container:

BLDENV=bookworm make -f Makefile.work list
...
"PTF_ENV_PY_VER"                  : "mixed"

mv: cannot move '/etc/apt/sources.list.d/debian.sources' to '/etc/apt/sources.list.d/debian.sources.back': Permission denied
"SONIC_DPKG_CACHE_METHOD"         : "cache"

Maybe you should use $SUDO here?

It needs tests. Maybe some scenario reports the error. The PR fixed build issue at that time. I'm not sure if adding sudo have other issues.

@k-v1
Copy link
Contributor

k-v1 commented May 21, 2024

It needs tests. Maybe some scenario reports the error. The PR fixed build issue at that time. I'm not sure if adding sudo have other issues.

@liushilongbuaa FYI

When we enable or disable reproducible mirrors in this function we use $SUDO:

        # Enable or disable the reproducible mirrors
        $SUDO sed -i "$expression" "$mirror"

        # Enable or disable the none reproducible mirrors
        if [ "$MIRROR_SNAPSHOT" == y ]; then
            $SUDO sed -ri "$expression2" "$mirror"
        fi

        # Add or remove the SET_REPR_MIRRORS flag
        $SUDO sed -i "$expression3" "$mirror"

That's why my suggestion was to also use $SUDO when mv sources.list. But I haven't tested this.

matofeder added a commit to matofeder/sonic-buildimage that referenced this pull request Oct 9, 2024
This commit resolves a permission denied issue during the mv command in bookworm
by adding escalated sudo privileges. For more details, see the related PR
and discussion:
sonic-net#18789

Signed-off-by: Matej Feder <[email protected]>
matofeder added a commit to SovereignCloudStack/sonic-buildimage that referenced this pull request Oct 9, 2024
This commit resolves a permission denied issue during the mv command in bookworm
by adding escalated sudo privileges. For more details, see the related PR
and discussion:
sonic-net/sonic-buildimage#18789

Signed-off-by: Matej Feder <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants