-
Notifications
You must be signed in to change notification settings - Fork 423
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
mason search
broken
#24495
Comments
this happens in proc init(str:string) {
const s : [1..3] string = str.split(".");
assert(s.size == 3);
major = s[1]:int;
minor = s[2]:int;
bug = s[3]:int;
} the error is returned because
the incriminating string is the last one Note also that the next assert is not needed, because the previous line will work iff proc init(str:string) {
const s = str.split(".");
assert(isArray(s) && s.size == 3, "Invalid version " + str);
major = s[0]:int;
minor = s[1]:int;
bug = s[2]:int;
} this would give a more informative error message if one tries to construct an invalid version, but does not solve the problem, since we want I suspect the last edit: alternatively, one could use semver's recommended regex to check validity and extract elements |
implementing my suggestion does indeed confirm what I was thinking
but I am still unsure where the |
@lucaferranti : Answering your last question, would |
figured out the issue! The incriminating package in the mason registry is Codecs because for that one the file is called const end = manifest.size - suffix.size;
const ver = new VersionInfo(manifest[0..<end]);
if ver > ret then ret = ver; where A quick fix is to patch the toml file name for codecs. However in general I think |
I have merged chapel-lang/mason-registry#70, which should resolve the broken search feature. @lucaferranti, if you'd like to file a PR to update the |
@arezaii / @lucaferranti : Checking in to see what it would take to close this issue. Is the init improvement required, or just a nice failsafe? (sounds like the latter to me). Do either of you want to take that up, or should we just close this? Thanks. |
Yes, the init change I suggested above would make the error message more informative but not fix the issue if an incorrectly named file occurs. I think this can be closed for now, I can open a PR with the slight improvement in the init handling later this week |
both in 1.33 and on main
The text was updated successfully, but these errors were encountered: