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

Manually added code to otherwise gperf-generated src/libcrun/mount_flags.c #1253

Closed
paravoid opened this issue Aug 1, 2023 · 1 comment · Fixed by #1266
Closed

Manually added code to otherwise gperf-generated src/libcrun/mount_flags.c #1253

paravoid opened this issue Aug 1, 2023 · 1 comment · Fixed by #1266

Comments

@paravoid
Copy link
Contributor

paravoid commented Aug 1, 2023

Commit 366af73 (PR #1237 / issue #1177), included in v1.8.6, added the function get_mount_flags_from_wordlist() to src/libcrun/mount_flags.c (and the prototype to src/libcrun/mount_flags.h).

However, src/libcrun/mount_flags.c is supposed to be automatically generated with gperf and the generated copy is only included for convenience, AIUI.

Regenerating the file with with make generate-mount_flags.c (i.e. gperf), results in a diff to mount_flags.c, where this function is removed. No other functional changes currently exist with gperf 3.1, just whitespace differences.

Not sure what the right fix is here and where this function should be moved.

Besides the fix to address the symptom, something should probably be done to avoid the gperf source and the generated files drifting from each other again. Perhaps some kind of CI check, but this can be tricky given there are whitespace changes between gperf versions. Alternatively, perhaps just add gperf as a build dependency and just always regenerate the two files? Note that this this exactly what we're doing in the Debian package, for freeness/preferred source of modification reasons.

giuseppe added a commit to giuseppe/crun that referenced this issue Aug 8, 2023
commit 366af73 added the function
directly to the generated file.  Add it to the .perf file as well so
it is added every time we generate the file.

Closes: containers#1253

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe
Copy link
Member

giuseppe commented Aug 8, 2023

Thanks for the report.

We can add the function directly to the .perf file. Opened a PR to fix it: #1266

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 a pull request may close this issue.

2 participants