Implementing support for preprocessing large files #9#40
Implementing support for preprocessing large files #9#40aytey wants to merge 4 commits intoltcmelo:masterfrom
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, ""); |
|
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
cnipto 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_MAXin bytes (well, minus a few for the argumentscnippasses in).Currently, this code is not portable to Windows as
getpidis 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