Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A build results in formatting error #887

Open
mborisyak opened this issue Nov 19, 2024 · 3 comments · May be fixed by #888 or #889
Open

A build results in formatting error #887

mborisyak opened this issue Nov 19, 2024 · 3 comments · May be fixed by #888 or #889

Comments

@mborisyak
Copy link

Dear alibuild developers,

I was using aliBuild for compiling FairShip and encountered the following error:

$ aliBuild build FairShip --config-dir shipdist/ --defaults release --always-prefer-system
Traceback (most recent call last):
  File "/home/max/opt/pyenv/versions/py3/bin/aliBuild", line 130, in <module>
    doMain(args, parser)
  File "/home/max/opt/pyenv/versions/py3/bin/aliBuild", line 83, in doMain
    doBuild(args, parser)
  File "/home/max/opt/pyenv/versions/3.10.4/envs/py3/lib/python3.10/site-packages/alibuild_helpers/build.py", line 490, in doBuild
    getPackageList(packages                = packages,
  File "/home/max/opt/pyenv/versions/3.10.4/envs/py3/lib/python3.10/site-packages/alibuild_helpers/utilities.py", line 469, in getPackageList
    requested_version = resolve_version(spec, defaults, "unavailable", "unavailable")
  File "/home/max/opt/pyenv/versions/3.10.4/envs/py3/lib/python3.10/site-packages/alibuild_helpers/utilities.py", line 126, in resolve_version
    return spec["version"] % {
TypeError: unsupported operand type(s) for %: 'float' and 'dict'

The error was provoked by the following dependency:

package: termcap
version: 1.0

It seems like the version was parsed as float.

Forcing str in alibuild_helpers/utilities.py:126 does solve the problem:

return str(spec['version']) % {
  ...
}

however, I'm not sure if it is the right way to fix the issue.

Sincerely,
Maxim.

@singiamtel
Copy link
Collaborator

Hi Maxim, thanks for the bug report.

Could you share your version of aliBuild aliBuild version and alidist (cd alidist && git log -1)?

I believe this error should've been fixed by alisw/alidist@9d9fb8bc6, which happened a while ago

@singiamtel
Copy link
Collaborator

I'm just realizing now that you're using shipdist, not alidist, apologies. I agree that version: 1.0 should be valid recipe syntax and therefore this is a bug.

I'll open a PR with your patch, thanks for your help!

@mborisyak
Copy link
Author

Thank you!
An alternative would be to raise an error, but you are right --- converting the version into a string is easier and more intuitive.

mborisyak pushed a commit to mborisyak/alibuild that referenced this issue Nov 21, 2024
mborisyak pushed a commit to mborisyak/alibuild that referenced this issue Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants