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

omit build path #6905

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

maitbot
Copy link
Contributor

@maitbot maitbot commented Oct 9, 2023

Support reproducible builds by replacing reference to the build path.

Description

Because gnuradio wants to take it's set of compiler flags so that
gnuradio-config-info --cflags
can show them to the user later, this was also capturing the -ffile-prefix-map
that the Debian package build uses to keep the build path out of generated files.

Also: Doxyfile.in needed an update to its STRIP_FROM_INC_PATH config.

Related Issue

Last year's commit, 886485a :
runtime: Move block_gateway from gnuradio-runtime into gr_python
resulted in the build path showing up in the Doxygen docs again.

Which blocks/areas does this affect?

In gnuradio-runtime this replaces the actual build path with a generic
"BUILD_DIR" string.

Testing Done

Debian's lintian tool detects when the build path is found within
files generated and installed for packaging.
Applying this patch gave a clean report in preliminary packaging of
gnuradio 3.10.8.0-rc1

Because this patch also applies to the maint-3.10 branch, please consider including this
before the next release 3.10.8.0

Checklist

Support reproducible builds by replacing reference to the build path.

Signed-off-by: A. Maitland Bottoms <bottoms@debian.org>
@willcode willcode added CMake Backport-3.10 Should be backported to 3.10 labels Oct 9, 2023
@willcode willcode requested a review from ryanvolz October 9, 2023 17:40
@willcode
Copy link
Member

willcode commented Oct 9, 2023

From CI:

CMake Error at gnuradio-runtime/lib/CMakeLists.txt:23 (cmake_path):
  Unknown CMake command "cmake_path".

@maitbot
Copy link
Contributor Author

maitbot commented Oct 9, 2023

Rats. cmake_path
New in version 3.20.

... so, how can one find a parent path in old-fashioned CMake?

@maitbot
Copy link
Contributor Author

maitbot commented Oct 9, 2023

I'd be happy if someone came up with a CMake function that could simply remove the
-ffile-prefix-map flag entirely.

It would be useful for volk and UHD too.

@willcode willcode marked this pull request as draft October 12, 2023 00:00
Copy link
Contributor

@ryanvolz ryanvolz left a comment

Choose a reason for hiding this comment

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

Conceptually I think this is about the best that could be done to get reproducible builds. I don't see a better way than stripping out paths manually. Instead of cmake_path, I'm guessing you'd need something with get_filename_component for compatibility with CMake < 3.20.

I also think we could go further and just drop the compiler flags altogether from the constants file and and gnuradio-config-info. I don't really see what value they provide to make them worth worrying about stripping paths.

@balister
Copy link
Contributor

balister commented Nov 7, 2023

Please remove all build time/system info from these files. I am also carrying patches in meta-sdr to support reproducible builds of gnuradio.

For example:
https://github.com/balister/meta-sdr/blob/master/recipes-core/gnuradio/files/0001-Compiler-flags-include-build-system-paths.patch

@ryanvolz
Copy link
Contributor

ryanvolz commented Nov 7, 2023

If we do want to keep some form of the compiler flags, maybe it would be better to define what the useful information is and use a regex to keep only that specific information. Then if compiler flags get added somehow in the future that would break reproducible builds, those wouldn't flow through to the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport-3.10 Should be backported to 3.10 CMake
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants