-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Dub support in Meson is broken #2640
Comments
how is this important for meson? The data is still in the build hash, it's just not written out for humans anymore. You can still check if filenames match exactly to see if things need to change. (which dub checks) Since the information for each build tool will vary between tools and maybe even projects, you probably more likely want to store the information how things were built somewhere on your own, every time when doing a build, and associate that with the cache file name. The cache would for example also need to depend on things like dflags that change linker names, etc., which were never exposed before. |
Maybe I'm missing a point but I don't see how to associate the Dub's build hash to a specific build configuration. By design, Meson will not call When a meson recipe expresses a dependency to a dub package, Meson must find a compatible library already built by Dub.
As Meson scans Dub's build cache, it must be able to check for these compatiblity requirements in order to pick the right build artifact to link to. Now if |
What we could do relatively easily, is write a json file that contains this information inside the individual cache directory to allow final narrowing down by other package managers. That'll get you to the end goal, however, anything else would be an initial filter to cut down the files that need processing (and hence improving performance). |
making |
Meson developer here. Just want to confirm this. Meson is not going to "trigger a build if needed", because:
(I am not a D user. I know that meson's current usage of D doesn't violate this, but I have no way of knowing whether it is optimal or could be done better. @rtbo has contributed quite a bit to meson's D support, though, so I assume it is accurate that meson doesn't have better options than whst was broken by this filename change.) Users can and do inject their own prebuilt dependencies for a variety of languages, including for the D language. Meson aims to be able to recognize those prebuilt dependencies and link to them. There are undoubtedly tools that build multiple packages in turn, some with |
we can introduce a short hash like rtbo has suggested, but note that it may change in the future, especially if we start to add more things that affect the build output (filtering dflags for related stuff, etc.) and is not gonna be able to be generated manually / outside dub due to being an implementation detail. @rtbo how would you use the short hash in meson? would an opaque string like this that may change between dub versions be fine for you? Currently I think if we want a full hash that reliably gives build information this would contain things like:
maybe it would make sense just hashing the entire compiler CLI flags? |
The purpose of the short hash is to encode only the few identifiers known by Meson to locate a build. But after second thoughts, I'm more in favor of @rikkimax proposal. |
Dub is fundamentally broken in meson for various reasons, and the lack of |
So if I understand correctly the original implementation of json descriptions is probably not going to be the final released dub interface, and this ticket is actually going to be closed by #2644 instead? |
Very likely so yes. I'm preparing also the change corresponding to #2644 in Meson. |
Change #2589 has broken Meson support for Dub packages.
Meson will not try to build Dub packages directly but rely instead on the Dub cache to find a package built by Dub.
The way it is done is to find the relevant info in the cache dir name.
For example
library-debug-linux.posix-x86_64-ldc_2081-EF934983A3319F8F8FF2F0E107A363BA
.Now in the new shorter cache dir name, it is not possible anymore.
If short names are that important, can I suggest that the dir names is composed of two hashes:
a. compiler
b. compiler version
c. arch
d. platform
E.g.
would become
5 chars in base64 is more than a billion possibilities. Even if not perfectly distributed, it is more than enough to prevent accidental collisions.
The text was updated successfully, but these errors were encountered: