-
Notifications
You must be signed in to change notification settings - Fork 185
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
Add an option to split generated pilota files #510
base: main
Are you sure you want to change the base?
Add an option to split generated pilota files #510
Conversation
@Millione @PureWhiteWu Hi. I couldn't find tests for the related builders, could you please point me to one if they exist? |
Perhaps you can add one integration test in the tests folder for workspace mode?The builder is here https://github.com/cloudwego/volo/blob/main/volo-build/src/workspace.rs#L11 |
6706960
to
029121d
Compare
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.
Here can we split it in files?
@missingdays Hi, are things going well here? |
@Millione Hi, I'm waiting for the reply here - #510 (comment) |
Sorry for that, I forgot to say that can you check out why the generated code fails to compile in split mode? It seems related to the split mode implementation in pilota-build |
@Millione As I mentioned, Windows cannot handle files that only differ by case. For |
Maybe we can change the filename that only differ by case a little bit? For |
We can do that, I'll try to implement it |
@Millione Please see cloudwego/pilota#280. I added a test as well |
@missingdays cloudwego/pilota#280 gets merged, can you check out whether it works fine for here?
There is one more question left. There are some structs generated in one file because of volo-build, I think we should split it either. |
# Conflicts: # Cargo.lock
The tests pass now
In
stream.start_new_file_generation("ServiceResponseRecv.rs");
stream.push_str(...); // push the impl of ServiceResponseRecv
stream.finish_file_generation(); This way,
|
@missingdays Great thoughts. Point 2 and 3 look good to me, I think you can go for it. |
@Millione After exploring the code a bit more, I realized that we could use |
@Millione Hi. Splitting |
@missingdays I think it will still be too large and leaving it unsplit looks inconsistent to the user. Is the workload heavy? Can you elaborate on what you're going to do? We can work on it together to find out the best solution. |
@Millione you are right, it would be inconsistent. |
@missingdays Yes, I think it is needed here either. |
@Millione I added the functionality to split the services generated by As for the name deduplication, I didn't find a good way to do it. What would be the correct way to get all the needed service names so that we could check if the service name already exists? |
5e77d36
to
61aab66
Compare
There are also so more changes to |
I think we can split it into more files, commented in the code specifically.
As for this, you can refer to |
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.
split to ImageServiceClient.rs and ImageServiceServer.rs?
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.
split the Recv and Send?
The deduplication has to check all the names, not just the current one. Because we need to transform all names to the lowercase and only then check for duplicates. For example, |
What's behind
I haven't understood it well for how their related directory names affect this, can you explain it more? As far as I'm concerned, the |
Thanks, I see your point. However, we need to know how to deduplicate. If for both |
Oh, I get it.
I have thought about using a global AtomicU64, but maybe not a best way to solve this (the postfix maybe different every time generated and influences the IDE cache)
Great, I think you can put any information you need into cx, and the ordered list of all names information I think you can get from https://github.com/cloudwego/pilota/blob/main/pilota-build/src/middle/context.rs#L382. |
@missingdays Any help needed here? I can help implementing the rest if you don't have enough time. |
@Millione Yeah sorry, I've been busy most of the last week. |
f10c984
to
7c1309e
Compare
Yes, I just implement it, please take a look if there's something I'm missing. Futhurmore, for the rest of job, I think there is only some detailed code style to change. |
@Millione Nice!
I'm ready to fix them if you have any comments. |
@missingdays Well done! I think it's ready to merge. May you submit a PR to pilota first? |
Fixes #454