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

-Apropfiles separates file paths by colon, which prevents absolute paths on Windows #5273

Closed
neilccbrown opened this issue Aug 30, 2022 · 2 comments · Fixed by #5274
Closed

Comments

@neilccbrown
Copy link
Contributor

neilccbrown commented Aug 30, 2022

The documentation for the property file checker (and by extension, the I18n checker and the compiler message checker) in section 16.1 of the manual states:

Multiple files are separated by colons ’:’.

There seems to be no particular technical reason for this being colon on all operating systems besides an oversight in assuming it works on all of them. However, on Windows this prevents the use of absolute paths for property files. So if you pass:

-Apropfiles=C:\mydir\myprops.props:C:\mydir\myprops2.props

Then this is parsed as four files, the first and third being named "C". This is annoying with some build tools as making a relative path is not always easy (or even possible, should the properties live on another drive).

I think the obvious solution is to change the separator on Windows to be a semi-colon (or more generally, to be Java's File.pathSeparator). This does generate a backward incompatibility for users who are on Windows and use colons already (presumably with relative paths) with Apropfiles. However I think (a) this is still the right solution and (b) I can't see a way round this without instead introducing an extra property to specify the path separator, which seems overkill when the convention is already clear and justified on each OS (colon on Linux, semicolon on Windows).

(I'm happy to make the merge request if you agree on my solution of using File.pathSeparator on all OSes and updating the manual to match.)

@mernst
Copy link
Member

mernst commented Aug 30, 2022

I agree with your suggestion of using File.pathSeparator. If you are willing to make the pull request, we would definitely appreciate it.

(Note: there will be a Checker Framework release in 2 days. Maybe we can get this merged by then, because it seems simple. But there is no pressure on you to meet that deadline, if it is not convenient for you.)

Thanks!

neilccbrown added a commit to neilccbrown/checker-framework that referenced this issue Aug 30, 2022
…es, the internationalization checker and the compiler message checker) to use File.pathSeparator to separate property file paths, rather than ':' (as that prevented use of absolute paths like C:\myfile.props on Windows). Updated all the documentation and usages to match.

Fixes typetools#5273
@mernst
Copy link
Member

mernst commented Aug 31, 2022

Thanks again for this improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants