Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#56532 - [mailcap] should not include nginx-specific files

Attached to Project: Arch Linux
Opened by L. Bradley LaBoon (lb.laboon) - Friday, 01 December 2017, 18:17 GMT
Last edited by Doug Newgard (Scimmia) - Friday, 01 December 2017, 18:38 GMT
Task Type General Gripe
Category Packages: Extra
Status Assigned
Assigned To Jan Alexander Steffens (heftig)
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 3
Private No

Details

Per the following thread in [arch-dev-public]:
https://lists.archlinux.org/pipermail/arch-dev-public/2017-November/029036.html

The mailcap package was updated to replace mime-types, but now also provides /etc/nginx/mime.types.
That file is specific to nginx, and so should be provided by the nginx package.

From what I can tell, the reasoning behind including it in mailcap was that the mime.types provided upstream by nginx doesn't have as many types.
If this is the case then that should be fixed upstream, not by Arch (or alternatively, a separate mailcap-nginx package should be created which provides it).

By comparison, Apache also ships with an upstream mime.types which is provided by the httpd package.
This task depends upon

Comment by Samuel Williams (ioquatix) - Monday, 11 December 2017, 02:14 GMT
This is a problem as we have AUR packages for nginx which conflict with this. +1 that only nginx package should install into /etc/nginx.
Comment by L. Bradley LaBoon (lb.laboon) - Thursday, 14 December 2017, 02:42 GMT
Here is a patch for mailcap which removes the nginx-related files (assuming this is the desired route).
Comment by L. Bradley LaBoon (lb.laboon) - Thursday, 14 December 2017, 02:43 GMT
And here is a patch for nginx which keeps the upstream mime.types and removes the dependency on mailcap (again, assuming this is the desired solution).
Comment by Samuel Williams (ioquatix) - Saturday, 30 December 2017, 22:42 GMT
This is still causing problems our custom deployments of nginx.
Comment by Jan Alexander Steffens (heftig) - Sunday, 31 December 2017, 03:37 GMT
AUR packages are not a concern.
Comment by Samuel Williams (ioquatix) - Wednesday, 03 January 2018, 00:18 GMT
Thanks for your input.

I think it's unreasonable to completely disregard AUR packages, because your also really ignoring people who want to do source installations too.

Nginx provides it's own mime.types file (https://github.com/nginx/nginx/tree/master/conf), but the PKGBUILD file removes it: `rm "$pkgdir"/etc/nginx/mime.types # in mailcap` from nginx-mainline.

Arch linux's guiding principles (https://wiki.archlinux.org/index.php/Arch_Linux):

Simplicity: Arch Linux defines simplicity as without unnecessary additions or modifications. It ships software as released by the original developers (upstream) with minimal distribution-specific (downstream) changes: patches not accepted by upstream are avoided, and Arch's downstream patches consist almost entirely of backported bug fixes that are obsoleted by the project's next release.

I think that this is an unnecessary modification of the nginx package.

It also means that nginx unnecessarily depends on mailcap, and that mailcap installs configuration files which are by default unnecessary unless the user also installs nginx. For a typical user, it might be confusing that /etc/nginx exists even without nginx installed.

I think a better solution would be to use the nginx mime.types files as it was, and then provide the ability for users to easily install the mailcap mime.types if needed, e.g. using the supplied shell script from mailcap, or perhaps installing that file but in an alternative location, e.g. /etc/mailcap/nginx-mime.types and allowing users to specify the nginx configuration to use this alternative location.
Comment by Eli Schwartz (eschwartz) - Wednesday, 03 January 2018, 01:15 GMT
If AUR packages conflict with the repos, it is as a general rule of thumb their responsibility to adapt. Source installations should not clash in the package manager, at worst you will have files which don't match the packaged ones.


The fact that nginx decided to maintain their own vendored and heavily inferior mime.types *configuration file* is not proof positive that providing our own is diverging from upstream. mailcap is our canonical source for mime.types and it makes sense to treat it as such. The Arch Way isn't very applicable here.

A single 98KB dependency that serves a useful purpose is, well, not unnecessary, and also not burdensome, from a nginx perspective.

From a random users perspective, I guess we could in theory symlink it in the nginx package to a file provided by mailcap which could not go in etc/mailcap/ because that is already a file, but I guess we could find some other location to spare peoples' confusion. More importantly, that symlink would not clash with source or AUR installations any more than the rest of nginx would.
Comment by Eli Schwartz (eschwartz) - Wednesday, 03 January 2018, 01:16 GMT
Also I think thematically the apache package should undergo the same change as nginx, and rely on the single authoritative mime.types defined by the user's system.
Comment by Samuel Williams (ioquatix) - Wednesday, 03 January 2018, 01:33 GMT
Thanks for your input.

> If AUR packages conflict with the repos, it is as a general rule of thumb their responsibility to adapt.

