-
Notifications
You must be signed in to change notification settings - Fork 39
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
Implementing support for preprocessing large files #9 #40
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
The patch looks good to me @andrewvaughanj , but the build failed; once it's fixed I can merge the PR. |
Oh, that's sad ... so even though pyschec is targetting C++17, and 😞 We could just do what some other open-source projects do and say "use FYI, I didn't overlook:
If you're happy with |
Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
Would help if I close the temporary file before calling the preprocessor 🤦 -- now fixed! |
…cessor Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
Signed-off-by: Andrew V. Jones <andrewvaughanj@gmail.com>
// mkstemp returns -1 on error ... | ||
if (err == -1) { | ||
// ... so do we | ||
return std::make_pair(err, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmp_template
will leak here.
Hi @andrewvaughanj , I see you've put some time on working around Ubuntu's From what I quickly checked, |
So, I'm fine to "work around 18.04" but does this mean you actually prefer the Personally, I consider Happy to do whichever you prefer :) |
Kind of … 🙂 I mean the approach with |
Do you prefer |
If you ask me, I'd say the temporary directory + |
Will revisit this this week + do the stuff about looking for C++17 on older Ubuntus! |
This PR implements support for generating a per-process temporary file for the purposes of preprocessing; this allows
cnip
to be run on large files as follows:Currently, master will do this:
if the file to be preprocessed is large -- this will typically happen if the file is larger than
getconf ARG_MAX
in bytes (well, minus a few for the argumentscnip
passes in).Currently, this code is not portable to Windows as
getpid
is POSIX (but there is https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/getpid?view=msvc-160)Signed-off-by: Andrew V. Jones andrewvaughanj@gmail.com