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

Uniqueness of intermediate table target names #2315

Closed
jphickey opened this issue May 1, 2023 · 0 comments · Fixed by #2319
Closed

Uniqueness of intermediate table target names #2315

jphickey opened this issue May 1, 2023 · 0 comments · Fixed by #2319

Comments

@jphickey
Copy link
Contributor

jphickey commented May 1, 2023

Is your feature request related to a problem? Please describe.
Previously, each table ".c" source file was built into its own static library target based on that source file name. This had the side effect of creating lots of complexly-named static lib targets.

With recent changes, this is changed to build all listed table source files listed into a single, simpler-named target.

Now a new problem occurs if one tries to build table files separately. For example, something like this:

add_cfe_tables(sc rts10.c)
add_cfe_tables(sc rts11.c)

Will both try to register a static lib target named tblobj_cpu1_sc, which results in a target name collision error.

Describe the solution you'd like
Invoking add_cfe_tables as above should work without a target name collision.

Describe alternatives you've considered
The add_cfe_tables does allow for a name suffix, which is used as part of the lib name - so as long as that suffix is unique, there is no name collision. For example, this works:

add_cfe_tables(sc.rts10 rts10.c)
add_cfe_tables(sc.rts11 rts11.c)

And listing mutiple source files works too:

add_cfe_tables(sc.custom rts10.c rts11.c)

It is only the case of multiple invocations of add_cfe_tables with the same first parameter that triggers this conflict.

Additional context
Unfortunately, we had previously documented/recommended the first parameter of add_cfe_tables to match the app name, so there may be more users that were following the problematic pattern above (1 is confirmed).

Requester Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/cFE that referenced this issue May 2, 2023
If the passed-in table name does not use a qualifier suffix, then
generate one by computing a hash of the context information.  This
ensures that the generated intermediate target names will be unique.
dzbaker added a commit that referenced this issue May 4, 2023
@dzbaker dzbaker closed this as completed in 4a11c24 May 4, 2023
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants