-
Notifications
You must be signed in to change notification settings - Fork 146
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
src/comp/Depend: use unique names for cpp input #52
Conversation
Previously, the input to the C preprocessor was always deposited into a file called _t_o_p.c, while the output was given a unique name. This proved problematic for build systems that invoke several bsc processes concurrently, using the same output directory. This change renames the input file to match the output file using the tmpnam-generated unique-ish name. With this change, I can build the Mergesort tutorial projects using a Ninja file and 4 cores. It takes a little under 50% of the time compared to Ninja with -j1.
I don't think it's necessary to add a different kind of name generator. Just define
Unless there's a reason this won't work, that I'm missing? if not, I can check in that fix. |
The issue is that the generated file contains
and no
The first option was simpler for me, but I'm totally open to the second! |
Ah, ok, thanks. BSC wants to run the C preprocessor on a non-C source file. It generates a Why don't we just run Even if we did want to keep the current structure, we could easily do it this way: generate |
Extracting the path and providing it with |
I hadn't properly tested my changes before committing them and I see in the testsuite (which I'm working to make public) that a behavior change was flagged. Specifically, the filename that appears in messages was mangled. This is because BSC encodes relative locations within absolute paths, using It's still unclear to me why we don't call CPP directly on the BSV file. If we do that, there's no need for |
Previously, the input to the C preprocessor was always deposited into a
file called _t_o_p.c, while the output was given a unique name. This
proved problematic for build systems that invoke several bsc processes
concurrently, using the same output directory.
This change renames the input file to match the output file using the
tmpnam-generated unique-ish name.
With this change, I can build the Mergesort tutorial projects using a
Ninja file and 4 cores. It takes a little under 50% of the time compared
to Ninja with -j1.