Symlink incorrectly installs to a sub-directory related to source name (github: 80)

Bug #1933827 reported by Zygmunt Krynicki
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zmk (Ubuntu)
Fix Released
Low
Unassigned
Hirsute
In Progress
Low
Unassigned

Bug Description

This bug is a mirror of the GitHub issue https://github.com/zyga/zmk/issues/80 filed for the purpose of SRU

The following makefile snippet illustrates the problem:

# Symlink: sysota-rauc-hook -> sysotad
cmd/sysotad/sysota-rauc-hook.InstallDir = $(cmd/sysotad/sysotad.InstallDir)
cmd/sysotad/sysota-rauc-hook.SymlinkTarget = sysotad
$(eval $(call ZMK.Expand,Symlink,cmd/sysotad/sysota-rauc-hook))

The result of make install should be

ln -s sysotad /usr/lib/sysotad/sysotad-rauc-hook

With zmk << 0.5.1 it is

ln -s sysotad /usr/lib/sysotad/cmd/sysotad/sysotad-rauc-hook

This bug was fixed in zmk 0.5.1, which is available in Debian Unstable and Ubuntu Impish as 0.5.1-2

[Impact]

The issue is isolated to the ZMK Symlink template and is only visible when the path of the symbolic link, in the development tree, contains a sub-directory, like in the RAUC hook example above.

[Test Case]
Create a makefile with this content:

include z.mk
$(eval $(call ZMK.Import,Directories))
subdir/symlink.InstallDir = $(bindir)
subdir/symlink.SymlinkTarget = target
$(eval $(call ZMK.Expand,Symlink,subdir/symlink))

Issue the command: make -n install. The correct output is:

ln -sf target /usr/local/bin/symlink

In the broken case, the output is:

ln -sf target /usr/local/bin/subdir/symlink

[Where problems could occur]
Since zmk is only used by my own software, most notably libzt, and libzt does not trigger this error, the regression potential is minimal.

Zygmunt Krynicki (zyga)
description: updated
Zygmunt Krynicki (zyga)
description: updated
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I've attached a debdiff fixing this in the most minimal way possible

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Updated patch with quilt support :)

description: updated
description: updated
Michael Vogt (mvo)
Changed in zmk (Ubuntu):
status: New → Fix Released
Changed in zmk (Ubuntu Hirsute):
status: New → In Progress
Mathew Hodson (mhodson)
Changed in zmk (Ubuntu):
importance: Undecided → Low
Changed in zmk (Ubuntu Hirsute):
importance: Undecided → Low
Revision history for this message
Robie Basak (racb) wrote :

> Since zmk is only used by my own software, most notably libzt, and libzt does not trigger this error, the regression potential is minimal.

In this case, why are you seeking an SRU? What's the user impact? Either there's none, in which case this SRU is not required, or there is some, in which case you can't dismiss regression potential on the basis that no users will be affected. Which is it? Please adjust your assessment accordingly.

This upload is missing a bug reference in the changes file (probably because of your non-standard bug reference form). I could fix that up for you, but my question above requires a review round trip, so I'll leave you to re-upload with a fixed changes file please.

Revision history for this message
Robie Basak (racb) wrote :

Unsubscribing sponsors as there is nothing currently available to sponsor.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.