-
-
Couldn't load subscription status.
- Fork 655
change size_t to uint for OSX 64 bit #8249
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
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#8249" |
|
Blocking #8112 |
|
Is this the best solution? |
|
There are problems with any solution due to bootstrapping issues with older and newer dmd's. The easiest solution is avoiding the issue, which is what this PR does. |
|
I don't mind these kinds of workarounds as long as there is a documented plan on how they are going to be backed out. Will this workaround only be needed until a certain version of the host compiler is used? If so, add a bugzilla issue, and put a |
That's why there's git blame. Besides, these changes are completely trivial. |
Sorry, that's not good enough, if you want my approval. |
Your commit message doesn’t contain any reason for this change. Unfortunately we’re very bad on this in general. |
|
I agree with @JinShil here. We should change this back eventually. Not because I think it's possible to have longer than So what happens when we do remove this hack? I would like to see that we still only need a 2-stage build process, which means we don't have much time to fix this (probably one or 2 releases). Can we get the true fixes for the problem into the stable branch of 2.080? Or 2.081? |
Definitely not. The |
See the top comment. |
True or not, that is irrelevant to this PR. This PR is to get the dmd source code to compile independently of the vagaries of |
The same thing that happens now. It won't compile on OSX because OSX's size_t is an unsigned long which mangles differently.
How many more years do we need to wait before the back end can be converted to D? |
This PR is exactly the kind of ugly adjustments your 2.079 mangling change imposes on all mixed D/C++ code bases. I think there's still time to revert it; DMD 2.079 was bad enough, with C++ size_t not even being representable in D without manually declaring a magic struct (!) on 64-bit macOS. |
|
@kinke you might like dlang/druntime#2183 then. Fixing name mangling is not what this PR is about. It is about getting dmd to compile on the Mac so I can proceed with converting the back end to D. Delaying it for yet another year over trivia like a couple casts is unproductive. |
The PR description is not the same as the commit message. If you write the commit message with a title, an empty newline followed by a longer description GitHub will automatically use that for the title and description of the PR. |
So is there no intention to fix the mangling issues? Are they unfixable?
I don't think you realize what I meant. If we put this in, we will likely want to revert the changes once the base compiler can handle it -- it's annoying to have to cast down to BUT, if we wait too long, the compiler will naturally start using more and more features of the newer compiler that CAN'T be built using 2.068.2. At that point, we will need a 3-stage build process -> use 2.068.2 to build 2.079.0, then use 2.079.0 to build 2.xxx (the version which handles the mangling properly), and then use that to build master. If we fix the mangling issues soon, then it still remains a 2-stage, and we just bump the base compiler from 2.079 to 2.xxx. Of course, we can just keep the casts in, and live with this oddity forever. In which case, PLEASE put in a comment on the function prototype so people don't remove them (would be good to reference a bug report there as well). |
They're not unfixable. They just aren't fixed yet. All this PR does is avoid using Waiting yet another year for future versions, and then getting GDC and LDC to fold them in, just to avoid a couple casts is not reasonable. We'd never get anywhere sticking to such a philosophy. BTW, I also have submitted a couple of PRs that do fixes for mangling, but nothing is happening with them, either. |
Is there any reason why we can't do this? |
It'll delay this PR for several release cycles. |
|
What change triggered this link error exactly? The linked test failure looks like an unrelated druntime change dlang/druntime#2151. While it's nice that the C++ binding test caught this, I don't think we are even close to testing enough of the frontend, meaning there are probably far more |
The mangling of
If there were, there would be more link failures. I've removed dependencies on Test cases for the compiler belong in the test suite, not in the compiler itself. |
The current cxxfrontend test only uses a few of the exposed functions, and in no way is representative of an actual project written in C++ that links to dmd, such as what gdc and ldc does. You won't get a link error unless you call it from C++.
Indeed, but a discrepancy between mangling does not mean its a compiler bug. The cxxfrontend test is there to catch implementation bugs only. |
|
I'm not saying no, but I am concerned there is more hiding. All |
|
FWIW, this is how I handle this mess in LDC: ldc-developers/ldc#2704 |
|
@kinke complex additions to the makefile can make this work, but the makefiles are already fragile and excessively complex. I prefer the simpler solution of just avoiding using @ibuclaw I really don't understand what your concern is or why it would impede pulling this PR. |
Huh? It's always been mangled correctly, only the 2.079 OSX mangling broke the interop, so how is that supposed to fix things in a year?
Not |
If it was there would never have been a
No, it wouldn't. I think there's a misunderstanding on what this PR is for. It is to enable moving the boot compiler version forward so I can convert the backend from C++ to D. Delaying it for future compiler versions means delaying the backend conversion likely for another year. |
|
Well in that case I give up the resistance, it's just a single function and a couple of call sites as a hack to make the superficial C++ interop tests happy, so no need to make this bigger than it is. Just try not to convert any more size_t's to uint (with ugly casts) please. The mangling discussion can be postponed to my PR then. ;) |
|
Thank you. BTW, you'll find these same casts elsewhere in the dmd source code, and nobody raised an eyebrow :-) |
|
Isn't it true that this can be reverted in a year? If so, please add a comment next to each cast to remind maintainers to do so in the future. |
Only if all stakeholders agree on an upgraded boot compiler.
Such comments are superfluous because the reason for the cast is pretty obvious by inspection. Neither does anyone need reminding. It's like reminding people to add in Anyhow, the reason that And lastly, even with the casts in this PR, the code is not broken unless you're worried about 4Gb strings in DMD. |
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.
I don't know how else to resolve this stalemate: https://issues.dlang.org/show_bug.cgi?id=18883
|
How about using |
|
@WalterBright code is fine. Better yet just use Thanks @JinShil for the resolution anyway. This discussion is woefully disproportionate compared to the matter at hand. |
Because of:
https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=3165089&isPull=true