Skip to content
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

Create symlinks that don't include the version #443

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alistair23
Copy link
Contributor

To make libtock-c builds easier to manage let's create symlinks to the libraries that don't include the version information

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
@lschuermann
Copy link
Member

I don't quite follow how this makes things easier to manage. Also, ln -s will probably fall over when the symlinks already exist.

@alistair23
Copy link
Contributor Author

Hard coding the version in the file path makes using libtock-c from other repos difficult as it's hard to tell where the libraries are installed

Copy link
Contributor

@bradjc bradjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why we would want this.

@lschuermann
Copy link
Member

Hard coding the version in the file path makes using libtock-c from other repos difficult as it's hard to tell where the libraries are installed

This seems to cover a somewhat niche use-case, right? Where you're not using libtock-c including its build infrastructure out-of-tree, but either using your own build infrastructure, or needing to reference its particular libc / libc++ yourself.

In that case, I'm not sure whether a symlink is the right approach. Isn't there some way to have a file that you include, which simply exports the version and path of those libraries? That avoids modifying the libtock-c tree itself dependent on a build. Something like a symlink would not be stable in environments where we're building with two compiler versions or where we're able to select the libc version per build.

@alistair23
Copy link
Contributor Author

This seems to cover a somewhat niche use-case, right? Where you're not using libtock-c including its build infrastructure out-of-tree, but either using your own build infrastructure, or needing to reference its particular libc / libc++ yourself.

It's the use case where you use libtock-c as a library. I'm not sure it's really niche as lib is in the name :)

The problem with having dynamic paths is that it's difficult to use libtock-c from other projects, as the location of the libraries and headers changes

In that case, I'm not sure whether a symlink is the right approach. Isn't there some way to have a file that you include, which simply exports the version and path of those libraries? That avoids modifying the libtock-c tree itself dependent on a build. Something like a symlink would not be stable in environments where we're building with two compiler versions or where we're able to select the libc version per build.

Yeah, the symlink doesn't work if you want to change libc versions or doing strange compiler things, but that seems like a niche use case.

@ppannuto
Copy link
Member

ppannuto commented Jul 5, 2024

There are NEWLIB_VERSION_{cortex-m0,rv_32,...} variables defined by the build system that anything that needs that information can just use directly (they come from Configuration.mk, which is pulled in by AppMakefile.mk). I think using the "actual for this build" variable would be more robust for any downstream use.


Another thing in my head now w.r.t. to symlinks specifically a as a solution: One of the takeaways from TW7 is that there is a growing, serious user base of Windows-native folks for Tock and its ecosystem. We've had Windows as best-effort support for a while, but if there is growing external demand+support, we will probably need to escalate it to a first class citizen. This is relevant here as IIUC symlinks+windows is a no-go for anything robust :/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants