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
Fix Bugzilla Issue 24504 - ImportC: Enum declarations with a mixture … #16385
base: stable
Are you sure you want to change the base?
Conversation
94c4bb2
to
18d1bbe
Compare
I think that it's required for 'issue' to be spelled with a capital I so that the bot can pick it up. From the unittests of dlang bot I see that the combination of 'Bugzilla issue' is not present. |
18d1bbe
to
1900fee
Compare
1900fee
to
27cfd31
Compare
Maybe dlang-bot will pick it up if another comment is made? EDIT: It didn't |
@just-harry The PR title doesn't matter. Also, comments don't matter. The only thing that is inspected by the bot is the commit message which needs to contain "Fix Bugzilla Issue 24504" (or some other combination, but this surely will work). |
27cfd31
to
5f840b3
Compare
@@ -0,0 +1,7 @@ | |||
// REQUIRED_ARGS: -os=windows -g |
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.
could you add -c
here as well, the macOS CI failures seem to resulting from a missing main
function. I know this is a compilable test and that shouldn't matter, but it would be good to rule out.
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.
Yeah okay—that's it pushed now
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.
Looks like the same issue with -c
:
2024-04-19T05:02:32.0668560Z ... compilable/test24504.c -c -os=windows -g ()
2024-04-19T05:02:32.0673260Z ==============================
2024-04-19T05:02:32.0722390Z Test 'compilable/test24504.c' failed. The logged output:
2024-04-19T05:02:32.0729000Z /Users/runner/work/dmd/dmd/generated/osx/release/64/dmd -conf= -m64 -Icompilable -c -os=windows -g -od/Users/runner/work/dmd/dmd/compiler/test/test_results/compilable -of/Users/runner/work/dmd/dmd/compiler/test/test_results/compilable/test24504_0.o -c compilable/test24504.c
2024-04-19T05:02:32.0772720Z ld: Undefined symbols:
2024-04-19T05:02:32.0843160Z _main, referenced from:
2024-04-19T05:02:32.0887700Z <initial-undefines>
2024-04-19T05:02:32.0890780Z clang: error: linker command failed with exit code 1 (use -v to see invocation)
2024-04-19T05:02:32.0899230Z Error: C preprocess command clang failed for file compilable/test24504.c, exit status 1
Would a DISABLED: osx
be acceptable?
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.
Yes
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.
Yes
It's now disabled on macOS. It works on FreeBSD so it should work on macOS, barring the preprocessor somehow getting the linker involved.
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.
Sounds more like there's a problem with the Mac CI not handling the "compilable" directory properly.
There are a lot of files in compilable that do not have main()
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.
Mhm, the same issue happened with the test for #16399 (comment)—it seems related to the presence of -os=windows
on the command-line
42c9ad6
to
d2ad9e2
Compare
d2ad9e2
to
81d4ded
Compare
81d4ded
to
1fd8687
Compare
compiler/src/dmd/tocvdebug.d
Outdated
|
||
auto valueExp = sf.value(); | ||
if (auto castExp = valueExp.isCastExp()) | ||
valueExp = new IntegerExp(castExp.loc, castExp.e1.toInteger(), castExp.type); |
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.
This is a forcible cast which assumes its argument and the new type are workable. It would be better to find out where the CastExp is applied, and do a call to optimize() there. Further, creating an AST node for an integer just so that integer can be converted to an integer is kinda going around the horn.
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.
It would be better to find out where the CastExp is applied, and do a call to optimize() there.
Yeah, that's a more sensible approach (and is now pushed up). Thanks for telling me about optimize
.
Still no link to the bugzilla issue... |
…of int and uint literal values cause errors, when targeting Windows, when debug info generation is enabled.
1fd8687
to
6b1bfb2
Compare
…of
int
anduint
literal values cause errors, when targeting Windows, when debug info generation is enabled.The value of a C enum's member can be a
CastExp
instead of anIntegerExp
, causing these calls totoInteger
to emit an error.So instead, if the value is a
CastExp
we make anIntegerExp
out of it and go about as normal from there.