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

Install bashcompletion file in appropriate location #15304

Closed
wants to merge 3 commits into from

Conversation

siv0
Copy link
Contributor

@siv0 siv0 commented Sep 21, 2023

This patchset is the result of trying to build Debian Packages for 2.2.0-rc4 for Proxmox[0]
The changes in debian/contrib were only targeted at the fix (I did not try to install the resulting packages)

[0] https://git.proxmox.com/?p=zfsonlinux.git;a=tree

Motivation and Context

Somewhere between zfs-2.1.12 and zfs-2.2.0-rc4 a change caused the bash completion to
actually get installed to DESTDIR - I assume 612b8df
introduced it.
Instead of working around the different location used in Debian based distributions (/usr/share/bash-completion/completions/, instead of /etc/bash_completion.d) in debian/rules [1] , setting the path during ./configure seems preferable)

[1]

install -D -t '$(CURDIR)/debian/tmp/usr/share/bash-completion/completions/' \

(similar workaround can be found in Debian upstream and Proxmox rules files)

Description

commit 1/3 sets the bashcompletiondir variable based on the vendor, inspired by similar settings for initdir and initconfdir
commit 2/3 is a small update to contrib/debian/control, in order to make building packages work on Debian Bookworm (the dkms package is virtual and should be replaced by dh-sequence-dkms)
commit 3/3 adapts contrib/debian/rules to not move the bashcompletion file around anymore

How Has This Been Tested?

on Debian 12 I ran:
git clean -fdx; ./autogen.sh; ./configure --with-config=user; cp -a contrib/debian .; dpkg-buildpackage -b -uc -us
(the --with-config=user was a shorter way instead of providing the custom kernel-header location in Proxmox VE)
on Fedora 38:
git clean -fdx; ./autogen.sh ; ./configure ; make rpm
and verifying that the bash completion file was installed in the correct location

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:

Stoiko Ivanov added 3 commits September 21, 2023 16:06
Certain Linux distributions (Debian/Ubuntu at least) expect
bash-completion snippets to be installed in
/usr/share/bash-completion/completions instead of
/etc/bash_completion.d.

This patch sets the bashcompletiondir variable based on the vendor,
inspired by similar settings for initdir and initconfdir.

It seems that commit 612b8df
caused the file to be installed in the first-place (thus the error
when building debian packages only became apparent when testing a
2.2.0-rc4 build)

The change only sets the variable in Makefile context - the
rpm/zfs.spec.in file has the path hardcoded as
%{_sysconfdir}/bash_completion.d/zfs, but since running
```
./configure --sysconfdir=/myetc  ; make rpm
```
also results in all relevant files to be installed in /etc instead of
/myetc I assume this can remain as is.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Follows b191f9a13d3005621ead9a727b811892264505ef from Debian's
packaging team at:
https://salsa.debian.org/zfsonlinux-team/zfs/

The previous build-dependency is kept as option, to still be able to
build on older Debian based distros (e.g. Ubuntu 20.04).

Without this building on Debian 12/bookworm does not work, as `dkms`
is a virtual package.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
tested by running:
```
./configure --with-config=user; cp -a contrib/debian .
dpkg-buildpackage -b -uc -us
```
on a Debian 12 based system.

and checking where the completion file got installed.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
@siv0 siv0 force-pushed the fix_bashcompletion_dir_defaults branch from 9b51ef1 to cc132e3 Compare September 21, 2023 16:56
@behlendorf
Copy link
Contributor

@usaleem-ix would you mind reviewing this.

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Sep 22, 2023
Copy link
Contributor

@usaleem-ix usaleem-ix left a comment

Choose a reason for hiding this comment

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

LGTM.

Sorry for the delay, this one got lost in emails.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Oct 3, 2023
@behlendorf behlendorf closed this in e69ade3 Oct 3, 2023
behlendorf pushed a commit that referenced this pull request Oct 3, 2023
Follows b191f9a13d3005621ead9a727b811892264505ef from Debian's
packaging team at:
https://salsa.debian.org/zfsonlinux-team/zfs/

The previous build-dependency is kept as option, to still be able to
build on older Debian based distros (e.g. Ubuntu 20.04).

Without this building on Debian 12/bookworm does not work, as `dkms`
is a virtual package.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15304
behlendorf pushed a commit that referenced this pull request Oct 3, 2023
tested by running:
```
./configure --with-config=user; cp -a contrib/debian .
dpkg-buildpackage -b -uc -us
```
on a Debian 12 based system.

and checking where the completion file got installed.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15304
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Oct 3, 2023
Certain Linux distributions (Debian/Ubuntu at least) expect
bash-completion snippets to be installed in
/usr/share/bash-completion/completions instead of
/etc/bash_completion.d.

This patch sets the bashcompletiondir variable based on the vendor,
inspired by similar settings for initdir and initconfdir.

It seems that commit 612b8df
caused the file to be installed in the first-place (thus the error
when building debian packages only became apparent when testing a
2.2.0-rc4 build)

The change only sets the variable in Makefile context - the
rpm/zfs.spec.in file has the path hardcoded as
%{_sysconfdir}/bash_completion.d/zfs, but since running
```
./configure --sysconfdir=/myetc  ; make rpm
```
also results in all relevant files to be installed in /etc instead of
/myetc I assume this can remain as is.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes openzfs#15304
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Oct 3, 2023
Follows b191f9a13d3005621ead9a727b811892264505ef from Debian's
packaging team at:
https://salsa.debian.org/zfsonlinux-team/zfs/

The previous build-dependency is kept as option, to still be able to
build on older Debian based distros (e.g. Ubuntu 20.04).

Without this building on Debian 12/bookworm does not work, as `dkms`
is a virtual package.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes openzfs#15304
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Oct 3, 2023
tested by running:
```
./configure --with-config=user; cp -a contrib/debian .
dpkg-buildpackage -b -uc -us
```
on a Debian 12 based system.

and checking where the completion file got installed.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes openzfs#15304
behlendorf pushed a commit that referenced this pull request Oct 3, 2023
Certain Linux distributions (Debian/Ubuntu at least) expect
bash-completion snippets to be installed in
/usr/share/bash-completion/completions instead of
/etc/bash_completion.d.

This patch sets the bashcompletiondir variable based on the vendor,
inspired by similar settings for initdir and initconfdir.

It seems that commit 612b8df
caused the file to be installed in the first-place (thus the error
when building debian packages only became apparent when testing a
2.2.0-rc4 build)

The change only sets the variable in Makefile context - the
rpm/zfs.spec.in file has the path hardcoded as
%{_sysconfdir}/bash_completion.d/zfs, but since running
```
./configure --sysconfdir=/myetc  ; make rpm
```
also results in all relevant files to be installed in /etc instead of
/myetc I assume this can remain as is.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15304
behlendorf pushed a commit that referenced this pull request Oct 3, 2023
Follows b191f9a13d3005621ead9a727b811892264505ef from Debian's
packaging team at:
https://salsa.debian.org/zfsonlinux-team/zfs/

The previous build-dependency is kept as option, to still be able to
build on older Debian based distros (e.g. Ubuntu 20.04).

Without this building on Debian 12/bookworm does not work, as `dkms`
is a virtual package.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15304
behlendorf pushed a commit that referenced this pull request Oct 3, 2023
tested by running:
```
./configure --with-config=user; cp -a contrib/debian .
dpkg-buildpackage -b -uc -us
```
on a Debian 12 based system.

and checking where the completion file got installed.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes #15304
@usaleem-ix
Copy link
Contributor

@siv0 it looks this PR has caused a regression. #15355 might be of interest to you. make rpm and make deb is failing reliably on Debian after these changes.

@siv0
Copy link
Contributor Author

siv0 commented Oct 6, 2023

@siv0 it looks this PR has caused a regression. #15355 might be of interest to you. make rpm and make deb is failing reliably on Debian after these changes.

Thanks for the heads-up - I'll take a look!

lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Dec 12, 2023
Certain Linux distributions (Debian/Ubuntu at least) expect
bash-completion snippets to be installed in
/usr/share/bash-completion/completions instead of
/etc/bash_completion.d.

This patch sets the bashcompletiondir variable based on the vendor,
inspired by similar settings for initdir and initconfdir.

It seems that commit 612b8df
caused the file to be installed in the first-place (thus the error
when building debian packages only became apparent when testing a
2.2.0-rc4 build)

The change only sets the variable in Makefile context - the
rpm/zfs.spec.in file has the path hardcoded as
%{_sysconfdir}/bash_completion.d/zfs, but since running
```
./configure --sysconfdir=/myetc  ; make rpm
```
also results in all relevant files to be installed in /etc instead of
/myetc I assume this can remain as is.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes openzfs#15304
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Dec 12, 2023
Follows b191f9a13d3005621ead9a727b811892264505ef from Debian's
packaging team at:
https://salsa.debian.org/zfsonlinux-team/zfs/

The previous build-dependency is kept as option, to still be able to
build on older Debian based distros (e.g. Ubuntu 20.04).

Without this building on Debian 12/bookworm does not work, as `dkms`
is a virtual package.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes openzfs#15304
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Dec 12, 2023
tested by running:
```
./configure --with-config=user; cp -a contrib/debian .
dpkg-buildpackage -b -uc -us
```
on a Debian 12 based system.

and checking where the completion file got installed.

Reviewed-by: Umer Saleem <usaleem@ixsystems.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Closes openzfs#15304
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.

3 participants