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

Prevent crash when min. is higher than max. in expected range #14

Merged
merged 1 commit into from
Nov 25, 2023
Merged

Prevent crash when min. is higher than max. in expected range #14

merged 1 commit into from
Nov 25, 2023

Conversation

kivra-pauoli
Copy link
Contributor

The project I used geas on reports, in its analysis

   R15                   26.1       Geas database                      2.7.14
---Min--------Arch-------Max----------------------------------------------------
   17.0                  20.3       parse_trans                         3.3.1

and geas_api.hrl's compat/2 will eventually calculate:

  • MinGlob as 25.0 (because I'm using lists:uniq/1, for example)
  • MaxGlob as 20.3 (because of the above)
    • MaxGlob is the lowest version among the highest calculated (as per the current code)

This, in turn, means (using the default geas options), geas_semver:l2s/1 will throw because of a call to hd in geas_semver:seq2range/1.


This pr aims at preventing this by considering it is possible/valid to have such an output as the one first shown, though it shouldn't affect the application's behaviour by crashing.

At the same time we throw(5), which results in

===> The release window does not match the required SemVer version frame

which seems appropriate in this case (we also do a minor tweak on the error message).

Further considerations

Mind you the output for T : will not be followed by any text, but this might be undesirable. Lemme know and I can adapt the pr.

@kivra-pauoli
Copy link
Contributor Author

Otoh, as a side note, I'm not sure why parse_trans is reported to have max. 20.3 (maybe it's the version I'm using) since according to its CI, at least, it's supposed to be 26-ready 👍

@crownedgrouse
Copy link
Owner

Can you share the output below table regarding parse_trans ?, geas should tell what are the offending functions limiting to 20.3.
I need to check if there is an issue, first, in window computing, before treating this PR.

@crownedgrouse
Copy link
Owner

BTW parse_trans project is currently at version 3.4.2 and your one is 3.3.1 . So there is maybe no issue there, but it is better to check.

@kivra-pauoli
Copy link
Contributor Author

This is the detail:

./_build/default/lib/parse_trans/ebin/ct_expand.beam
17.0      maps:to_list/1

./_build/default/lib/parse_trans/ebin/parse_trans.beam
20.3      lib:format_exception/6

This is the summary:

   R15                   26.1       Geas database                      2.7.14
---Min--------Arch-------Max----------------------------------------------------
snip
   17.0                  20.3       parse_trans                         3.3.1
snip
--------------------------------------------------------------------------------
   25.0                  20.3       Global project                      local

I think that lib function is gone, thus the report.

I'm Ok with keeping parse_trans at the current version, because my project is working (and that's the goal in using it, to understand if something will break). But I would like to see geas improved so that this doesn't cause a crash.

@crownedgrouse
Copy link
Owner

I do confirm that lib module vanished in 21.0 so geas check is ok.

@crownedgrouse crownedgrouse merged commit f3ad588 into crownedgrouse:master Nov 25, 2023
1 check passed
@crownedgrouse
Copy link
Owner

thanks for contribution.

@kivra-pauoli kivra-pauoli deleted the fix/crash-on-minglob-higher-than-maxglob branch December 5, 2023 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants