chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.79k stars 421 forks source link

Mason search fails when bad files names are in the dir #8770

Closed buddha314 closed 5 years ago

buddha314 commented 6 years ago

I made a mistake and created a bad file in my local repository, then

macbuddha:Relch buddha$ mason search
./MasonSearch.chpl:90: error: assert failed

instead of /Users/buddha/.mason/local_registry/Bricks/Cdo/0.1.1.toml I had /Users/buddha/.mason/local_registry/Bricks/Cdo/0.1.1

bradcray commented 6 years ago

OhmygoshBrian!!! This is your chance to join the hallowed ranks of the Chapel CONTRIBUTORS.md file!! All you have to do is go into the filename and line number in question, replace the assert with a better error message, make a PR and boom! You're a permanent part of Chapel history!

(What's that? Oh he hasn't? OK, I'll let him know).

That was the lawyers reminding me that we'd also need you to sign and send in a CCLA.

buddha314 commented 6 years ago

You want me to work for free?

bradcray commented 6 years ago

We'll pay you twice what you're paying us!

buddha314 commented 6 years ago

what an offer!

bradcray commented 6 years ago

Could someone with more insight into mason's design (@ben-albrecht , @psahabu , @benharsh , @daviditen ) comment on what should happen in this case? I'm guessing it should either be a user error (e.g., "Found a file with an unexpected suffix in your mason directories") or ignored rather than an assertion error?

daviditen commented 6 years ago

My intuition is that it should generate a warning and otherwise be ignored.

ben-albrecht commented 6 years ago

👍 to @daviditen - one bad file shouldn't ruin the whole search.

Tshimanga commented 6 years ago

@daviditen is there a formal notion of "warning" in Chapel or are such things handled as conditional writeln calls?

bradcray commented 6 years ago

There is a fairly rudimentary warning call: https://chapel-lang.org/docs/1.16/builtins/internal/ChapelIO.html?highlight=warning#ChapelIO.warning