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

contrib: bash_completion.d: force zpool symlink recreation #16423

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

robn
Copy link
Member

@robn robn commented Aug 8, 2024

[Sponsors: Klara, Inc., Wasabi Technology, Inc.]

Motivation and Context

Following #16376, rebuild fails if the zpool symlink already exists (usually after a branch change).

Description

ln will fail if the target already exists, which causes make to bail out. Adding -f makes it more "compiler-like", overwriting

Note this is not fixing the same thing as #16422. That's a separate thing.

How Has This Been Tested?

By hand!

Before:

$ ls -l contrib/bash_completion.d/z*
-rw-r--r-- 1 robn robn 15162 Aug  8 13:14 contrib/bash_completion.d/zfs
-rw-r--r-- 1 robn robn 15150 Aug  8 13:14 contrib/bash_completion.d/zfs.in
lrwxrwxrwx 1 robn robn     3 Aug  8 10:36 contrib/bash_completion.d/zpool -> zfs

$ touch contrib/bash_completion.d/zfs.in

$ make contrib/bash_completion.d/zpool
  GEN      contrib/bash_completion.d/zfs
ln -s zfs contrib/bash_completion.d/zpool
ln: failed to create symbolic link 'contrib/bash_completion.d/zpool': File exists
make: *** [Makefile:14141: contrib/bash_completion.d/zpool] Error 1

$ make contrib/bash_completion.d/zpool
make: 'contrib/bash_completion.d/zpool' is up to date.

After:

$ ls -l contrib/bash_completion.d/z*
-rw-r--r-- 1 robn robn 15162 Aug  8 13:13 contrib/bash_completion.d/zfs
-rw-r--r-- 1 robn robn 15150 Jul 26 11:51 contrib/bash_completion.d/zfs.in
lrwxrwxrwx 1 robn robn     3 Aug  8 13:13 contrib/bash_completion.d/zpool -> zfs

$ touch contrib/bash_completion.d/zfs.in

$ make contrib/bash_completion.d/zpool
  GEN      contrib/bash_completion.d/zfs
ln -s -f zfs contrib/bash_completion.d/zpool

$ make contrib/bash_completion.d/zpool
make: 'contrib/bash_completion.d/zpool' is up to date.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

ln will fail if the target already exists, which causes make to bail
out. Adding -f makes it more "compiler-like", overwriting the target
instead.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Copy link
Contributor

@0mp 0mp left a comment

Choose a reason for hiding this comment

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

I hit this as well. Thanks for patching it.

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Aug 8, 2024
@behlendorf behlendorf merged commit 8041b2f into openzfs:master Aug 8, 2024
22 of 23 checks passed
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Sep 4, 2024
ln will fail if the target already exists, which causes make to bail
out. Adding -f makes it more "compiler-like", overwriting the target
instead.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Mateusz Piotrowski <0mp@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes openzfs#16423
ptr1337 pushed a commit to CachyOS/zfs that referenced this pull request Nov 14, 2024
ln will fail if the target already exists, which causes make to bail
out. Adding -f makes it more "compiler-like", overwriting the target
instead.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Mateusz Piotrowski <0mp@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes openzfs#16423
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants