From: Junio C Hamano <hidden> Date: 2016-07-14 20:34:12
Jeff King [off-list ref] writes:
Yeah, that is what I was trying to get at, but you stated it much more
clearly. LONG_IS_64BIT is good. I wonder if the "git version
--build-options" should be "sizeof-long", too. It's shorter, and
indicates our assumption that we are talking about all longs, not just
unsigned ones.
OK, I'll do a final reroll and then wait for Europeans ;-)
From: Junio C Hamano <hidden> Date: 2016-07-14 20:49:59
As we are not yet moving everything to size_t but still using ulong
internally when talking about the size of object, platforms with
32-bit long will not be able to produce tar archive with 4GB+ file,
and cannot grok 077777777777UL as a constant. Disable the extended
header feature and do not test it on them.
Signed-off-by: Junio C Hamano <redacted>
---
archive-tar.c | 5 +++++
t/t5000-tar-tree.sh | 10 +++++-----
2 files changed, 10 insertions(+), 5 deletions(-)
@@ -25,8 +25,13 @@ static int write_tar_filter_archive(const struct archiver *ar,**Likewiseforthemtime(whichhappenstouseabufferofthesamesize).*/+#if ULONG_MAX == 0xFFFFFFFF+#define USTAR_MAX_SIZE ULONG_MAX+#define USTAR_MAX_MTIME ULONG_MAX+#else#define USTAR_MAX_SIZE 077777777777UL#define USTAR_MAX_MTIME 077777777777UL+#endif/* writes out the whole block, but only if it is full */staticvoidwrite_if_needed(void)
@@ -360,7 +360,7 @@ test_expect_success 'set up repository with huge blob' '# We expect git to die with SIGPIPE here (otherwise we# would generate the whole 64GB).-test_expect_success'generate tar with huge size''+test_expect_successLONG_IS_64BIT'generate tar with huge size''{gitarchiveHEADecho$?>exit-code
@@ -369,13 +369,13 @@ test_expect_success 'generate tar with huge size' 'test_cmpexpectexit-code'-test_expect_successTAR_HUGE'system tar can read our huge size''+test_expect_successTAR_HUGE,LONG_IS_64BIT'system tar can read our huge size''echo68719476737>expect&&tar_infohuge.tar|cut-d" "-f1>actual&&test_cmpexpectactual'-test_expect_success'set up repository with far-future commit''+test_expect_successLONG_IS_64BIT'set up repository with far-future commit''rm-f.git/index&&echocontent>file&&gitaddfile&&
@@ -383,11 +383,11 @@ test_expect_success 'set up repository with far-future commit' 'gitcommit-m"tempori parendum"'-test_expect_success'generate tar with future mtime''+test_expect_successLONG_IS_64BIT'generate tar with future mtime''gitarchiveHEAD>future.tar'-test_expect_successTAR_HUGE'system tar can read our future mtime''+test_expect_successTAR_HUGE,LONG_IS_64BIT'system tar can read our future mtime''echo4147>expect&&tar_infofuture.tar|cut-d" "-f2>actual&&test_cmpexpectactual
From: Junio C Hamano <hidden> Date: 2016-07-14 20:50:05
So here is the final reroll from me for now that targets 'maint'
(eventually).
Jeff King (1):
t0006: skip "far in the future" test when unsigned long is not long
enough
Junio C Hamano (1):
archive-tar: huge offset and future timestamps would not work on
32-bit
archive-tar.c | 5 +++++
help.c | 6 ++++++
t/t0006-date.sh | 6 +++---
t/t5000-tar-tree.sh | 10 +++++-----
t/test-lib.sh | 9 +++++++++
5 files changed, 28 insertions(+), 8 deletions(-)
--
2.9.1-545-g8c0a069
From: Junio C Hamano <hidden> Date: 2016-07-14 20:50:23
From: Jeff King <redacted>
Git's source code refers to timestamps as unsigned longs. On 32-bit
platforms, as well as on Windows, unsigned long is not large enough
to capture dates that are "absurdly far in the future".
While we can fix this issue properly by replacing unsigned long with
a larger type, we want to be a bit more conservative and just skip
those tests on the maint track.
Signed-off-by: Jeff King <redacted>
Helped-by: Johannes Schindelin [off-list ref]
Signed-off-by: Junio C Hamano <redacted>
---
help.c | 6 ++++++
t/t0006-date.sh | 6 +++---
t/test-lib.sh | 9 +++++++++
3 files changed, 18 insertions(+), 3 deletions(-)
@@ -419,6 +419,12 @@ int cmd_version(int argc, const char **argv, const char *prefix)*withexternalprojectsthatrelyontheoutputof"git version".*/printf("git version %s\n",git_version_string);+while(*++argv){+if(!strcmp(*argv,"--build-options")){+printf("sizeof-long: %d\n",(int)sizeof(long));+/* NEEDSWORK: also save and output GIT-BUILD_OPTIONS? */+}+}return0;}
From: Jeff King <hidden> Date: 2016-07-14 22:20:56
On Thu, Jul 14, 2016 at 01:43:57PM -0700, Junio C Hamano wrote:
As we are not yet moving everything to size_t but still using ulong
internally when talking about the size of object, platforms with
32-bit long will not be able to produce tar archive with 4GB+ file,
and cannot grok 077777777777UL as a constant. Disable the extended
header feature and do not test it on them.
I tried testing this in a VM with 32-bit Debian. It fixes the build
problems, but t5000 still fails.
I think you need to add the prereq to one more test:
@@ -347,7 +347,7 @@ test_lazy_prereq TAR_HUGE 'test_cmpexpectactual'-test_expect_success'set up repository with huge blob''+test_expect_successLONG_IS_64BIT'set up repository with huge blob''obj_d=19&&obj_f=f9c8273ec45a8938e6999cb59b3ff66739902a&&obj=${obj_d}${obj_f}&&
We shouldn't be accessing the blob in update-index, but I think "git
commit" does so for the diff (and then after seeing the size says
"whoops, that's binary", but even the size check fails on 32-bit
systems).
So another solution would be to use "commit -q" at the end of that test.
I don't think there's much point, though; it's just setting up a state
for other tests that need LONG_IS_64BIT.
As an aside, it is inadvertently testing that our diff code does not
bother to read the whole blob in such a case. Which maybe argues for
using "commit -q", just because that is not a thing we are intending to
test here.
-Peff
From: Johannes Schindelin <hidden> Date: 2016-07-15 15:10:46
Hi Junio,
On Thu, 14 Jul 2016, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
Yeah, that is what I was trying to get at, but you stated it much more
clearly. LONG_IS_64BIT is good. I wonder if the "git version
--build-options" should be "sizeof-long", too. It's shorter, and
indicates our assumption that we are talking about all longs, not just
unsigned ones.
OK, I'll do a final reroll and then wait for Europeans ;-)
Don't let me stand in the way of progress.
I would have preferred two separate prereqs, of course, for the same
reason we use time_t and off_t: I find it better to describe what the
prereq is about, and I do not mean implementation details here.
But that does not matter all that much. We will have to address the issues
anyway, and at that point that wart will be removed and we will all go on
with our lives.
So what are your plans with 2.9.2? I ask because I do not want to engineer
a 2.9.1 release just to see that 2.9.2 is out and having to spend the same
amount of time for another release ;-)
Ciao,
Dscho