-
Notifications
You must be signed in to change notification settings - Fork 268
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
Trunk v0.18.0 detects multiple binary crates and ignores data-bin link #630
Comments
Ah yeah it makes sense that this is happening because of the Adding a check to see if the data-bin is specified and ensuring the specified data-bin name matches the artifact name fixed this for me when testing. Unlike previous Trunk versions, your example will not build with this fix unless you specify the data-bin attribute properly. In 0.17 it would have worked correctly because it was filtering for "bin". I'm not sure which artifact would have been selected in 0.16 though. I want to do more testing before making a PR but @ctron please feel free to make the necessary fixes as I may not get to it right away. Branch with fix is here: https://github.com/vgwidt/trunk/tree/fix-multiple-binaries-detected |
Ok, this is trickier than anticipated. I gave it a try, and ended up with the same fix. That fixes this issue indeed, but doesn't completely fix the issue for the We could add a But yes, I think we found the issue. The question is just how solve this without breaking something (again). I will take a look at this tomorrow. |
In a previous change `cdylib` targets have been added to the list of allowed artifacts. However, projects which are both a binary as well as a library, the compilation failed now, since both target artifacts (bin and lib) got added to the target output. It was not possible to select by name. This change adds the `data-target-name` attribute to specifically select a target "by name", without having to use the `--bin` argument in cargo. Closes: trunk-rs#630
In a previous change `cdylib` targets have been added to the list of allowed artifacts. However, projects which are both a binary as well as a library, the compilation failed now, since both target artifacts (bin and lib) got added to the target output. It was not possible to select by name. This change adds the `data-target-name` attribute to specifically select a target "by name", without having to use the `--bin` argument in cargo. Closes: #630
Hi
My GitHub workflow action automatically updated to use the latest version of Trunk yesterday and build stopped working.
I believe this is because my Cargo.toml looks like:
and a recent change to Trunk introduced detection for
cdylib
targets.In response, I made the following change to my
index.html
: MeoMix/symbiants@c484abdbut builds continue to fail. I'm also able to reproduce this locally.
If I edit the code from
<link data-trunk rel="rust" data-bin="symbiants_pkg" />
to<link data-trunk rel="rust" data-bin="symbiants" />
then I see the error output change:
So it's clear to me that
index.html
is being parsed andsymbiants_pkg
is known to the Trunk build process, but that the explicitdata-bin
declaration is insufficient to eliminate the build ambiguity error.The error is:
I will try to put together a minimal repo soon.
EDIT: https://github.com/MeoMix/trunk_broken_example
The text was updated successfully, but these errors were encountered: