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

Make this project work with multiple versions of cFE, OSAL #1

Open
zec opened this issue Aug 20, 2022 · 1 comment
Open

Make this project work with multiple versions of cFE, OSAL #1

zec opened this issue Aug 20, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@zec
Copy link
Member

zec commented Aug 20, 2022

Currently, the n2o4 and cfs-sys crates only support a specific version of cFE and OSAL:

As these are the versions of the respective libraries we're using in the BlackCAT flight software, this has been OK for development so far. However, n2o4 should ideally be usable on as wide a range of setups as possible, and that means being able to support other versions of cFE and OSAL.

Right now, it's not clear to me how to modify the current system to support multiple library versions. cfs-sys just tries to bindgen everything it can (with some manual additions), with no awareness of what versions of cFE and OSAL it's working with. n2o4 does no version detection whatsoever, and manually trying to track which APIs are available in which versions of {cFE, OSAL} (and with which signatures) sounds like it would be tedious and error-prone.

So, are there good ways to automate or semi-automate this?

@zec zec added the enhancement New feature or request label Aug 20, 2022
@zec
Copy link
Member Author

zec commented Apr 14, 2023

A possible approach that I've been kicking around in my head: unify the cfs-sys and n2o4 crates, and in the build script, use the information bindgen has gathered about the API signatures to set a bunch of feature flags that can be used to enable/disable bindings based on what's available.

@zec zec mentioned this issue Apr 14, 2023
zec added a commit to zec/n2o4 that referenced this issue Nov 13, 2023
Merging what is currently the separate cfs-sys crate into the n2o4 crate
is being done for three purposes:

1) At this point, I don't think it likely that anyone would want to use
cfs-sys, except wrapped by n2o4. Certainly, the way n2o4 is
distributed (or not) means it is always tagging along cfs-sys.

2) In the future, we'd like to make n2o4 work with multiple versions of
cFE and OSAL (issue BlackCAT-CubeSat#1). My best ideas for how to do
that would require a merger of the cfs-sys and n2o4 crates anyway.

3) It reduces the file-hierarchy depth and breadth slightly--
fewer places for stuff to be in, basically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant