threads / patch / 35297

patch, 5 partsfix up 'jk/pack-bitmap' branch

Subject: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

## tl;dr

10 messages between Nov 7, 2013 and Nov 9, 2013. Diffs are folded; open one to read it.

replies: 9people: 6as markdown or json

Ramsay Jones· Nov 7, 2013, 21:58 UTC · lore
Hi Jeff,

These patches fix various errors/warnings on the cygwin, MinGW and msvc builds, provoked by the jk/pack-bitmap branch.

Note that this does not fix all problems on the msvc build; I have a solution, but I don't like it. :-D So, I'm going to try a different fix. I had hoped to have done this by now, but ... (hopefully, sometime this weekend).

Note that I have only tested the cygwin and MinGW builds by running the t5310-pack-bitmaps.sh test, and only on a little-endian machine. (Torsten has tested the first patch on a big-endian)

Note also, that these patches are build on top of the 'pu' branch as of yesterday (pu @ 2b65d9ebc).

So, could you please squash these patches into the relevant commits on your branch.

Thanks!

ATB, Ramsay Jones

Ramsay Jones (5):
  compat/bswap.h: Fix build on cygwin, MinGW and msvc
  Makefile: Add object files in ewah/ to clean target
  khash.h: Spell the null pointer as NULL
  pack-objects: Limit visibility of 'indexed_commits' symbols
  ewah_bitmap.c: Fix printf format warnings on MinGW
 Makefile               |  5 +--
 builtin/pack-objects.c |  6 ++--
 compat/bswap.h         | 97 +++++++++++++++++++++++++++++++++++---------------
 ewah/ewah_bitmap.c     |  6 ++--
 khash.h                |  2 +-
 5 files changed, 79 insertions(+), 37 deletions(-)
-- 
1.8.4
Jeff King· Nov 7, 2013, 22:19 UTC · re: Ramsay Jones · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

On Thu, Nov 07, 2013 at 09:58:02PM +0000, Ramsay Jones wrote:
> These patches fix various errors/warnings on the cygwin, MinGW and
> msvc builds, provoked by the jk/pack-bitmap branch.

Thanks. Your timing is impeccable, as I was just sitting down to finalize the next re-roll. I'll add these in.

-Peff
Vicent Martí· Nov 8, 2013, 01:39 UTC · re: Jeff King · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

Thank you Ramsay, all the patches look OK to me.
On Thu, Nov 7, 2013 at 11:19 PM, Jeff King <peff@peff.net> wrote:
Show 9 quoted lines
> On Thu, Nov 07, 2013 at 09:58:02PM +0000, Ramsay Jones wrote:
>
>> These patches fix various errors/warnings on the cygwin, MinGW and
>> msvc builds, provoked by the jk/pack-bitmap branch.
>
> Thanks. Your timing is impeccable, as I was just sitting down to
> finalize the next re-roll. I'll add these in.
>
> -Peff
Torsten Bögershausen· Nov 8, 2013, 17:10 UTC · re: Jeff King · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

On 2013-11-07 23.19, Jeff King wrote:
Show 9 quoted lines
> On Thu, Nov 07, 2013 at 09:58:02PM +0000, Ramsay Jones wrote:
> 
>> These patches fix various errors/warnings on the cygwin, MinGW and
>> msvc builds, provoked by the jk/pack-bitmap branch.
> 
> Thanks. Your timing is impeccable, as I was just sitting down to
> finalize the next re-roll. I'll add these in.
> 
> -Peff

Side question: Do we have enough test coverage for htonll()/ntohll(), or do we want do the "module test" which I send a couple of days before ? /Torsten

Ramsay Jones· Nov 8, 2013, 18:23 UTC · re: Torsten Bögershausen · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

On 08/11/13 17:10, Torsten Bögershausen wrote:
Show 14 quoted lines
> On 2013-11-07 23.19, Jeff King wrote:
>> On Thu, Nov 07, 2013 at 09:58:02PM +0000, Ramsay Jones wrote:
>>
>>> These patches fix various errors/warnings on the cygwin, MinGW and
>>> msvc builds, provoked by the jk/pack-bitmap branch.
>>
>> Thanks. Your timing is impeccable, as I was just sitting down to
>> finalize the next re-roll. I'll add these in.
>>
>> -Peff
> 
> Side question:
> Do we have enough test coverage for htonll()/ntohll(),
> or do we want do the "module test" which I send a couple of days before ?

Yes, sorry for not bringing that up; I didn't get to try (or even look at) your test patch, because I couldn't 'git am' it. :(

I've been meaning to look into why that is, but just haven't had time yet. (I think it may have something to do with your name - I've noticed in the past that any mail with utf8 characters causes problems.)

However, I should have alerted Jeff to your patch; sorry about that!

ATB, Ramsay Jones

Jeff King· Nov 8, 2013, 22:29 UTC · re: Torsten Bögershausen · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

On Fri, Nov 08, 2013 at 06:10:30PM +0100, Torsten Bögershausen wrote:
> Side question:
> Do we have enough test coverage for htonll()/ntohll(),
> or do we want do the "module test" which I send a couple of days before ?

The series adds tests for building and using the ewah bitmaps, which in turn rely on the htonll code. So they are being tested in the existing series.

-Peff
Torsten Bögershausen· Nov 9, 2013, 11:35 UTC · re: Jeff King · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

On 2013-11-08 23.29, Jeff King wrote:
Show 11 quoted lines
> On Fri, Nov 08, 2013 at 06:10:30PM +0100, Torsten Bögershausen wrote:
> 
>> Side question:
>> Do we have enough test coverage for htonll()/ntohll(),
>> or do we want do the "module test" which I send a couple of days before ?
> 
> The series adds tests for building and using the ewah bitmaps, which in
> turn rely on the htonll code. So they are being tested in the existing
> series.
> 
> -Peff

You are thinking about t5310-pack-bitmaps.sh ? If I do like this in compat/bswap.h

# define ntohll(n) (n) # define htonll(n) (n) (on an Intel processor, little endian)

then t5310 passes, even if the uint64_t words are written in little endian to disc instead of big endian.

What do I miss? /torsten

Johannes Sixt· Nov 9, 2013, 17:25 UTC · re: Torsten Bögershausen · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

Am 09.11.2013 12:35, schrieb Torsten Bögershausen:
Show 21 quoted lines
> On 2013-11-08 23.29, Jeff King wrote:
>> On Fri, Nov 08, 2013 at 06:10:30PM +0100, Torsten Bögershausen wrote:
>>
>>> Side question:
>>> Do we have enough test coverage for htonll()/ntohll(),
>>> or do we want do the "module test" which I send a couple of days before ?
>>
>> The series adds tests for building and using the ewah bitmaps, which in
>> turn rely on the htonll code. So they are being tested in the existing
>> series.
>>
>> -Peff
> You are thinking about t5310-pack-bitmaps.sh ?
> If I do like this in compat/bswap.h
> 
> # define ntohll(n) (n)
> # define htonll(n) (n)
> (on an Intel processor, little endian)
> 
> then t5310 passes, even if the uint64_t words are written
> in little endian to disc instead of big endian.

Of course. You write little endian and also read back little endian; that should work just fine, no?

OTOH, if you write with Intel and read with PPC, then you should observe misbehavior with the above patch.

-- Hannes
Thomas Rast· Nov 9, 2013, 21:03 UTC · re: Johannes Sixt · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

Johannes Sixt <j6t@kdbg.org> writes:
Show 16 quoted lines
> Am 09.11.2013 12:35, schrieb Torsten Bögershausen:
>>
>> If I do like this in compat/bswap.h
>> 
>> # define ntohll(n) (n)
>> # define htonll(n) (n)
>> (on an Intel processor, little endian)
>> 
>> then t5310 passes, even if the uint64_t words are written
>> in little endian to disc instead of big endian.
>
> Of course. You write little endian and also read back little endian;
> that should work just fine, no?
>
> OTOH, if you write with Intel and read with PPC, then you should observe
> misbehavior with the above patch.

Maybe you could check in a simple test that the bitmap for a very predictable pack (e.g. only one commit) has a certain content, by checking its hash. That would guard against accidental format changes.

-- 
Thomas Rast
tr@thomasrast.ch
Jeff King· Nov 9, 2013, 21:21 UTC · re: Thomas Rast · lore

Re: [PATCH 0/5] fix up 'jk/pack-bitmap' branch

On Sat, Nov 09, 2013 at 10:03:56PM +0100, Thomas Rast wrote:
Show 9 quoted lines
> > Of course. You write little endian and also read back little endian;
> > that should work just fine, no?
> >
> > OTOH, if you write with Intel and read with PPC, then you should observe
> > misbehavior with the above patch.
> 
> Maybe you could check in a simple test that the bitmap for a very
> predictable pack (e.g. only one commit) has a certain content, by
> checking its hash.  That would guard against accidental format changes.

Another option would be to cross-check reading and writing against JGit, which is valuable for other reasons besides checking endianness. I do not think most people will have JGit installed, but it's better than nothing (and if even one person runs it, we have a chance of finding a bug).

-Peff

← back to recent threads