Skip to content

Ensure no broken symlinks in stage#371

Merged
sergio-costas merged 2 commits into
ubuntu:gnome-46-2404-sdkfrom
sergio-costas:ensure-no-dangling-symlinks
Jun 12, 2026
Merged

Ensure no broken symlinks in stage#371
sergio-costas merged 2 commits into
ubuntu:gnome-46-2404-sdkfrom
sergio-costas:ensure-no-dangling-symlinks

Conversation

@sergio-costas

Copy link
Copy Markdown
Contributor

This PR adds a tool to ensure that there are no broken symlinks in stage, showing which packages must be added if needed.

@sergio-costas sergio-costas requested a review from aleasto June 9, 2026 12:37
@aleasto

aleasto commented Jun 10, 2026

Copy link
Copy Markdown
Member

Uhh I think what you really want here is:

  • apt-file find /path/to/link to find which package provides the link, and/or
  • apt-file find $(realpath /path/to/link) to find which package provides the target

@3v1n0

3v1n0 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Uhh I think what you really want here is:

* `apt-file find /path/to/link` to find which package provides the link, and/or

* `apt-file find $(realpath /path/to/link)` to find which package provides the target

Yeah, but that implies filling a database, can it go using a different root prefix?

@aleasto

aleasto commented Jun 10, 2026

Copy link
Copy Markdown
Member

Uhh I think what you really want here is:

* `apt-file find /path/to/link` to find which package provides the link, and/or

* `apt-file find $(realpath /path/to/link)` to find which package provides the target

Yeah, but that implies filling a database, can it go using a different root prefix?

If the plan is to run this during the snapcraft build, just call apt-file update in override-pull.

Comment thread tools/check_broken_links.py Outdated
@sergio-costas

sergio-costas commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Uhh I think what you really want here is:

* `apt-file find /path/to/link` to find which package provides the link, and/or

* `apt-file find $(realpath /path/to/link)` to find which package provides the target

I'm already doing that, but with dpkg...
imagen

Also, using apt-file requires to install the package and refresh the cache, something that dpkg doesn't require.

@aleasto

aleasto commented Jun 10, 2026

Copy link
Copy Markdown
Member

Uhh I think what you really want here is:

* `apt-file find /path/to/link` to find which package provides the link, and/or

* `apt-file find $(realpath /path/to/link)` to find which package provides the target

I'm already doing that, but with dpkg... imagen

But that implies that you need to install (and then remove) packages, which we should really avoid.
You also shouldn't assume to have network access at this point of the build.

@sergio-costas

Copy link
Copy Markdown
Contributor Author

But that implies that you need to install (and then remove) packages, which we should really avoid. You also shouldn't assume to have network access at this point of the build.

Without network access I can't refresh the package list...

@aleasto

aleasto commented Jun 10, 2026

Copy link
Copy Markdown
Member

But that implies that you need to install (and then remove) packages, which we should really avoid. You also shouldn't assume to have network access at this point of the build.

Without network access I can't refresh the package list...

You can in override-pull

@sergio-costas

Copy link
Copy Markdown
Contributor Author

Without network access I can't refresh the package list...

You can in override-pull

Good point... Let me first debug other parts, and then I'll change that.

Comment thread snapcraft.yaml Outdated
@sergio-costas sergio-costas force-pushed the ensure-no-dangling-symlinks branch from 1455888 to 7f64ebf Compare June 10, 2026 19:02
@sergio-costas sergio-costas marked this pull request as ready for review June 10, 2026 20:46
@sergio-costas

Copy link
Copy Markdown
Contributor Author

@aleasto It builds armhf, arm64 and amd64. Still waiting for riscv64.

@sergio-costas sergio-costas requested a review from aleasto June 12, 2026 09:02

@aleasto aleasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some comments in-line.
Please split the commits into one fixing the build and one adding the assertions

Comment thread snapcraft.yaml
Comment thread snapcraft.yaml Outdated
@sergio-costas sergio-costas force-pushed the ensure-no-dangling-symlinks branch from 7f64ebf to 4d783fd Compare June 12, 2026 09:34
Comment thread tools/check_broken_links.py Outdated
Comment thread snapcraft.yaml
Comment thread tools/check_broken_links.py Outdated
@sergio-costas sergio-costas force-pushed the ensure-no-dangling-symlinks branch from 4d783fd to eb0b6de Compare June 12, 2026 11:08
Comment thread snapcraft.yaml
@sergio-costas sergio-costas force-pushed the ensure-no-dangling-symlinks branch from eb0b6de to 2876b66 Compare June 12, 2026 12:42
Comment thread snapcraft.yaml
@sergio-costas sergio-costas force-pushed the ensure-no-dangling-symlinks branch from 2876b66 to 4b9f63d Compare June 12, 2026 12:52
Comment thread snapcraft.yaml Outdated
@sergio-costas sergio-costas force-pushed the ensure-no-dangling-symlinks branch from 4b9f63d to d0b87e4 Compare June 12, 2026 12:54

@aleasto aleasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

awesome, LGTM if CI is green

This PR adds a tool to ensure that there are no broken symlinks
in stage, showing which packages must be added if needed. It also
fixes the remaining broken symlinks.
@sergio-costas sergio-costas force-pushed the ensure-no-dangling-symlinks branch from d0b87e4 to 76c8d1e Compare June 12, 2026 16:42

@aleasto aleasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ouch, yes

@sergio-costas

Copy link
Copy Markdown
Contributor Author

Finally!!!! (tested locally. The trick was that environment variable).

@sergio-costas sergio-costas merged commit f0723a0 into ubuntu:gnome-46-2404-sdk Jun 12, 2026
32 of 33 checks passed
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