Bug 2269953 - calc is not installable
Summary: calc is not installable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: calc
Version: 40
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Matthew Miller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-03-17 15:04 UTC by rvcsaba
Modified: 2024-04-05 02:36 UTC (History)
2 users (show)

Fixed In Version: calc-2.15.0.6-3.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-04-05 02:36:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description rvcsaba 2024-03-17 15:04:21 UTC
Description of problem:

dnf install calc
Last metadata expiration check: 0:55:57 ago on Sun 17 Mar 2024 01:33:54 PM CET.
Error: 
 Problem: conflicting requests
  - nothing provides libcustcalc.so.2.15.0.2()(64bit) needed by calc-2.15.0.2-3.fc40.x86_64 from fedora
(try to add '--skip-broken' to skip uninstallable packages)


Version-Release number of selected component (if applicable):

calc-2.15.0.2-3.fc40.x86_64


How reproducible:

Install it.


Additional info:

with_custom_interface 0 not working. I rebuilt it latest source from fc41 source package (calc-2.15.0.6) with with_custom_interface 1 build option in spec file, and work it.

Comment 1 barsnick 2024-03-24 20:24:49 UTC
Same here.

The changelog for 2.14.3.4 (https://github.com/lcn2/calc/releases/tag/v2.14.3.4) says

--quote--
We no longer support the Makefile variable ${ALLOW_CUSTOM} to be empty.
Normally ${ALLOW_CUSTOM} is:

ALLOW_CUSTOM= -DCUSTOM

Now, to disable custom disable custom even if -C is given, use:

ALLOW_CUSTOM="-UCUSTOM"
--quote--

So the SPEC files needs to be modified a bit for the disabling/enabling mechanism to work correctly.

Comment 2 barsnick 2024-03-24 20:53:18 UTC
D'uh, sorry. I just noticed that the SPEC file was fixed in a correct manner already in 2.15.0.1:
https://src.fedoraproject.org/rpms/calc/c/28d32989688bd34546a1902d103ae2cf9dc9753b?branch=rawhide

There must be something else which is going wrong.

I see this in my build log:

gcc  -shared "-Wl,-soname,libcalc.so.2.15.0.6" addop.o assocfunc.o blkcpy.o block.o byteswap.o codegen.o comfunc.o commath.o config.o const.o custom.o errtbl.o file.o func.o hash.o help.o hist.o input.o jump.o label.o lib_calc.o lib_util.o listfunc.o matfunc.o math_error.o obj.o opcodes.o pix.o poly.o prime.o qfunc.o qio.o qmath.o qmod.o qtrans.o quickhash.o seed.o sha1.o size.o str.o strl.o symbol.o token.o value.o version.o zfunc.o zio.o zmath.o zmod.o zmul.o zprime.o zrand.o zrandom.o libcustcalc.so.2.15.0.6 \                                                                                                                                                                                                    
      -lreadline  -o libcalc.so.2.15.0.6

This shouldn't be linking against libcustcalc.so.2.15.0.6.

Comment 3 rvcsaba 2024-03-24 20:58:23 UTC
(In reply to barsnick from comment #2)
> There must be something else which is going wrong.

Yes, because:

%if %{with_custom_interface}
     ALLOW_CUSTOM="-DCUSTOM" \
%else
     ALLOW_CUSTOM="-UCUSTOM" \
%endif

Comment 4 rvcsaba 2024-03-24 21:02:18 UTC
%define with_custom_interface 0

Why?

If I use

%define with_custom_interface 1

work it.

Comment 5 barsnick 2024-03-24 21:11:43 UTC
(In reply to rvcsaba from comment #3)
> Yes, because:
> 
> %if %{with_custom_interface}
>      ALLOW_CUSTOM="-DCUSTOM" \
> %else
>      ALLOW_CUSTOM="-UCUSTOM" \
> %endif

That's exactly according to documentation, and properly sets `ALLOW_CUSTOM="-UCUSTOM"`, as I can observe in my logs.

(In reply to rvcsaba from comment #4)
> If I use
> %define with_custom_interface 1
> work it.

Sure, because enabling works fine, but disabling not.

Comment 6 Matthew Miller 2024-03-26 18:56:47 UTC
Thanks for this! I'll look into what went wrong here, and sorry for putting out the bad package. ("Worked on my machine for some reason!")

Comment 7 Fedora Update System 2024-03-27 02:33:53 UTC
FEDORA-2024-916b8e0284 (calc-2.15.0.6-3.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-916b8e0284

Comment 8 barsnick 2024-03-27 10:08:15 UTC
I think I figured it out. "-DCUSTOM"/"-UCUSTOM" has been changed to include/omit certain functionality (and symbols). The library libcustcalc.so is linked unconditionally, and its single symbol, if built with "-UCUSTOM", is required by libcalc.

I'd say the documentation has always been a bit unclear, and the behavior changed recently.
This commit says:
https://github.com/lcn2/calc/commit/4d32b138ed7379263e0b90f6421a17d513859c10
"The libcalc shared library is now linked with libcustcalc.", which is also a bit unclear.

So, in theory, you can configure back to %with_custom_interface 0, and must just unconditionally ship libcustcalc.so.

I now have come to understand that "The custom interface allows for machine dependent and/or non-portable code to be added as built-ins to the calc program." I don't know if there's really any point in disabling it at all.

BTW, I just figured out the hard way (but without building an RPM, just the bare source) that disabling libreadline, as it is done in your SPEC, also needs to be done differently. I needed to add the make variables
USE_READLINE="" READLINE_LIB="" READLINE_EXTRAS=""
Yes, this is very unexpected, and probably worth an upstream bug report. Especially since their Makefile already has a few conditionals checking such stuff.

Thanks for your work and the quick response, BTW!

Comment 9 Matthew Miller 2024-03-27 19:46:01 UTC
> I now have come to understand that "The custom interface allows for machine dependent and/or non-portable code to be added as built-ins to the calc program." I don't know if there's really any point in disabling it at all.

I'm trying to think back 2007 or so when I first packaged this. :) As I remember it, it wasn't so much that it was _bad_ but it seemed pointless, since adding custom code requires recompiling anyway. It's not really like a separate plugin interface or API. (It might also have built as static-only? It was a long time ago.) So there's probably no harm in just leaving it (especially since these functions, theoretically, can't be called unless you give the -C command-line flag.)



I'll check about readline as well -- thanks for that, too!

Comment 10 Fedora Update System 2024-03-28 02:10:43 UTC
FEDORA-2024-916b8e0284 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-916b8e0284`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-916b8e0284

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2024-04-05 02:36:06 UTC
FEDORA-2024-916b8e0284 (calc-2.15.0.6-3.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, 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.