-
Notifications
You must be signed in to change notification settings - Fork 4k
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
THRIFT-4532: Do not update previously generated output files if the contents have not changed #1541
Conversation
Some of the tests are failing on travis-ci because haskell package server is down. However my test passed in appveyor and the related job in travis-ci. Edit: At least it was on my fork... Here it seems to be fine. |
…ontents have not changed
1b09804
to
4664a01
Compare
Was it truly necessary to change the signature of the methods from ostream to ofstream? After all, an ofstream is an ostream. It should be possible to keep all the methods using ostream which accepts your custom ofstream class that checks to see if the content changed. Extra nice to see a test for this, by the way, I like that a lot! |
@jeking3 From what I see |
I see, thanks, I misread the diff. |
Given this is a breaking change it should probably be noted somewhere in case anyone else has a custom compiler. Would this have any effect on a compiler plug-in being binary compatible? |
I was thinking that this won't break existing users of the Thrift compiler. Do you have a particular scenario in mind, where this can break things? It is behavior change, in the sense that the launch of the compiler does not regenerate all of the target files. I assume this can be mentioned in the release notes. About the plug-ins: Do you have something like the Maven plug-in in mind? I guess the question is, would this break plug-ins that rely on the Thrift compiler binary. I am thinking that it won't, but it is something to be investigated. @mustafa-cosar Can you check if this behavior change would have any impact on the maven thrift plugin? |
@bgedik I don't think @jeking3 was talking about the maven plugin. From what I understand people can write their own generators and use it to generate their code. I'm not too sure about how it works but I didn't make any changes to |
In that case, this will break binary compatibility. Because, in C++, changing the type of a function parameter in a shared library API will require a recompilation of the dependent applications. Here is a good list of do's and don'ts for binary compatibility: https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B It says 'changing any of the types of the arguments in the parameter list, including changing the const/volatile qualifiers of the existing parameters (instead, add a new method)' is among the things that break binary compatibility. @jeking3 If this is really a concern, there is a simple solution to it. In |
Hi @jeking3 ! If everything's OK with you, can you merge this PR? |
Hi, sorry I just switched jobs so my time here has been lower than normal the last couple weeks. I would recommend documenting this as a breaking change for anyone who has written their own compiler output module. Problem is that I don't see a good place to document breaking changes outside language-specific readme file. Documenting breaking changes has not been a strong suit for the project; while I'd love to improve it, perhaps for this it isn't necessary. I restarted the two travis failing build jobs for you. |
@mustafa-cosar Can you please update the readme file? |
Given this one passed all builds I'm going to merge it, I can update the readme separately. |
I updated the top level CHANGES file with a list of breaking changes since 0.11.0 that I could find through diffing README files. |
This PR breaks compatibility with any build system that uses time stamps to check if a file needs to be regenerated ( At the very least, this should have had a command line option to disable. |
If the contents of the output files have not changed, why would you need to recompile? |
Any timestamp based build system (like |
I also implemented a test