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] The build process leaves stray tmp.XXXXXX dirs in ./dpkg dir #20772

Open
wdoekes opened this issue Nov 12, 2024 · 0 comments
Open

[build] The build process leaves stray tmp.XXXXXX dirs in ./dpkg dir #20772

wdoekes opened this issue Nov 12, 2024 · 0 comments

Comments

@wdoekes
Copy link

wdoekes commented Nov 12, 2024

Description

After building, there are often stray diredctories in the ./dpkg dir.

These are caused by a makefile mismatch:

  • during make function/dependency parsing dirs are created
  • during the running, they are cleaned

The creation should happen at run only so they are cleaned up if they are created.

Steps to reproduce the issue:

  1. make all

Describe the results you received:

$ ls dpkg/ -ltr
total 243
drwx------ 2 sonic-builder sonic-builder 2 Nov  7 14:29 tmp.kqNUFxrvcs
drwx------ 2 sonic-builder sonic-builder 2 Nov  7 14:29 tmp.QNfFERqflx
...

Describe the results you expected:

$ ls dpkg -ltr
@wdoekes wdoekes changed the title [build] The builds process leaves stray tmp.XXXXXX dirs in ./dpkg dir [build] The build process leaves stray tmp.XXXXXX dirs in ./dpkg dir Nov 12, 2024
wdoekes added a commit to ossobv/sonic-buildimage that referenced this issue Nov 12, 2024
==== 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`.
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

No branches or pull requests

1 participant