Skip to content
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

Revert "Move a couple of functions out of dsymbol.d (#15789)" #15854

Closed
wants to merge 1 commit into from

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Nov 22, 2023

This reverts commit 7bff453.

@ibuclaw ibuclaw added GDC Gnu D Compiler Blocking Other Work review and pulling should be a priority labels Nov 22, 2023
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your 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 locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15854"

Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've put a GDC tag on it this time, which is better than nothing, but I'd still like an explanation as to why this is necessary, considering that this undies progress of moving stuff out of AST and into sema. Again I suspect that the appropriate course of action here is to make this work not to revert it.

Please do not merge this without a satisfactory explanation.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 23, 2023

/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable4growMFNaNbZv':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:310: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toStringMxFNaNbNiNjZAxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable10allocValueMFNaNbMAxaC3dmd5mtype4TypeZk':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:268: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:269: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable4growMFNaNbZv':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:310: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toStringMxFNaNbNiNjZAxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable10allocValueMFNaNbMAxaC3dmd5mtype4TypeZk':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:268: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:269: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable4growMFNaNbZv':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:310: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toStringMxFNaNbNiNjZAxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable10allocValueMFNaNbMAxaC3dmd5mtype4TypeZk':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:268: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:269: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable4growMFNaNbZv':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:310: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toStringMxFNaNbNiNjZAxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable10allocValueMFNaNbMAxaC3dmd5mtype4TypeZk':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:268: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:269: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable4growMFNaNbZv':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:310: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toStringMxFNaNbNiNjZAxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/func.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable10allocValueMFNaNbMAxaC3dmd5mtype4TypeZk':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:268: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: /build/gcc-trunk/gcc/d/dmd/root/stringtable.d:269: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue7lstringMFNaNbNiNjZPa'
/usr/bin/ld: d/mtype.o: in function `_D3dmd4root11stringtable34__T11StringTableTC3dmd5mtype4TypeZ11StringTable8findSlotMxFNaNbNimMAxaZm':
/build/gcc-trunk/gcc/d/dmd/root/stringtable.d:292: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
/usr/bin/ld: d/typesem.o: in function `merge(Type*)':
/build/gcc-trunk/build.9/gcc/../../gcc/d/dmd/typesem.d:2029: undefined reference to `_D3dmd4root11stringtable34__T11StringValueTC3dmd5mtype4TypeZ11StringValue8toDcharsMxFNaNbNiNjZPxa'
collect2: error: ld returned 1 exit status
make: *** [../../gcc/d/Make-lang.in:236: d21] Error 1

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 23, 2023

  1. Don't move huge swaths of functions and their dependencies around. Move them one at a time so these can be easily bisected and reverted as-needed.
  2. Don't add new global imports, use selective imports at function level.

@ibuclaw ibuclaw dismissed thewilsonator’s stale review November 23, 2023 07:20

no justification for keeping regression introducing refactorings.

@RazvanN7
Copy link
Contributor

So the linker errors are the same as in the case of the other PR? This looks like something that is particular to the way gdc compiles the frontend.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 23, 2023

So the linker errors are the same as in the case of the other PR? This looks like something that is particular to the way gdc compiles the frontend.

Modules are compiled separately, there's nothing peculiar about it.

@thewilsonator
Copy link
Contributor

Modules are compiled separately, there's nothing peculiar about it.

Clearly it is 1) different and, 2) not tested. You should set up a CI job that builds and links DMD with modules copied separately if you want to prevent this from happening again.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 24, 2023

Modules are compiled separately, there's nothing peculiar about it.

Clearly it is 1) different and, 2) not tested. You should set up a CI job that builds and links DMD with modules copied separately if you want to prevent this from happening again.

You can watch the daily builds.

https://github.com/D-Programming-GDC/gcc/actions/runs/6982207333

Downstream user noticed that it affects everything, not just the target they were bootstrapping from. I've accounted for this and now you see everything is red.

@ibuclaw ibuclaw added the Regression PRs that fix regressions label Nov 24, 2023
@thewilsonator
Copy link
Contributor

I meant a DMD CI job, so that it gets caught here and not later on.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 25, 2023

I meant a DMD CI job, so that it gets caught here and not later on.

DMD CI is not a good yardstick for success.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 29, 2023

Blocked for a week, and there's yet another pr that pushes the diff with upstream over the 400kb limit.

@dkorpel
Copy link
Contributor

dkorpel commented Nov 29, 2023

pushes the diff with upstream over the 400kb limit

What limit?

@RazvanN7
Copy link
Contributor

The change is quite small in the mentioned PR, it's just that the automated generation of frontend.h that went crazy.

Anyway, I can put up a PR to unblock you in a way that does not undo previous work, however, since building gdc is not tested on the pipeline, I have no way of knowing it my fix actually does something.

@RazvanN7
Copy link
Contributor

@ibuclaw here is an attempt at fixing the issue: #15872

@ibuclaw
Copy link
Member Author

ibuclaw commented Dec 1, 2023

The change is quite small in the mentioned PR, it's just that the automated generation of frontend.h that went crazy.

Anyway, I can put up a PR to unblock you in a way that does not undo previous work, however, since building gdc is not tested on the pipeline, I have no way of knowing it my fix actually does something.

By the way, this broke before in the same way due to functions being moved around.

https://issues.dlang.org/show_bug.cgi?id=21294 (Fix PR #11827)
https://issues.dlang.org/show_bug.cgi?id=21299 (Fix PR #11838)

To quote an old comment of mine I forgot I made:

this can be resolved by adding the following leaf module should it ever become a probem:

module dmd.stringvaluetypes;

import dmd.gluelayer;
import dmd.root.stringtable;

alias SymbolStringValue = StringValue!(Symbol*);

In this change, it's instead failing for StringValue!(Type) of course.

@ibuclaw
Copy link
Member Author

ibuclaw commented Dec 1, 2023

I meant a DMD CI job, so that it gets caught here and not later on.

There's already a test in the testsuite for this - the problem is DMD has been patched to address the issue since 2.094.1.

@RazvanN7
Copy link
Contributor

RazvanN7 commented Dec 4, 2023

@ibuclaw is it ok to close this?

@ibuclaw
Copy link
Member Author

ibuclaw commented Dec 14, 2023

@ibuclaw is it ok to close this?

Mainline is green again.

https://github.com/D-Programming-GDC/gcc/actions/workflows/main.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocking Other Work review and pulling should be a priority GDC Gnu D Compiler Needs Rebase Regression PRs that fix regressions
Projects
None yet
5 participants