-
Notifications
You must be signed in to change notification settings - Fork 8
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
Location
vs Link-Location
issues
#34
Comments
Actually, thinking about this more and looking at the sample, it has this: "sample-shared": {
"Type": "dylib",
"Requires": [ ":sample-core" ],
"Configurations": {
"Optimized": {
"Location": "@prefix@/lib64/libsample.so.1.2.0"
},
"Debug": {
"Location": "@prefix@/lib64/libsample_d.so.1.2.0"
}
}
} Which isn't correct. We don't want to link with the |
I think you're over-complicating things. The way this works is actually relatively simple:
If that's unclear in the specification, we can fix that, but note that nothing in the above cares what platform you're on, or targeting. The idea with the current implementation is that you don't need to specify both if they have the same value.
I am perhaps less savvy with respect to when you use the unversioned symlinks, but that sounds plausible if "require" is replaced with "specify as best practice for". |
I'm not an expert on Windows, but you never link to the You should always link with the unversioned .so, the elf header in the .so will contain version requirement information, and at runtime ld.so will find a library that meets those requirements. So, I guess the requirement for Linux should be either: Location points to the bare .so, or if it doesn't then Link-Location must be set. |
Link, yes, but you load the
That sounds reasonable, except, again, I'm not sure it belongs in the CPS specification. Not as a stronger than a recommendation, in any case. |
This makes me feel like we're specing backwards then.
I think it does make sense to follow the standard for the OS. On *nix pointing at a versioned .so will surprise people, and it will break because there is no guarantee that a particular versioned .so will be on the system even though a dependency might be there. In fact, on systems like debian and fedora the versioned so's are part of the runtime package and the unversioned are in the dev package, along with the .cps files, and it is sometimes possible to install the -dev package without the runtime pacakge. It's also not how any current dependency system works because almost all of those (including pkg-config) give |
Perhaps. I'll concede that there is historical "baggage" present. OTOH, from a human-language point of view, it seems (to me, at least) more natural that you always have a location, but may or may not have a distinct link-location. Regardless, our options are to either require both attributes when they might have identical values, or pick one to be optional, which will fall back to the other if not set.
Again, I'm mostly not disagreeing, I just feel that what you're describing is best practice and not something that should be expressed as a strict requirement. (Not at the specification level, anyway; the specification generally tries to avoid getting into the weeds of platform-specific details. A "how to use CPS on ELF platforms" document might be a different matter.) That said, if a CPS is present and mentions a specific versioned
Since the unversioned For that matter, it's not entirely clear what difference this makes, since the linker is going to see the same bytes, regardless. |
Okay, then I would settle from "must" to "should" language like: "A compliant Link-Location must point to a location to be passed to the linker, this location should conform to the standards of the OS the CPS file is for". would something like that be acceptable? |
The current state is that the tool doing the lookup needs to know what platform it is running for to know if it needs to point at
Link-Location
orLocation
, since on Windows you do not link with the.dll
, but with the interface library, pointed at byLink-Location
. On all other platforms you will link with the.so
or.dylib
, pointed at by byLocation
. This is especially burdensome when cross compiling, since now the tool needs to know what platform it going to be running for, not just on.We can avoid all of this ambiguity by doing one of two things:
Location
is providedLink-Location
should also be provided, and point to the actual thing to link to, as aboveThe text was updated successfully, but these errors were encountered: