-
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
Generate user-facing errors for long filenames #8758
Comments
@bradcray I tried to find this error in the repo files but couldn't find it. Could you give a small idea where it might be/ where I should look? |
Hi @AnubhavUjjawal: Sorry for the slow response. I don't believe we ever filed a test of this in the repo. To reproduce, you'd need to follow the instructions above from a *nix environment (where I'm assuming
As I understand it, the issue is that we strip the Some potential fixes would be to truncate a few more characters from the filename to get within the OS limit (though this could be dangerous if there were other similarly-named files being created?), to try to avoid creating intermediate filenames with longer names, or to have the Chapel compiler complain when using a filename that was long enough that it would cause these kinds of problems. I don't have a strong preference between these options. |
I guess you couldn't create a normal future for this, because the name of the .future file would necessarily be too long... |
I'm definitely open to that approach. |
This comment has been minimized.
This comment has been minimized.
@bradcray I would like to take up this issue. Are there any new insight that you can provide me, what I understood is
|
@king-11 : Moving the error to parse-time matches my thinking. As far as what to use for a limit... This is an area where I'd be inclined to do some research (what limits do most practically used OSes set in practice?) and then set it to something that feels like a conservative choice based on that. As I mentioned on #12770, I don't think there's a strong need to support super-long filenames necessarily... (and/or, we can wait for real users to want it). For me this issue is more about creating a useful error message first and foremost, and then making the limit as large as possible secondarily. (FWIW, I called this a "rainy day project" because I don't think we've ever had a real user bump into it. @cassella tends to be good about focusing on the limits of things, which is why I think this originally came up). You may also want to see #8757 and related PRs which aren't directly related, but maybe somewhat thematically related. |
@bradcray am not much familiar with parsing 😅 that's why took some time. So should the error be thrown in the following parser chapel/compiler/parser/parser.cpp Line 318 in dc4761c
|
Also as the Unicode representation of a character can occupy several bytes, so the maximum number of characters that a file name might contain can vary. A single Unicode character can occupy as much as |
@king-11: I posted some comments on your PR. Sorry again for the delay, it's been a crazy month.
I don't think this should be an issue, as I think the strlen()-style call that you're using in your PR will count the number of bytes in the filename, not the number of logical characters/glyphs/codepoints. Similarly, my guess is that macros like NAME_MAX are specifying a count in terms of bytes, not codepoints. |
On PR #8733, @cassella writes:
As I understand it, this points out that our current Makefiles don't ensure that they always use filenames <= the OS max filename length and could be a problem for users who prefer using truly long filenames. On a rainy day, we could fix this.
[edit: In PR #12770, an initial attempt was made at this, but it seemed to be non-portable based on the back-end compiler used—and more specifically, the lengths of the intermediate filenames it created]
The text was updated successfully, but these errors were encountered: