Bug 210291 - editors/emacs-devel: remove broken options, fix dependency/linker issues, remove pkgconfig
Summary: editors/emacs-devel: remove broken options, fix dependency/linker issues, rem...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Ashish SHUKLA
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-06-15 03:46 UTC by Joseph Mingrone
Modified: 2016-06-27 10:52 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (ashish)


Attachments
svn diff for editors/emacs-devel (5.33 KB, patch)
2016-06-15 03:46 UTC, Joseph Mingrone
no flags Details | Diff
new svn diff for editors/emacs-devel (5.28 KB, patch)
2016-06-16 06:41 UTC, Joseph Mingrone
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Mingrone freebsd_committer freebsd_triage 2016-06-15 03:46:01 UTC
Created attachment 171449 [details]
svn diff for editors/emacs-devel

- Remove the CAIRO and LTO options because they break the build.
- Remove USES=pkgconfig because there are no .pc files in the Emacs tree.
- Add new notes in the options menu about options that imply other options.
- Enable LLDB support for GUD by default. 
- Add missing dependencies.  Some libraries are dynamically linked that are not explicitly depended on.  For example, stage-qa catches these for the default options.

Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libcairo.so.2 from graphics/cairo but it is not declared as a dependency
Warning: you need USE_GNOME+=cairo
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libfontconfig.so.1 from x11-fonts/fontconfig but it is not declared as a dependency
Warning: you need LIB_DEPENDS+=libfontconfig.so:x11-fonts/fontconfig
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libintl.so.8 from devel/gettext-runtime but it is not declared as a dependency
Warning: you need USES+=gettext
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libSM.so.6 from x11/libSM but it is not declared as a dependency
Warning: you need USE_XORG+=sm
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libICE.so.6 from x11/libICE but it is not declared as a dependency
Warning: you need USE_XORG+=ice
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libxcb.so.1 from x11/libxcb but it is not declared as a dependency
Warning: you need USE_XORG+=xcb
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libXrender.so.1 from x11/libXrender but it is not declared as a dependency
Warning: you need USE_XORG+=xrender
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libXrandr.so.2 from x11/libXrandr but it is not declared as a dependency
Warning: you need USE_XORG+=xrandr
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libXinerama.so.1 from x11/libXinerama but it is not declared as a dependency
Warning: you need USE_XORG+=xinerama
Error: /usr/local/bin/emacs-25.0.95 is linked to /usr/local/lib/libXfixes.so.3 from x11/libXfixes but it is not declared as a dependency
Warning: you need USE_XORG+=xfixes


portlint: Suggests adding an option for NLS, but configuring with --disable-nls still causes libintl.so to be linked when any of the GTK2, GTK3, or SVG options are on.  Otherwise no warnings or errors.

testport: OK (poudriere: 9.3-RELEASE-p36, i386,  default options) [1]
testport: OK (poudriere: 9.3-RELEASE-p30, amd64, default options) [2]
testport: OK (poudriere: 10.3-RELEASE,    i386,  default options) [3]
testport: OK (poudriere: 10.3-RELEASE,    amd64, default options / several other combinations) [4]

[1]
http://pkg.awarnach.mathstat.dal.ca/data/9i386-default/2016-06-15_00h29m52s/logs/emacs-devel-25.0.95_1,2.log

[2]
http://pkg.awarnach.mathstat.dal.ca/data/9amd64-default/2016-06-15_00h29m55s/logs/emacs-devel-25.0.95_1,2.log

[3]
http://pkg.awarnach.mathstat.dal.ca/data/10i386-default/2016-06-15_00h29m58s/logs/emacs-devel-25.0.95_1,2.log

[4]
http://pkg.awarnach.mathstat.dal.ca/data/10amd64-default/2016-06-15_00h30m00s/logs/emacs-devel-25.0.95_1,2.log
Comment 1 Ashish SHUKLA freebsd_committer freebsd_triage 2016-06-15 05:16:04 UTC
Hi,

Thanks for identifying the issues. At first glance, I have few concerns:

> - Remove the CAIRO and LTO options because they break the build.

I build with CAIRO option on my 10.3 (amd64), and it didn't break build for me. I can check it on 9.x and 10.3 (i386) well.

LTO, I didn't really test since quite some time. I can test it as well, and if it doesn't work as advertised, then I can mark the option as broken.

> - Remove USES=pkgconfig because there are no .pc files in the Emacs tree.

There are no .pc files, although it uses pkg-config in configure, so need it as build-time dependency.

> - Add new notes in the options menu about options that imply other options.

Sounds good, I'll review this in detail, and get back to you.

> - Enable LLDB support for GUD by default.

LLDB support is not present in Emacs by default (afaik), so I'll prefer to stay close to upstream (in default build), and let user use their freedom to install LLDB support, if they need/desire it.

> - Add missing dependencies.  Some libraries are dynamically linked that are not explicitly depended on.  For example, stage-qa catches these for the default options.

Those are not direct dependencies. e.g. taking libxcb. Emacs doesn't directly use libxcb, but rather through libX11, gtk+. So, while emacs is not directly dependent on libxcb, but if we decide to delete libxcb, emacs-devel will also be listed as dependency preventing it from being deleted.

If there are some direct dependencies, I will be fine with adding them. I will review the output and get back to you.

Thanks!
Comment 2 Joseph Mingrone freebsd_committer freebsd_triage 2016-06-15 11:47:20 UTC
> I build with CAIRO option on my 10.3 (amd64), and it didn't break build for me.
> I can check it on 9.x and 10.3 (i386) well.

