Bug 1563863 - configure libexec directory
Summary: configure libexec directory
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ghc-rpm-macros
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jens Petersen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-04 23:27 UTC by Elliott Sales de Andrade
Modified: 2018-04-27 04:00 UTC (History)
1 user (show)

Fixed In Version: ghc-rpm-macros-1.8.7-5.fc29 ghc-rpm-macros-1.8.7-5.fc28
Clone Of:
Environment:
Last Closed: 2018-04-27 04:00:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Elliott Sales de Andrade 2018-04-04 23:27:27 UTC
With cabal-install 2.0.0, a new scope for executables was added [1]. Private executables are put in a subdirectory of libexec. The default is "$abi/$pkgid" [2].

For example, on x86_64, the result is put in /usr/libexec/x86_64-linux-ghc-8.2.2/pkg_name-pkg_version. The package can own the lower directory, but something should own the ghc one.

The other problem is that I don't know how to generate $abi. I assume 'linux-ghc' is fixed and I can get '8.2.2' from %ghc_version, but I don't know how to get 'x86_64'. I tried to use %{_target}, but that doesn't seem to match what ghc thinks the directory should be on i686 or ppc64le.

Can we have:
a) something to own the libexec subdir (/usr/libexec/x86_64-linux-ghc-8.2.2); and,
b) a macro for this private directory?

[1] https://github.com/haskell/cabal/pull/4501
[2] https://github.com/haskell/cabal/pull/4501/files#diff-83d11080988f2962cf0e63f21d919c1dR208

Comment 1 Elliott Sales de Andrade 2018-04-04 23:45:34 UTC
See this build for an example [1]. I used '%{_arch}-linux-ghc-%{ghc_version}' instead of '%{_target}-ghc-%{ghc_version}' which fixed it on i686.

However, on ppc64le, ghc thinks the directory should be 'powerpc64le-linux-ghc-8.2.2' while the macros give 'ppc64le-linux-ghc-8.2.2'.

Maybe we should pass `--libexecsubdir='$compiler/$pkgkey'` like is done for `libsubdir`?

[1] https://koji.fedoraproject.org/koji/taskinfo?taskID=26173244

Comment 2 Elliott Sales de Andrade 2018-04-05 05:00:30 UTC
So I went with passing `--libexecsubdir='$compiler/$pkgkey'` for cabal-helper, but I'd like to know what we're doing for the future.

Comment 3 Jens Petersen 2018-04-05 07:56:29 UTC
I am not sure which arch/host macro to use, but your approach looks fine to me.

Comment 4 Jens Petersen 2018-04-05 09:36:51 UTC
(You can probably ignore my first cause above.)

I think probably $pkgid would be sufficient for the subdir for now.
Though most dirs in libexec or datadir seem unversioned,
but at least version might avoid any collisions.

I will go with that for now in ghc-rpm-macros.

Can you please test with ghc-rpm-macros-1.8.7-4.fc29 which I built for Rawhide?

Comment 5 Jens Petersen 2018-04-05 10:02:49 UTC
(I didn't add a macro for the libexecdir though but %{_libexecdir}/%{pkgver} should work.)

Comment 6 Jens Petersen 2018-04-05 10:04:59 UTC
In the long term maybe we should change to using the actual base package name
to avoid possible conflicts.

Comment 7 Elliott Sales de Andrade 2018-04-05 23:44:25 UTC
I'm now getting this:

error: Empty %files file /builddir/build/BUILD/cabal-helper-0.8.0.2/ghc-cabal-helper.files
    Empty %files file /builddir/build/BUILD/cabal-helper-0.8.0.2/ghc-cabal-helper.files

Comment 8 Jens Petersen 2018-04-06 09:35:44 UTC
Do you have the build.log?

Comment 9 Elliott Sales de Andrade 2018-04-06 09:41:28 UTC
Anything here: https://koji.fedoraproject.org/koji/taskinfo?taskID=26182937
except warp-tls which shouldn't have been in that build.

Comment 10 Jens Petersen 2018-04-07 13:41:32 UTC
Thanks - sorry about that, my bad: this should be fixed by
eclipseo's PR to ghc-rpm-macros:

https://src.fedoraproject.org/rpms/ghc-rpm-macros/pull-request/1

which I just pushed to Koji

Comment 11 Jens Petersen 2018-04-07 13:51:20 UTC
Looks okay now: https://koji.fedoraproject.org/koji/buildinfo?buildID=1067052
(I built ghc-concurrent-output for you on f29)

Comment 12 Elliott Sales de Andrade 2018-04-10 04:38:46 UTC
Works in what I needed too: https://koji.fedoraproject.org/koji/taskinfo?taskID=26278853

I guess this is also necessary on F28 as well, since that has cabal-install 2?

Comment 13 Jens Petersen 2018-04-10 09:04:23 UTC
Thanks for confirming

Yep, I was meaning to build for f28 - let me do it now.
(I was waiting to add a "fhpkg merge" command but that may take more time.)

Comment 14 Fedora Update System 2018-04-10 09:56:53 UTC
ghc-rpm-macros-1.8.7-5.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-909dde89dc

Comment 15 Fedora Update System 2018-04-10 22:52:00 UTC
ghc-rpm-macros-1.8.7-5.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-909dde89dc

Comment 16 Fedora Update System 2018-04-27 04:00:11 UTC
ghc-rpm-macros-1.8.7-5.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.