RE: Porting git to HP NonStop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Shawn Pearce [mailto:spearce@xxxxxxxxxxx]
> Sent: Friday, August 10, 2012 6:28 PM
> To: Joachim Schmitz
> Cc: git@xxxxxxxxxxxxxxx; rsbecker@xxxxxxxxxxxxx
> Subject: Re: Porting git to HP NonStop
> 
> On Fri, Aug 10, 2012 at 8:04 AM, Joachim Schmitz <jojo@xxxxxxxxxxxxxxxxxx>
> wrote:
> >>
> >> - HP NonStop is lacking poll(), git is making quite some use of it.
> >> My Solution: I 'stole' the implementation from GNUlib, which
> >> implements
> >> poll() using select().
> >> Git should either provide its own poll(), not use it at all or resort
> >> to
> > using
> >> GNUlib, what do you think?.
> 
> poll() is usually better than select() because you don't need to worry
about
> FD_SETSIZE. That said, the compat/ directory contains implementations of
> some functions. You could contribute a fake poll that uses select if it
was under
> the GPLv2.

This is what I did. Just to see now that compat/win32/poll.c has exacly the
same stuff...
 
> >> - HP NonStop is lacking getrlimit(), fsync(), setitimer() and memory
> > mapped IO.
> >> For now I've commented out the part that used getrlimit() and use a
> >> home brewed implementation for fsync(), setitimer() and mmap().
> 
> There is no need to define your own mmap(). Define NO_MMAP=1 in the
> Makefile. Git already has its own fake mmap and knows how to write it back
to
> disk when making changes.

Ah, excellent. Esp. as our home brewed implementation is pretty primitive.

> >> - git makes use of some C99 features or at least feature that are not
> > availabe in
> >> C89, like 'inline'
> >> C89 is the default compiler on HP NonStop, but we also habe a c99
> > compiler, so
> >> telling configure to search for c99  should help here.
> 
> You could also disable inline by #define inline /**/, but this will
probably result
> in a slower binary.

Even our C99 compiler doesn't inline, it merly recognizes the keyword and
then warns about (unable to inline...)
But there are other C99 features used too.

> >> - HP NonStop doesn't have stat.st_blocks, this is used in
> > builtin/count-objects.c
> >> around line 45, not sure yet how to fix that.
> 
> IIRC the block count is only used to give the user some notion of how much
disk
> was wasted by the repository. You could hack a macro that redefines this
as
> st_size.

OK, thanks, will try that.

> >> - HP NonStop doesn't have stat.st_?time.nsec, there are several
> >> places
> > what an
> >> "#ifdef USE_NSEC" is missing, I can provide a diff if needed
> >> (offending
> >> files: builtin/fetch-pack.c and read-cache.c).
> 
> I think this would be appreciated by anyone else that has a similar
problem
> where the platform lacks nsec.

Will do.
 
> >> - Once compiled and installed, a simple
> >> jojo@\hpitug:/home/jojo/GitHub $
> > git
> >> clone git://github.com/git/git.git fails with:
> >> /home/jojo/GitHub/git/.git/branches/: No such file or directory After
> > creating
> >> those manually it fails because the directory isn't empty,
> >> catch-22
> >> After some trial'n'error I found that the culprit seems to be the
> > subdirectories
> >> branches, hook and info in /usr/local/share/git-core/templates/, if I
> >> remove/rename those, the above command works fine.
> >> I have no idea why that is nor how to properly fix it, anyone out
there?
> 
> This sounds like the templates directory was not created correctly during
> installation, or is being copied incorrectly during the git init process.
I would
> start by comparing the structure and permissions of the templates
directory on
> your HP NonStop system to one on a Linux system and see if there was a
> mistake made during the installation process. If the directory matches, I
would

jojo@\hpitug:/usr/local/share/git-core/templates $ ls -laR
total 41
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 12:10 .
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 08:19 ..
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 07:26 branches
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 07:26 hooks
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 07:26 info
-rw-r--r--    1 SUPER.SUPER        SUPER         73 Aug 10 07:26 description

./branches:
total 16
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 07:26 .
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 12:10 ..

./hooks:
total 43
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 07:26 .
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 12:10 ..
-rwxr-xr-x    1 SUPER.SUPER        SUPER        452 Aug 10 07:26
applypatch-msg.sample
-rwxr-xr-x    1 SUPER.SUPER        SUPER        896 Aug 10 07:26
commit-msg.sample
-rwxr-xr-x    1 SUPER.SUPER        SUPER        189 Aug 10 07:26
post-update.sample
-rwxr-xr-x    1 SUPER.SUPER        SUPER        398 Aug 10 07:26
pre-applypatch.sample
-rwxr-xr-x    1 SUPER.SUPER        SUPER       1704 Aug 10 07:26
pre-commit.sample
-rwxr-xr-x    1 SUPER.SUPER        SUPER       4957 Aug 10 07:26
pre-rebase.sample
-rwxr-xr-x    1 SUPER.SUPER        SUPER       1251 Aug 10 07:26
prepare-commit-msg.sample
-rwxr-xr-x    1 SUPER.SUPER        SUPER       3611 Aug 10 07:26
update.sample

./info:
total 17
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 07:26 .
drwxr-xr-x    1 SUPER.SUPER        SUPER       4096 Aug 10 12:10 ..
-rw-r--r--    1 SUPER.SUPER        SUPER        240 Aug 10 07:26 exclude
jojo@\hpitug:/usr/local/share/git-core/templates $

SUPER.SUPER on NonStop is equivalent to root in UNIX. Everything is readable
to everybody. Looks OK to me?

> then use `git init --bare` in a new directory to copy in the templates,
and see if
> its the template copying code that is making an incorrect copy.

"git init --bare" gives the same error. It isn't copying any of the
subdirectories, only the file 'description'

Bye, Jojo

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]