Opened 5 years ago

Closed 4 years ago

#58733 closed defect (fixed)

libev: event.h should not be renamed

Reported by: vitalyster Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: jerryyhom, sierkb (Sierk Bornemann), fracai, ahrex, Schamschula (Marius Schamschula), ryandesign (Ryan Carsten Schmidt)
Port: libev libevent

Description

libev port contains libevent compatibility header event.h. For some reason it is renamed during port install (I guess it was done in order to prevent overwriting of libevent header). Most linux distributions provide this libev header in separate package e.g. libev-event-compat which marked as conflicted with libevent so they did not overwrite each other but only one of them should be installed. Does MacPorts provide such feature and can port file be changed for that?

Change History (19)

comment:1 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to stromnov
Status: newassigned

You're correct that the port renames the event.h header. It has done so ever since the port was first added in 2008.

You're probably right that it does this in order to avoid conflicting with the header from the libevent port.

Yes, MacPorts does have a mechanism for allowing a subset of files to be split off into another port (the subport feature). This feature was added to MacPorts in version 2.0.0 in 2011, so it didn't exist when the decision was made to rename that header, so it might be appropriate to revisit that decision now.

Yes, MacPorts does have a mechanism for declaring that two ports conflict because they install the same files (the conflicts keyword). This feature was added to MacPorts in version 1.8.0 in 2009.

comment:2 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jerryyhom added

Cc'ing maintainer of libevent in case he has input.

comment:3 Changed 5 years ago by jerryyhom

Ryan sums up the situation neatly. Sounds like we should be using the conflicts keyword in libev and libevent. I will update libevent's Portfile.

comment:4 Changed 5 years ago by jerryyhom

In c4a9e9075a95b829cce74a900610e3a4464b2c03/macports-ports (master):

libevent: update to 2.1.10

+ Add 'conflicts' with libev

see #58733

comment:5 Changed 5 years ago by fracai

Is there a way to get back the original non-conflicting behavior? The current state is that lighttpd needs libev and tmux needs libev, so there's no way to have both active at the same time. Unless I'm missing some method.

I note that libev still renames event.h so there isn't really a conflict.

Is libev planned to gain a subport that doesn't rename the file? Or I guess a subport that does rename the file?

Last edited 5 years ago by fracai (previous) (diff)

comment:6 in reply to:  4 Changed 5 years ago by sierkb (Sierk Bornemann)

Replying to jerryyhom:

In c4a9e9075a95b829cce74a900610e3a4464b2c03/macports-ports (master):

libevent: update to 2.1.10

+ Add 'conflicts' with libev

see #58733

Great problem and conflict here because of your change – libevent is not able to update:

$ sudo port selfupdate; sudo port -u upgrade outdated
Password:
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.5.4 installed,
MacPorts base version 2.5.4 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
--->  Computing dependencies for libevent
Error: Can't install libevent because conflicting ports are active: libev
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
$ sudo port installed
The following ports are currently installed:
[…]
libev @4.27_0 (active)
libevent @2.1.8_0 (active)
[…]
$ sudo port upgrade libevent
--->  Computing dependencies for libevent
Error: Can't install libevent because conflicting ports are active: libev
Error: Follow https://guide.macports.org/#project.tickets to report a bug.

As a trial:

$ sudo port upgrade libev
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.
Last edited 4 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:7 in reply to:  5 Changed 5 years ago by sierkb (Sierk Bornemann)

Replying to fracai:

Is there a way to get back the original non-conflicting behavior?

+1

comment:8 Changed 5 years ago by mf2k (Frank Schima)

Port: libevent added

comment:9 Changed 5 years ago by mf2k (Frank Schima)

I'm seeing this too. Both ports should be installable at the same time.

comment:10 Changed 5 years ago by jerryyhom

So what is the recommended action?

I can easily remove the conflicts line in libevent. For this ticket, should libev use subport? What about using file dependencies for the common libs?

comment:11 Changed 5 years ago by ewenmcneill (Ewen McNeill)

Apparently I'm not the only one who has ended up with libev and libevent both installed as dependencies (of lighttpd and tmux respectively) :-(

The original requesters suggestion of putting the one conflicting file in its own package which is optional (install for compatibility), and having just that compatibility package conflict with libevent seems much less disruptive than just making libev and libevent conflict with each other to avoid renaming a file (in a way that it has been renamed in MacPorts for years).

Alternatively, if libev and libevent are intended to somewhat interchangable, perhaps it'd be plausible to convert one of tmux and/or lighttpd to use the same library? (But that sounds like more work than just reducing the scope of the conflict to a manageable size.)

Ewen

ewen@ashram:~$ port installed | egrep '(lib(ev|event)|tmux |lighttpd).*active'
  libev @4.27_0 (active)
  libevent @2.1.8_0 (active)
  lighttpd @1.4.54_0+ssl (active)
  tmux @2.9a_0 (active)
ewen@ashram:~$ port outdated | grep libev
libevent                       2.1.8_0 < 2.1.10_0        
ewen@ashram:~$ 
Last edited 4 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:12 Changed 5 years ago by ahrex

nghttp2 depends on both of libevent and libev, which presents a problem since it can never be upgraded.

I filed #58765 to track that issue.

comment:13 Changed 5 years ago by sierkb (Sierk Bornemann)

Cc: sierkb added

comment:14 Changed 5 years ago by jerryyhom

In 1d097fb8f30af2e9841d8a6585f601bebe3467b8/macports-ports (master):

libevent: remove 'conflicts' with libev

At least one port, nghttp2, depends on both libevent and libev.

See #58733

comment:15 Changed 5 years ago by fracai

Cc: fracai added

comment:16 Changed 5 years ago by ahrex

Cc: ahrex added

comment:17 Changed 5 years ago by Schamschula (Marius Schamschula)

Cc: Schamschula added

comment:18 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added

comment:19 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In 09a2f42630e103efd925acf87a759576da225dba/macports-ports (master):

libev: Move event.h compat header to a subport

Closes: #58733

Note: See TracTickets for help on using tickets.