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

Use cmake timestamp macro #472

Closed
wants to merge 1 commit into
base: 10.2
from

Conversation

Projects
None yet
3 participants
@bmwiedemann

bmwiedemann commented Oct 23, 2017

Without this patch it is hard to build mariadb packages
that do not differ between builds.

See https://reproducible-builds.org/ for why this matters.

With this patch, it is possible, because recent cmake versions
honor the SOURCE_DATE_EPOCH environment variable.

Note: if requiring cmake-2.8.11 is not yet an option,
another approach could be taken via
https://wiki.debian.org/ReproducibleBuilds/TimestampsProposal#CMake

I contribute this change under the BSD-new license.

@svoj

This comment has been minimized.

Show comment
Hide comment
@svoj

svoj Oct 25, 2017

Contributor

Thanks for your contribution!

CMake 2.8.11 is almost 5 years old, however we still have builders with older cmake building 10.2 (some even have cmake 2.7).

What if do something like

IF (CMAKE_VERSION VERSION_GREATER 3.8.10)
  STRING(TIMESTAMP TMP_DATE "+%Y-%m-%d %H:%M:%S" UTC)
ELSEIF (WIN32)
...

This will make reproducible builds on recent platforms, while keeping it compilable on older platforms.

Contributor

svoj commented Oct 25, 2017

Thanks for your contribution!

CMake 2.8.11 is almost 5 years old, however we still have builders with older cmake building 10.2 (some even have cmake 2.7).

What if do something like

IF (CMAKE_VERSION VERSION_GREATER 3.8.10)
  STRING(TIMESTAMP TMP_DATE "+%Y-%m-%d %H:%M:%S" UTC)
ELSEIF (WIN32)
...

This will make reproducible builds on recent platforms, while keeping it compilable on older platforms.

@svoj svoj self-assigned this Oct 25, 2017

@svoj svoj added this to the 10.2 milestone Oct 25, 2017

Use cmake timestamp macro
Without this patch it is hard to build mariadb packages
that do not differ between builds.

See https://reproducible-builds.org/ for why this matters.

With this patch, it is possible, because recent cmake versions
honor the SOURCE_DATE_EPOCH environment variable.

Also allows building on platforms that are not UNIX or WIN32
as a side-effect.
@vuvova

This comment has been minimized.

Show comment
Hide comment
@vuvova

vuvova Oct 25, 2017

Member

I'd say, just don't include INFO_BIN into the "reproducible build" set. Ignore it, delete it, whatever. Binaries are reproducible, as far as I know.

Member

vuvova commented Oct 25, 2017

I'd say, just don't include INFO_BIN into the "reproducible build" set. Ignore it, delete it, whatever. Binaries are reproducible, as far as I know.

@bmwiedemann

This comment has been minimized.

Show comment
Hide comment
@bmwiedemann

bmwiedemann Oct 25, 2017

adapted to svoj's suggestion. dropping the INFO_BIN file would be another way, but I did not know if it is used for something at runtime.

bmwiedemann commented Oct 25, 2017

adapted to svoj's suggestion. dropping the INFO_BIN file would be another way, but I did not know if it is used for something at runtime.

@vuvova

This comment has been minimized.

Show comment
Hide comment
@vuvova

vuvova Oct 25, 2017

Member

it's not used for anything at runtime

Member

vuvova commented Oct 25, 2017

it's not used for anything at runtime

@svoj

This comment has been minimized.

Show comment
Hide comment
@svoj

svoj Oct 25, 2017

Contributor

Independently of alternative solution suggested by @vuvova, I like STRING(TIMESTAMP UTC). It looks much cleaner than what we have. Writing UTC time looks nice too, after all time zone is not included.

@bmwiedemann I wonder if dropping INFO_BIN is easy/acceptable for whatever you're trying to achieve?

Contributor

svoj commented Oct 25, 2017

Independently of alternative solution suggested by @vuvova, I like STRING(TIMESTAMP UTC). It looks much cleaner than what we have. Writing UTC time looks nice too, after all time zone is not included.

@bmwiedemann I wonder if dropping INFO_BIN is easy/acceptable for whatever you're trying to achieve?

@bmwiedemann

This comment has been minimized.

Show comment
Hide comment
@bmwiedemann

bmwiedemann Oct 26, 2017

I submitted https://build.opensuse.org/request/show/536714 for dropping INFO_BIN from our package and it was accepted, so it is good for us.

bmwiedemann commented Oct 26, 2017

I submitted https://build.opensuse.org/request/show/536714 for dropping INFO_BIN from our package and it was accepted, so it is good for us.

@svoj

This comment has been minimized.

Show comment
Hide comment
@svoj

svoj Nov 16, 2017

Contributor

Closing as alternative solution was acceptable, there's seem to be no point to bother with this code. Thanks!

Contributor

svoj commented Nov 16, 2017

Closing as alternative solution was acceptable, there's seem to be no point to bother with this code. Thanks!

@svoj svoj closed this Nov 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment