mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-16 05:25:09 +00:00
[BUG] Error in autogen on Mac #559
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vr8hub on GitHub (Feb 15, 2020).
Originally assigned to: @canihavesomecoffee on GitHub.
{replace with the arguments}build error, not runtime errorThere is an error when running autogen.sh in the Mac subdirectory.
This is actually an error in pre-build.sh, which autogen.sh calls. Line 24 of the pre-build script is
But the Mac's
datecommand has neither a--utcor a--dateoption. (The Mac'sdatecommand is BSD-based; I don't know about Linux.)[Edit] Sorry, should have said: I'm on Mojave 10.14.6.
@canihavesomecoffee commented on GitHub (Feb 15, 2020):
Traces back to
b36429879d.If we don't care about reproducible builds on Mac, we can just revert that part of the change...
@NilsIrl commented on GitHub (Feb 15, 2020):
Probably best to have both scripts (linux + mac) do the same thing.
@canihavesomecoffee commented on GitHub (Feb 15, 2020):
Removing the reproducible build for Linux is not an option here. It was specifically requested by guys at the Debian project.
For Mac we either need to find other parameters, or we could revert it.
@NilsIrl commented on GitHub (Feb 15, 2020):
b36429879d (r37313277)CC @lamby (in case the ping in an edited review for a closed PR doesn't go through). (Also if you could address my comment below as well.)
@NilsIrl commented on GitHub (Feb 15, 2020):
Also for that PR, why
--utcneeded since a format is provided and the source of the date is the--dateargument?@cfsmp3 commented on GitHub (Feb 15, 2020):
@vr8hub can you send us the correct syntax for Mac? Seems trivial to change but I can't test:
https://ss64.com/osx/date.html
@canihavesomecoffee commented on GitHub (Feb 15, 2020):
@cfsmp3 There's no option for inputting a specific date in there it seems. We can replace the
--utcwith-umost likely without any problems, but that won't fix the remainder of the command.We should perhaps see if @lamby has a suggestion for reproducible builds on Mac, or if we can revert that for Mac only.
@vr8hub commented on GitHub (Feb 15, 2020):
Possibly. I don't have a Linux box handy, so I don't know what the existing command is trying to do.
@canihavesomecoffee commented on GitHub (Feb 15, 2020):
@vr8hub The current command is adding the date to the build, in a reproducible manner.
This means that it either takes the time from an environment variable, or picks the current date if that is missing.
@vr8hub commented on GitHub (Feb 15, 2020):
From a little searching, it seems the SOURCE_DATE_EPOCH is formatted as number of seconds since epoch. Which would agree with the
+%sformat on the current date/time.So, take # of seconds, either from SOURCE_DATE_EPOCH or the current datetime, and output in the indicated format.
I think that might be possible (the ss64 page is incorrect or outdated; there are quite a few other options available in
dateon Mojave; I don't have an older OS available right now). Let me play with it a bit.@lamby commented on GitHub (Feb 15, 2020):
Just a drive-by comment please check out https://reproducible-builds.org/docs/source-date-epoch/#bash--posix-shell
@vr8hub commented on GitHub (Feb 15, 2020):
Excellent, thanks Chris. And that does work; I tried it first with SOURCE_DATE_EPOCH set to current date, then set it back a couple of months, and BUILD_DATE ended up with the correct value both times.
I suspect this could be shortened, but since it works and I have other things to do, let's just go with this for now. :)
DATE_FMT="+%Y-%m-%d"
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
builddate=$(date -u -d "@$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$DATE_FMT" 2>/dev/null || date -u "$DATE_FMT")
@lamby commented on GitHub (Feb 15, 2020):
I keep forgetting that Mac has the BSD
date, apologies for the ~noise.@canihavesomecoffee commented on GitHub (Feb 15, 2020):
If https://travis-ci.org/CCExtractor/ccextractor/builds/650958611 passes I'll merge that (which is basically the thing mentioned here).
@vr8hub commented on GitHub (Feb 15, 2020):
Actually, I don't think that first command is needed, and doesn't do what they think it does, at least on a Mac. The
-doption is to "Set the kernel's value for daylight saving time."Also, the date command should probably include
-jto prevent it from trying to set the date.I think those three lines can be shortened to the equivalent one-liner for what's there now:
That works for me when SOURCE_DATE_EPOCH isn't set and when it is.
@lamby commented on GitHub (Feb 15, 2020):
This will not work under GNU date as
-jis not an option there.@vr8hub commented on GitHub (Feb 15, 2020):
We're not worried about GNU date, are we? This is a Mac-specific file.
@lamby commented on GitHub (Feb 15, 2020):
Ah, did not realise that...! I should go to bed, really. :)