Closed chriku closed 1 month ago
try this patch again. https://github.com/xmake-io/xmake/pull/5437
xmake update -s github:xmake-io/xmake#protobuf
The patch fixes it for protobuf and after porting it my larger project with capnproto also works (using my other capnproto WIP changes I have not opened a PR for yet). Thank you!
But a quick search suggests that the identical pattern of table.insert(target:objectfiles(), objectfile)
in *_buildcmd_file
also appears in the rules for asn1c
, qt/qrc
, lex_yacc
, qt/moc
, ispc
, capnproto
, verilator
, vala
, cppfront
and qt/qmltyperegistrar
and most importantly the example in the docs. (this does not include the rules I don't understand).
The patch fixes it for protobuf and after porting it my larger project with capnproto also works (using my other capnproto WIP changes I have not opened a PR for yet). Thank you! But a quick search suggests that the identical pattern of in also appears in the rules for , , , , , , , , and and most importantly the example in the docs. (this does not include the rules I don't understand).
table.insert(target:objectfiles(), objectfile)``*_buildcmd_file``asn1c``qt/qrc``lex_yacc``qt/moc``ispc``capnproto``verilator``vala``cppfront``qt/qmltyperegistrar
Yes, but each change requires more testing, so I don't consider to modify them all for now because I can't guarantee that they will work well.
Xmake Version
2.9.4
Operating System Version and Architecture
Debian GNU/Linux trixie/sid, Windows 11 Home
Describe Bug
using a rule with
before_buildcmd_file
inside a target withset_kind("object")
that has another target withset_kind("object")
as dependency, as well as using the rule in the main target results in the generated object file not being linked.I have confirmed that this affects (as used in my example) protobuf and capnproto, but did not test any other code generators
Expected Behavior
The object file should be added to the internal lists of object files in
before_buildcmd_file
, but insteadbefore_buildcmd_file
is executed after the object files have already been collectedProject Configuration
In the attached zip, the xmake.lua has a line
add_deps("empty") -- Comment out this line
. Commenting out this line results in successful compilation, not commenting out this line results in missing symbolsFor demonstration purposes I have used the builtin protobuf module, but the same happens with capnproto. I have not tested it with completely custom rules
Of course this happens also if
empty
has source files, but they aren't necessary for this issue to occurAdditional Information and Error Logs
xmake -vD
does not contain anything related to this issueI have tested it as well on a freshly installed windows 11 instance, but the appended zip should reproduce the error on all platforms
This may have connections to #2476, but seems different as this only appears with dependencies of kind
"object"
.