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

Allow arbitrary path lengths in compiler #26357

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

riftEmber
Copy link
Member

@riftEmber riftEmber commented Dec 4, 2024

Removes usages of FILENAME_MAX and other hardcoded buffers for path strings, enabling the use of arbitrarily long file paths.

This PR has the same purpose as #17517, but isn't based off of it as the prior PR was too far behind main.

Resolves #26261 and contributes to #8757.

[reviewer info placeholder]

Testing:

  • no error for >4096 character dependency paths on my mac
  • Ahmad testing out an Arkouda reproducer
  • paratest
  • --no-compiler-driver paratest

@riftEmber riftEmber marked this pull request as draft December 4, 2024 21:04
@riftEmber riftEmber force-pushed the compiler-no-filename-max branch 9 times, most recently from fd59f03 to d6ce41b Compare December 6, 2024 17:20
@riftEmber riftEmber marked this pull request as ready for review December 9, 2024 21:17
@riftEmber riftEmber force-pushed the compiler-no-filename-max branch from d6ce41b to 47b5b9e Compare December 9, 2024 21:17
compiler/codegen/library.cpp Outdated Show resolved Hide resolved
compiler/codegen/library.cpp Outdated Show resolved Hide resolved
compiler/include/library.h Outdated Show resolved Hide resolved
else
printf("''");
break;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely outside the scope of this PR, but it would be nice to change 'S' to use std::string too. Maybe open an issue for refactoring the arg parsing code to use more modern C++?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there something you would want to see change about how it functions, besides the internals? I feel "if it ain't broke" about refactoring it, personally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing specific in terms of the API, I mostly am just tired of dealing with very old C-style C++ code, which is true for much of the compiler

I feel "if it ain't broke" about refactoring it, personally.

I kinda tend to agree, but I think there is an aspect of "leave things better than you found it" too. Definitely not advocating you do anything in this regard for this PR.

compiler/main/arg.cpp Show resolved Hide resolved
compiler/main/driver.cpp Outdated Show resolved Hide resolved
compiler/util/misc.cpp Outdated Show resolved Hide resolved
@riftEmber riftEmber requested a review from jabraham17 December 10, 2024 21:46
compiler/util/stringutil.cpp Outdated Show resolved Hide resolved
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.

[Bug]: long dependency paths can break compiler driver
2 participants