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

feat(24.04): add vim and vim-tiny slices #301

Open
wants to merge 6 commits into
base: ubuntu-24.04
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions slices/libgpm2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package: libgpm2

essential:
- libgpm2_copyright

slices:
libs:
essential:
- libc6_libs
contents:
/usr/lib/*-linux-*/libgpm.so.2:

copyright:
contents:
/usr/share/doc/libgpm2/copyright:
12 changes: 12 additions & 0 deletions slices/libpython3.12t64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package: libpython3.12t64

slices:
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to add a copyright slice with the following path?

/usr/share/doc/libpython3.12t64

Have to check the deps though. It's a symlink, might need other package to fill in the target path.

libs:
essential:
- libc6_libs
- libexpat1_libs
- libpython3.12-stdlib_core
Copy link
Member

Choose a reason for hiding this comment

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

Would you please double-check why we need libpython3.12-stdlib? I am guessing libpython3.12-stdlib is a dependency of libpython3.12t64 because of the copyright paths. But I could be wrong.

lrwxrwxrwx root/root         0 2024-07-31 17:43 ./usr/share/doc/libpython3.12t64 -> libpython3.12-stdlib

Does the shared objects in this package access any python libs? ldd didn't produce anything like that:

# ldd ./usr/lib/x86_64-linux-gnu/libpython3.12.so.1.0
	linux-vdso.so.1 (0x00007fff4bd6c000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007d44f1f83000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007d44f1f67000)
	libexpat.so.1 => not found
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007d44f13ee000)
	/lib64/ld-linux-x86-64.so.2 (0x00007d44f2070000)

Choose a reason for hiding this comment

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

Without going into the source, strings shows that many of the libraries in libpython3.12-stdlib are referenced in libpython3.12t64. Im guessing the dependency here is on python libraries that don't show up with ldd

- zlib1g_libs
contents:
/usr/lib/*-linux-*/libpython3.12.so.1*:
/usr/lib/python3.12/config-3.12-*-linux-*/libpython3.12.so:
18 changes: 18 additions & 0 deletions slices/vim-common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package: vim-common

essential:
- vim-common_copyright

slices:
config:
contents:
/etc/vim/vimrc:
/usr/share/vim/vim91/debian.vim:
Copy link
Member

Choose a reason for hiding this comment

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

I am a bit sceptic on whether or not we should include this file in config. It seems quite specific for Debian.

Having said that, if we do include it upon agreement, would you kindly omit the vim91 word with vim*?


data:
contents:
/usr/bin/helpztags:
Comment on lines +12 to +14
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure if data is the appropriate slice name here. helpztags is a perl script:

#!/usr/bin/perl
# 
# helpztags generates tags for Vim helpfiles, for both .txt and .txt.gz files
# Author: Jakub Turski <[email protected]>
#         Artur R. Czechowski <[email protected]>
# Version: 0.4

# Please use following command for generate a manual file:
# pod2man -c "User Commands" -s 1 -q none -r "vim 6.2" -d "September 2003" helpztags helpztags.1

=head1 NAME

helpztags - generate the help tags file for directory
...

How about bins?


copyright:
contents:
/usr/share/doc/vim-common/copyright:
47 changes: 47 additions & 0 deletions slices/vim-runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package: vim-runtime

essential:
- vim-runtime_copyright

slices:
vimtutor:
contents:
/usr/bin/vimtutor:
/usr/share/vim/vim*/tutor/tutor*:

plugins:
contents:
/usr/share/vim/vim*/autoload/**:
/usr/share/vim/vim*/bugreport.vim:
/usr/share/vim/vim*/colors/**:
/usr/share/vim/vim*/compiler/**:
/usr/share/vim/vim*/defaults.vim:
/usr/share/vim/vim*/delmenu.vim:
/usr/share/vim/vim*/evim.vim:
/usr/share/vim/vim*/filetype.vim:
/usr/share/vim/vim*/ftoff.vim:
/usr/share/vim/vim*/ftplugin.vim:
/usr/share/vim/vim*/ftplugin/**:
/usr/share/vim/vim*/ftplugof.vim:
/usr/share/vim/vim*/gvimrc_example.vim:
/usr/share/vim/vim*/import/**:
/usr/share/vim/vim*/indent.vim:
/usr/share/vim/vim*/indent/**:
/usr/share/vim/vim*/indoff.vim:
/usr/share/vim/vim*/keymap/**:
/usr/share/vim/vim*/macros/**:
/usr/share/vim/vim*/menu.vim:
/usr/share/vim/vim*/mswin.vim:
/usr/share/vim/vim*/optwin.vim:
/usr/share/vim/vim*/pack/**:
/usr/share/vim/vim*/plugin/**:
/usr/share/vim/vim*/print/**:
/usr/share/vim/vim*/scripts.vim:
/usr/share/vim/vim*/spell/**:
/usr/share/vim/vim*/synmenu.vim:
/usr/share/vim/vim*/syntax/**:
/usr/share/vim/vim*/vimrc_example.vim:

copyright:
contents:
/usr/share/doc/vim-runtime/copyright:
25 changes: 25 additions & 0 deletions slices/vim-tiny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package: vim-tiny

essential:
- vim-tiny_copyright

slices:
bins:
essential:
- libacl1_libs
- libc6_libs
- libselinux1_libs
- libtinfo6_libs
- vim-common_config
- vim-tiny_config
contents:
/usr/bin/vi: {symlink: /usr/bin/vim.tiny}
Copy link
Member

Choose a reason for hiding this comment

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

Good call not making the view, editor symlinks! 👍

Copy link
Member

Choose a reason for hiding this comment

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

Coming back to this again, vim also tries to create a symlink from vi:

update-alternatives --install /usr/bin/vi vi /usr/bin/vim.basic 30

Perhaps we should ignore making the vi symlink?

/usr/bin/vim.tiny:

config:
contents:
/etc/vim/vimrc.tiny:

copyright:
contents:
/usr/share/doc/vim-tiny/copyright:
24 changes: 24 additions & 0 deletions slices/vim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package: vim

essential:
- vim_copyright

slices:
bins:
essential:
- libacl1_libs
- libc6_libs
- libgpm2_libs
- libpython3.12t64_libs
- libselinux1_libs
- libsodium23_libs
- libtinfo6_libs
- vim-common_config
- vim-runtime_plugins
contents:
/usr/bin/vim: {symlink: /usr/bin/vim.basic}
Copy link
Member

Choose a reason for hiding this comment

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

This is fine, until we have packages like vim-gtk3 coming in where it demands with a higher priority that vim should point to vim.gtk3:

update-alternatives --install /usr/bin/vim vim /usr/bin/vim.gtk3 50

Thoughts on how we should address the vi and vim symlinks?

Choose a reason for hiding this comment

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

I think we have a similar issue with symlinking sh to various shells. Maybe we should have an explicit symlink slice in the future so we could have both bash_bins and dash_bins installed, but specify dash as sh via dash_links or dash_sh

/usr/bin/vim.basic:

copyright:
contents:
/usr/share/doc/vim/copyright:
12 changes: 12 additions & 0 deletions tests/spread/integration/vim/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
summary: Integration tests for vim and vim-tiny

execute: |
rootfs="$(install-slices vim-tiny_bins)"
echo "hello world" > "$rootfs/test"
chroot "$rootfs" vi -c ":s/hello/bye/" -c ":wq" test
grep bye "$rootfs/test"

rootfs="$(install-slices vim_bins)"
echo "hello world" > "$rootfs/test"
chroot "$rootfs" vim -c ":s/hello/bye/" -c ":wq" test
grep bye "$rootfs/test"
Loading