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

[build] Fix against stray tmp.XXXXXX files in ./dpkg dir #20773

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wdoekes
Copy link
Contributor

@wdoekes wdoekes commented Nov 12, 2024

Why I did it

I don't like a bunch of useless tempdirs laying around.

Resolves: #20772

How I did it

The make function SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR is not always run, but if it's parsed, the $(shell) calls would be executed. They caused tempdirs to be created. But only if the function was run, were those dirs cleaned up.

This change moves the tempdir creation to the function run.

Additionally it moves the trap EXIT two lines earlier, so that a failing mount would not leave useless dirs either.

How to verify it

Run make and observe how at the end there aren't lots of stale temp dirs ./dpkg.

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

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

I think this change could be backported to at least the active 202405 branch, but it's not strictly necessary.

Tested branch (Please provide the tested image version)

master

==== Why I did it

I don't like a bunch of useless tempdirs laying around.
Issue: sonic-net#20772

==== How I did it

The make function SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR is not always run, but
if it's parsed, the $(shell) calls would be executed. They caused tempdirs
to be created. But only if the function was run, were those dirs cleaned
up.

This change moves the tempdir creation to the function run.

Additionally it moves the trap EXIT two lines earlier, so that a failing
mount would not leave useless dirs either.

==== How to verify it

Run `make` and observe how at the end there aren't lots of stale temp
dirs `./dpkg`.
@FengPan-Frank
Copy link
Contributor

FengPan-Frank commented Nov 25, 2024

/azpw run Azure.sonic-buildimage

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.

[build] The build process leaves stray tmp.XXXXXX dirs in ./dpkg dir
2 participants