datetime-fortran
datetime-fortran copied to clipboard
Force ar/ranlib to do a deterministic build.
I noticed that datetime-fortran does not create deterministic builds. Details are documented in: https://github.com/ACCESS-NRI/ACCESS-OM/issues/8
Thanks @harshula! Does ar
on Xcode have a different option set? From the failed ci/mac job, it seems that ar
there doesn't like -D
Thanks @harshula! Does
ar
on Xcode have a different option set?
Sorry, I'm not familiar with Xcode.
@scivision do you know what's the ar
option for deterministic builds on macOS? -D
doesn't seem to be it, but I also can't find an answer from an online search. See https://github.com/wavebitscientific/datetime-fortran/actions/runs/3261165880/jobs/5368639001
Notes
https://gitlab.kitware.com/cmake/cmake/-/issues/19852
My current workaround is to set CMAKE_
_CREATE_STATIC_LIBRARY on macOS platforms to something along the lines of /usr/bin/xcrun libtool -static -D -o <TARGET> <LINK_FLAGS> <OBJECTS>, which seems to have the same effect, but it would be preferable if CMake had native libtool support instead of relying on xcrun.
&
You can also try setting ZERO_AR_DATE=1 in the environment. This is supported by older apple tools. It doesn't zero out the uid etc. in the .a, but it's better than nothing.
Thanks. Either workaround is OK with me.
Closing this as wontfix because:
- On Linux, it appears that some distros are defaulting to building binutils with "--enable-deterministic-archives".
- CMake should have a better mechanism to do this.