Bug 254751 - devel/e2fsprogs-libss: fails to build with /bin/sh: compile_et: not found
Summary: devel/e2fsprogs-libss: fails to build with /bin/sh: compile_et: not found
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Matthias Andree
URL:
Keywords:
: 261217 (view as bug list)
Depends on:
Blocks: 261217
  Show dependency treegraph
 
Reported: 2021-04-03 22:08 UTC by Felix Palmen
Modified: 2022-01-28 03:29 UTC (History)
7 users (show)

See Also:
mandree: maintainer-feedback-


Attachments
poudriere build log (28.90 KB, text/plain)
2021-04-03 22:08 UTC, Felix Palmen
no flags Details
workaround for build error (668 bytes, patch)
2021-04-03 22:12 UTC, Felix Palmen
no flags Details | Diff
Add option for kerberos support from MIT krb5 (1.16 KB, patch)
2021-04-27 13:35 UTC, Felix Palmen
felix: maintainer-approval? (bjk)
Details | Diff
use local compile_et in build (526 bytes, patch)
2021-06-03 14:58 UTC, Matthias Andree
mandree: maintainer-approval? (kaduk-fbsd)
Details | Diff
patch to build and use local libcom_err.a and steal maintainership from Ben Kaduk (1.87 KB, patch)
2022-01-16 12:15 UTC, Matthias Andree
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Palmen 2021-04-03 22:08:05 UTC
Created attachment 223795 [details]
poudriere build log

FreeBSD 13.0-RC5, building with poudriere for i386, building fails with this:

===>  Building for e2fsprogs-libss-1.46.2
(cd /wrkdirs/usr/ports/devel/e2fsprogs-libss/work/e2fsprogs-1.46.2/lib/ss && compile_et ss_err.et &&  /usr/bin/sed -i.bak -f /usr/ports/devel/e2fsprogs-libss/files/fix-ss_err.h.sed ss_err.h)
/bin/sh: compile_et: not found
*** Error code 127

Full poudriere log attached.

Trying to fix this myself, I found I can build and use compile_et from inside the source tree itself, which leads to the next problem: libcom_err is required.

This is part of e2fsprogs package, which *depends* on e2fsprogs-libss.
Comment 1 Felix Palmen 2021-04-03 22:12:18 UTC
Created attachment 223796 [details]
workaround for build error

I made it build successfully with this patch, but I think it's the wrong thing to do. libcom_err.so will still be installed by e2fsprogs and yet be linked here…
Comment 2 Benjamin Kaduk freebsd_committer 2021-04-25 03:14:13 UTC
Thanks for the report.
The compile_et that I was expecting to be used is /usr/bin/compile_et, which is only built conditionally on MK_KERBEROS_SUPPORT.
Since January 2020 (0ce9d0af5b7fdfde335c753cb3310650a9d31d09) MK_KERBEROS_SUPPORT is forced off when KERBEROS itself is off, so if you are disabling either in your environment then this behavior for the port build is unsurprising.

I will take a look at what the best option is; it may well just be marking the port as not usable when /usr/bin/compile_et is not available.
Comment 3 Felix Palmen 2021-04-25 11:34:05 UTC
Aha! Thanks for the pointer.
I had no idea compile_et is related to kerberos. Indeed, I build my base without kerberos and use MIT krb5 from ports. Will have a look whether compile_et is provided there…

Would this also solve the other problem I came across (circular dependency around libcom_err)? Or did I misunderstand something there?
Comment 4 Benjamin Kaduk freebsd_committer 2021-04-25 20:11:56 UTC
(In reply to Felix Palmen from comment #3)

> I had no idea compile_et is related to kerberos. Indeed, I build my base without kerberos and use MIT krb5 from ports. Will have a look whether compile_et is provided there…

MIT krb5 does have a compile_et script in its build (bourne shell and awk), and it's in the pkg-plist for the FreeBSD port, so I think it should be suitable for this purpose.

> Would this also solve the other problem I came across (circular dependency around libcom_err)? Or did I misunderstand something there?

I think so -- despite the name being for a "common error-reporting library", there are quite a number of libcom_err implementations around, including from the major kerberos implementations.
Comment 5 Felix Palmen 2021-04-27 13:35:53 UTC
Created attachment 224472 [details]
Add option for kerberos support from MIT krb5

Ok, this enabled me to have a better solution for my usecase. I tried to support heimdal from ports as well, but unfortunately, this doesn't install compile_et. Another option would be to also support the in-tree tools, but this would require more change, because right now, the included libcom_err is installed with sysutils/e2fsprogs, so this would create the circular dependency again…
Comment 6 Matthias Andree freebsd_committer 2021-06-03 14:58:07 UTC
Created attachment 225529 [details]
use local compile_et in build

If it's solely about building the e2fsprogs-libss port, we might leverage the shipped lib/et/compile_et, as proposed in this patch.

This would require tests of its users and a PORTREVISION bump if applied, which my patch does not currently do.
Comment 7 Matthias Andree freebsd_committer 2021-12-14 22:48:14 UTC
claiming bug after maintainer timeout
Comment 8 commit-hook freebsd_committer 2021-12-15 00:27:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8e6ae6036714dc541ce5b31aad23bf568e422710

commit 8e6ae6036714dc541ce5b31aad23bf568e422710
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2021-12-14 23:03:20 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2021-12-15 00:26:28 +0000

    devel/e2fsprogs-libss: use local compile_et,

    in order to avoid build failures when Kerberos support is missing.

    PR:             254751
    Reported by:    Felix Palmen
    Approved by:    maintainer timeout (kaduk-fbsd@mit.edu, 6 months)

 devel/e2fsprogs-libss/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
Comment 9 Matthias Andree freebsd_committer 2021-12-15 00:28:04 UTC
maintainer timeout 6 months
Comment 10 Felix Palmen 2022-01-16 10:34:57 UTC
Sorry for the late response. I didn't build that package for a while...

This fix unfortunately isn't complete, you will get a linker error later, trying to link libcom_err:

----
(cd elfshared; cc -o libss.so.2.0 \
	-L../../../lib  -pthread  -fstack-protector-strong  -fPIC -shared \
	-Wl,-soname,libss.so.2 ss_err.o std_rqs.o invocation.o help.o execute_cmd.o listen.o parse.o error.o prompt.o request_tbl.o list_rqs.o pager.o requests.o data.o get_readline.o -lcom_err -ldl)
ld: error: unable to find library -lcom_err
cc: error: linker command failed with exit code 1 (use -v to see invocation)
----

I think if you don't use base kerberos, this lib should be linked from the package providing kerberos as well. Of course, you will only see the error when your base was built without kerberos.
Comment 11 Matthias Andree freebsd_committer 2022-01-16 12:15:01 UTC
Created attachment 231038 [details]
patch to build and use local libcom_err.a and steal maintainership from Ben Kaduk

(In reply to Felix Palmen from comment #10)
Thanks for the test, reopening.

I am proposing a patch, Felix, please test if that works for you, then I can rebase and push it to the FreeBSD repo.
Comment 12 Matthias Andree freebsd_committer 2022-01-16 12:20:59 UTC
Since Ben Kaduk is MIA and I haven't seen any mail from him in many months, we've had a previous maintainer timeout, I am claiming the port maintainership and adding Cc: portmgr. Rationale inside https://bugs.freebsd.org/bugzilla/attachment.cgi?id=231038&action=diff
Comment 13 Matthias Andree freebsd_committer 2022-01-16 23:19:54 UTC
sorry, this is the right link: https://bz-attachments.freebsd.org/attachment.cgi?id=231038
Comment 14 Felix Palmen 2022-01-17 06:14:15 UTC
(In reply to Matthias Andree from comment #11)
> patch to build and use local libcom_err.a
This builds fine, thanks! Still a bit weird to statically link exactly the same library that e2fsprogs will install as a shared lib :o but that's probably the cleanest solution if this must be a separate port :)
Comment 15 Fernando Apesteguía freebsd_committer 2022-01-17 08:00:42 UTC
Hi mandree@ the last patch was never committed, is there anything preventing us from doing it?
Comment 16 Matthias Andree freebsd_committer 2022-01-17 19:31:39 UTC
fernape@ it's not mature yet, let us fix things first.

Felix is right that it is strange to link libcom_err statically when we could instead depend on sysutils/e2fsprogs's libcom_err.
Comment 17 Matthias Andree freebsd_committer 2022-01-17 19:42:30 UTC
(In reply to Fernando Apesteguía from comment #15)

why are you saying the previous patch was not committed?

https://cgit.freebsd.org/ports/commit/?id=8e6ae6036714dc541ce5b31aad23bf568e422710
Comment 18 Matthias Andree freebsd_committer 2022-01-17 20:58:05 UTC
This is a bit messy, because digging deeper, we find a dependency cycle.

1. e2fsprogs-libss installs a header ss_err.h that depends on et/libcom_err.h - which gets installed by e2fsprogs.
2. e2fsprogs depends on libss e2fsprogs-libss itself.

One way of breaking the cycle at link-time is the static link. But ss_err.h would still be unable to #include <et/com_err.h> at run-time unless e2fsprogs is installed and in the -I path. So no good solution.

Another way might be splitting out the local com_err out of e2fsprogs into a separate port that e2fsprogs-libss and e2fsprogs could depend on.  That would add one more port.

A third way is reintegrating libss with e2fsprogs, because there are no other ports that require e2fsprogs-libss. So let's go that way.
Comment 19 Matthias Andree freebsd_committer 2022-01-17 21:26:11 UTC
*** Bug 261217 has been marked as a duplicate of this bug. ***
Comment 20 commit-hook freebsd_committer 2022-01-17 22:18:48 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=29b349b2dba2a188140cb73fe451a9b9793178d4

commit 29b349b2dba2a188140cb73fe451a9b9793178d4
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2022-01-16 12:09:14 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2022-01-17 22:17:48 +0000

    devel/e2fsprogs-libss: merge to sysutils/e2fsprogs

    This is to break dependency cycles between e2fsprogs-libss and
    e2fsprogs (see 254751 comment #18 for details), and to avoid creating
    yet another split-out port, then for e2fsprogs's libcom_err.

    Bump PORTREVISION of the four e2fsprogs consumers to flush out
    their e2fsprogs-libss dependency records.

    PR:             254751
    Reported by:    Felix Palmen
    PR:             261217
    Reported by:    tech-lists@zyxst.net
    Fixes:          8e6ae60 devel/e2fsprogs-libss: use local compile_et...

    Approved by:    prior maintainer timeout (Ben Kaduk, 7 months) on 254751

 MOVED                                              |  1 +
 devel/Makefile                                     |  1 -
 devel/e2fsprogs-libss/Makefile (gone)              | 33 ----------------------
 devel/e2fsprogs-libss/pkg-descr (gone)             |  5 ----
 devel/e2fsprogs-libss/pkg-plist (gone)             | 11 --------
 sysutils/e2fsprogs/Makefile                        |  7 +++--
 .../e2fsprogs}/files/fix-ss_err.h.sed              |  0
 sysutils/e2fsprogs/files/unwanted                  | 13 ---------
 sysutils/e2fsprogs/pkg-plist                       | 13 +++++++++
 sysutils/e2tools/Makefile                          |  2 +-
 sysutils/fusefs-ext2/Makefile                      |  2 +-
 sysutils/unetbootin/Makefile                       |  1 +
 sysutils/vzvol/Makefile                            |  2 +-
 13 files changed, 22 insertions(+), 69 deletions(-)
Comment 21 Matthias Andree freebsd_committer 2022-01-17 22:22:20 UTC
This commit should fix both PRs, by reintegrating e2fsprogs-libss and its various build hacks back into e2fsprogs, and should be robust against systems without Kerberos in base. 

Felix and tech-lists@, please test, and if it still does not work, holler.
Comment 22 tech-lists 2022-01-17 23:27:51 UTC
(In reply to Matthias Andree from comment #21)

Hi, confirm it's fixed, many thanks!
Comment 23 Fernando Apesteguía freebsd_committer 2022-01-18 06:16:22 UTC
(In reply to Matthias Andree from comment #17)
Hi Matthias,

Thanks for fixing this. I was referring to the second patch. The one in which you take maintainership (https://bz-attachments.freebsd.org/attachment.cgi?id=231038).

Cheers.
Comment 24 Felix Palmen 2022-01-18 08:44:50 UTC
Thanks, that looks like the sanest solution! :)

Unfortunately, it causes a problem that looks to me like a little regression:

pkg-static: krb5-1.19.2 conflicts with e2fsprogs-1.46.4_2 (installs files into the same place).  Problematic file: /usr/local/man/man3/com_err.3.gz

e2fsprogs didn't install that manpage before (but DID install the shared lib), I can only assume because of that very conflict with krb5 packages...
Comment 25 commit-hook freebsd_committer 2022-01-18 19:04:37 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cee87a1eefc85598a47f07fed7052b118e2992b1

commit cee87a1eefc85598a47f07fed7052b118e2992b1
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2022-01-18 19:01:55 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2022-01-18 19:03:32 +0000

    sysutils/e2fsprogs: resolve krb5 conflict with man3/com_err.3.gz

    PR:             254751
    Reported by:    Felix Palmen

 sysutils/e2fsprogs/Makefile                            |  6 ++++--
 sysutils/e2fsprogs/files/patch-lib_et_com__err.3 (new) | 11 +++++++++++
 sysutils/e2fsprogs/pkg-plist                           |  2 +-
 3 files changed, 16 insertions(+), 3 deletions(-)
Comment 26 Matthias Andree freebsd_committer 2022-01-18 19:08:14 UTC
(In reply to Fernando Apesteguía from comment #23)
Fernando, yes - it was somehow "incomplete"... that's why I hadn't committed right away.
Comment 27 commit-hook freebsd_committer 2022-01-28 00:12:14 UTC
A commit in branch 2022Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=85c96d2be272fbb91f714b2241d694db90505004

commit 85c96d2be272fbb91f714b2241d694db90505004
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2022-01-18 19:01:55 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2022-01-27 23:55:51 +0000

    sysutils/e2fsprogs: resolve krb5 conflict with man3/com_err.3.gz

    PR:             254751
    Reported by:    Felix Palmen

    (cherry picked from commit cee87a1eefc85598a47f07fed7052b118e2992b1)

 sysutils/e2fsprogs/Makefile                            |  6 ++++--
 sysutils/e2fsprogs/files/patch-lib_et_com__err.3 (new) | 11 +++++++++++
 sysutils/e2fsprogs/pkg-plist                           |  2 +-
 3 files changed, 16 insertions(+), 3 deletions(-)
Comment 28 commit-hook freebsd_committer 2022-01-28 00:12:15 UTC
A commit in branch 2022Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=69d35222fd84c30922c302fb08873d371cea333e

commit 69d35222fd84c30922c302fb08873d371cea333e
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2022-01-16 12:09:14 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2022-01-27 23:55:46 +0000

    devel/e2fsprogs-libss: merge to sysutils/e2fsprogs

    This is to break dependency cycles between e2fsprogs-libss and
    e2fsprogs (see 254751 comment #18 for details), and to avoid creating
    yet another split-out port, then for e2fsprogs's libcom_err.

    Bump PORTREVISION of the four e2fsprogs consumers to flush out
    their e2fsprogs-libss dependency records.

    PR:             254751
    Reported by:    Felix Palmen
    PR:             261217
    Reported by:    tech-lists@zyxst.net
    Fixes:          8e6ae60 devel/e2fsprogs-libss: use local compile_et...

    Approved by:    prior maintainer timeout (Ben Kaduk, 7 months) on 254751

    (cherry picked from commit 29b349b2dba2a188140cb73fe451a9b9793178d4)

 MOVED                                              |  1 +
 devel/Makefile                                     |  1 -
 devel/e2fsprogs-libss/Makefile (gone)              | 33 ----------------------
 devel/e2fsprogs-libss/pkg-descr (gone)             |  5 ----
 devel/e2fsprogs-libss/pkg-plist (gone)             | 11 --------
 sysutils/e2fsprogs/Makefile                        |  7 +++--
 .../e2fsprogs}/files/fix-ss_err.h.sed              |  0
 sysutils/e2fsprogs/files/unwanted                  | 13 ---------
 sysutils/e2fsprogs/pkg-plist                       | 13 +++++++++
 sysutils/e2tools/Makefile                          |  2 +-
 sysutils/fusefs-ext2/Makefile                      |  2 +-
 sysutils/unetbootin/Makefile                       |  1 +
 sysutils/vzvol/Makefile                            |  2 +-
 13 files changed, 22 insertions(+), 69 deletions(-)
Comment 29 Benjamin Kaduk freebsd_committer 2022-01-28 03:29:54 UTC
A very belated comment to say thank you to Matthias and Felix for your efforts, it's much appreciated while I've been preoccupied by other things.