Building with the cairo option on broke the build in a 10.3 AMD64
poudriere jail for me.  Maybe there is some interaction with
other options?

> LTO, I didn't really test since quite some time. I can test it as well, and if
> it doesn't work as advertised, then I can mark the option as broken.

Sounds good.

>> - Remove USES=pkgconfig because there are no .pc files in the Emacs tree.

> There are no .pc files, although it uses pkg-config in configure, so need it as
> build-time dependency.

I tested removing this when I was looking at the dynamic linking
and dependency stuff, because some of the Gnome libraries add a
lot of implicit dependencies via pkg-config as noted in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=209813.  When
the builds didn't change without pkgconfig and I didn't see any
*.pc I thought it may not be necessary, but I'm not familiar
enough with pkg-config to say anything else.

>> - Enable LLDB support for GUD by default.

> LLDB support is not present in Emacs by default (afaik), so I'll prefer to stay
> close to upstream (in default build), and let user use their freedom to install
> LLDB support, if they need/desire it.

Sounds reasonable.

>> - Add missing dependencies.  Some libraries are dynamically linked that are not explicitly depended on.  For example, stage-qa catches these for the default options.

> Those are not direct dependencies. e.g. taking libxcb. Emacs doesn't directly
> use libxcb, but rather through libX11, gtk+. So, while emacs is not directly
> dependent on libxcb, but if we decide to delete libxcb, emacs-devel will also
> be listed as dependency preventing it from being deleted.

> If there are some direct dependencies, I will be fine with adding them. I will
> review the output and get back to you.

Makes sense.

% ldd /usr/local/bin/emacs | grep -i xcb
libX11-xcb.so.1 => /usr/local/lib/libX11-xcb.so.1 (0x8025ce000)

Do you foresee problems when the user deletes libxcb?

Thanks.
Comment 3 Joseph Mingrone freebsd_committer freebsd_triage 2016-06-15 12:05:51 UTC
A better example.

% ldd /usr/local/bin/emacs | grep -i xcb
libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x8027cf000)

This impetus for this was https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195203.
Comment 4 Joseph Mingrone freebsd_committer freebsd_triage 2016-06-16 06:41:00 UTC
Created attachment 171473 [details]
new svn diff for editors/emacs-devel

Hi Ashish,

This new diff addresses some of your concerns.

1. Fix the issue with the CAIRO option.  In order to configure and build successfully with CAIRO on, the options MAGICK, PNG, X11, and XFT all need to be on.  So, make those implied options for CAIRO.

2. LTO now works with clang (experimental).  When I took out LTO_USE=GCC=4.6+ and selected LTO, the build was successful 10amd64.  However, based on the configure --help note you may consider removing this option.

"This requires GCC 4.5.0 or later, or clang. (Note that clang
support is experimental - see INSTALL.) It also makes Emacs
harder to debug, and when we tried it with GCC 4.9.0 x86-64 it
made Emacs slower, so it's not recommended for typical use."

3. Don't force the user to choose an X11 toolkit, even when the X11 option is chosen.  I built and tested this and it works fine.

I left the new dependencies for you to do as you feel is best.  I think they may be justified based on what ldd/stage-qa says.

I re-ran poudriere with the default options (and several other combinations of options).

portlint: Suggests adding an option for NLS, but configuring with --disable-nls still causes libintl.so to be linked when any of the GTK2, GTK3, or SVG options are on.  Otherwise no warnings or errors.

testport: OK (poudriere: 9.3-RELEASE-p36, i386,  default options) [1]
testport: OK (poudriere: 9.3-RELEASE-p30, amd64, default options) [2]
testport: OK (poudriere: 10.3-RELEASE,    i386,  default options) [3]
testport: OK (poudriere: 10.3-RELEASE,    amd64, default options / several other combinations) [4]

[1]
http://pkg.awarnach.mathstat.dal.ca/data/9i386-default/2016-06-16_02h55m52s/logs/emacs-devel-25.0.95_1,2.log

[2]
http://pkg.awarnach.mathstat.dal.ca/data/9amd64-default/2016-06-16_02h55m58s/logs/emacs-devel-25.0.95_1,2.log

[3]
http://pkg.awarnach.mathstat.dal.ca/data/10i386-default/2016-06-16_02h56m06s/logs/emacs-devel-25.0.95_1,2.log

[4]
http://pkg.awarnach.mathstat.dal.ca/data/10amd64-default/2016-06-16_02h56m14s/logs/emacs-devel-25.0.95_1,2.log
Comment 5 commit-hook freebsd_committer freebsd_triage 2016-06-27 10:49:29 UTC
A commit references this bug:

Author: ashish
Date: Mon Jun 27 10:49:15 UTC 2016
New revision: 417649
URL: https://svnweb.freebsd.org/changeset/ports/417649

Log:
  - Add *_IMPLIES for various options to track implicitly enabled OPTIONS
  - Update options descriptions to reflect *_IMPLIES
  - Add missing implicit dependencies
  - Comment LTO experimental option

  PR:		210291
  Submitted by:	Joseph Mingrone <jrm@ftfl.ca>

Changes:
  head/editors/emacs-devel/Makefile
Comment 6 Ashish SHUKLA freebsd_committer freebsd_triage 2016-06-27 10:52:10 UTC
Hi,

I have committed the diff with some additional *_IMPLIES changes to reflect following:

 - librsvg depends on png
 - cairo only depends on png, and libXft

Thanks!