I absolutely agree with this.

> Source installations should not clash in the package manager, at worst you will have files which don't match the packaged ones.

Yep, that makes sense. Unfortunately right now I don't feel that this is the case. If I install mailcap, it will install /etc/nginx/mime.types and a source installation of nginx will conflict with this. (e.g. if you were to install nginx from source before installing mailcap, pacman would barf).

> The fact that nginx decided to maintain their own vendored and heavily inferior mime.types *configuration file* is not proof positive that providing our own is diverging from upstream. mailcap is our canonical source for mime.types and it makes sense to treat it as such. The Arch Way isn't very applicable here.

Fair enough. I understand where you are coming from. I guess nginx was faced with supporting a wide range of systems and couldn't depend on /etc/mime.types existing, or perhaps that people would want to only have a limited set of mime.types available when serving files via a web server.

I do understand the value of having a central source of truth. However, at least form one point of view, this diverges from the arch way since other packages now need to be modified to depend on it. The traditional solution to this has been to submit upstream patches, e.g. to nginx and apache, to allow for them to support, e.g. /etc/mime.types as it currently stands, without modification of either how mime.types works or the upstream packages by PKGBUILD.

> A single 98KB dependency that serves a useful purpose is, well, not unnecessary, and also not burdensome, from a nginx perspective.

Nginx worked perfectly fine before depending on mailcap.

> From a random users perspective, I guess we could in theory symlink it in the nginx package to a file provided by mailcap which could not go in etc/mailcap/ because that is already a file, but I guess we could find some other location to spare peoples' confusion. More importantly, that symlink would not clash with source or AUR installations any more than the rest of nginx would.

I think this would be a good compromise. I think it would make sense to have a master mime.types file, and it should be easy for the user to generate the specific configuration files for apps that need different formats. Alternatively, perhaps someone should work on an upstream patch to nginx so that it IS compatible with mime.types file as it currently stands. There are a few different options, but I think it would. make the most sense to minimise the breakage of existing AUR package when a good alternative exists, e.g.

- Install app specific files to /etc/mailcap/nginx-mime.types (or perhaps something more descriptive like `/etc/mime/$app.types`, -> `/etc/mime/nginx.types`).
- Have a master file, e.g. `/etc/mime.types` and then include the easy/documented way to update the application specific files. If a user adds their own types to /etc/mime.types it should be easy to reflect this in all apps, as you say a single source of truth.
- Adjust the nginx configuration to use this file rather than removing/over-writing a file which is installed by the nginx source package.

> Also I think thematically the apache package should undergo the same change as nginx, and rely on the single authoritative mime.types defined by the user's system.

This is an interesting point. It might be suitable for a desktop deployment, but it's not a great strategy for a server deployment, where you want more predictability.

I maintain several arch servers, both on-site and in the cloud. On some systems, we have a very specific/limited set of mime types by design, and this list only changes if there is an actual use-case for it. Other systems, it's irrelevant.





Comment by Samuel Williams (ioquatix) - Monday, 22 January 2018, 23:57 GMT
So, I started modifying my AUR packages to suit, but I still think

1/ It's silly of mailcap to include a mime file for nginx, because users without nginx will have some junk on their system.
2/ It makes more sense to have an explicit dependency e.g. mailcap-nginx

I'd like to see some resolution to this.
Comment by Samuel Williams (ioquatix) - Tuesday, 23 January 2018, 00:37 GMT
Okay, so I took matters into my own hands for my specific case.

https://aur.archlinux.org/packages/mailcap-mime-types/

It's basically mailcap but only the /etc/mime.types file, it's a direct replacement for the previous mime.types but based on mailcap.

It works for me and I think it's the simplest approach, since I'd prefer if the mime types for nginx were not the same as the system (it's unpredictable if it's changing and could be a security problem).

I don't know if it's been mentioned, but there was interesting discussion here https://bugzilla.redhat.com/show_bug.cgi?id=1248736 both sides of the coin fleshed out. I'm not sure if there is any "right" answer, but I think falling back on arch conventions of minimally invasive modifications to upstream packages is probably the best appraoch. One option might be to restore the `mime-types` package based on my `mailcap-mime-types` package above so things just basically work.
Comment by L. Bradley LaBoon (lb.laboon) - Friday, 28 December 2018, 20:34 GMT
Seeing as this issue is still open after over a year, would it be possible to get some eyes on this?

I still firmly believe that the mailcap package currently violates Arch's packaging standards, as it includes files that are specific to another package (nginx, in this case).
Even if the case is made that it's convenient to have nginx's mime.types provided by mailcap, that still leads to inconsistencies with how other software is packaged (e.g. Apache is packaged with its own mime.types).

I realize that the severity of this is quite low compared to other open issues, but it would be nice to see it get addressed given the relatively low effort involved.

Loading...