[gentoo-dev] Google API Go Client packages; slotting?

2016-03-20 Thread Andrew Udvare
https://github.com/google/google-api-go-client/

Looking at these to generate ebuilds for (with a script and GitHub API).
There might be an issue with assuming versions supersede (otherwise why
would they keep multiple versions up?). I think slotting may be the real
solution to that. Is that ugly? Or should multiple versions installed
never be supported?

Currently I'm re-wrapping https://github.com/odeke-em/drive (I had done
this before when there were no Go helper eclasses).

Andrew



Re: [gentoo-dev] Google API Go Client packages; slotting?

2016-03-21 Thread Zac Medico
On 03/20/2016 11:45 PM, Andrew Udvare wrote:
> https://github.com/google/google-api-go-client/
> 
> Looking at these to generate ebuilds for (with a script and GitHub API).
> There might be an issue with assuming versions supersede (otherwise why
> would they keep multiple versions up?).

Can you clarify which versions you're talking about? We shouldn't slot
it if the new versions are backward compatible.

> I think slotting may be the real
> solution to that. Is that ugly? Or should multiple versions installed
> never be supported?

Only slot if the new version is not backward compatible.

> Currently I'm re-wrapping https://github.com/odeke-em/drive (I had done
> this before when there were no Go helper eclasses).

Oh, that could be handy for drive users.
-- 
Thanks,
Zac



Re: [gentoo-dev] Google API Go Client packages; slotting?

2016-03-21 Thread Andrew Udvare
On 21/03/16 00:05, Zac Medico wrote:
> On 03/20/2016 11:45 PM, Andrew Udvare wrote:
>> https://github.com/google/google-api-go-client/
>>
>> Looking at these to generate ebuilds for (with a script and GitHub API).
>> There might be an issue with assuming versions supersede (otherwise why
>> would they keep multiple versions up?).
> 
> Can you clarify which versions you're talking about? We shouldn't slot
> it if the new versions are backward compatible.

The version numbers are the packages like:

google.golang.org/api/adexchangebuyer/v1.2
google.golang.org/api/adexchangebuyer/v1.3
google.golang.org/api/adexchangebuyer/v1.4

I was thinking to make something like:

dev-go/go-google-api-adexchangebuyer1.2
dev-go/go-google-api-adexchangebuyer1.3
dev-go/go-google-api-adexchangebuyer1.4

Then of course slotting seems valid so the version suffix can go away,
if these are not compatible.

> Only slot if the new version is not backward compatible.

I agree on this slotting policy. It definitely is a bit hard to tell if
they are backward compatible in an automated fashion.

I think these may be compatible in many cases, however even though some
things may remain the same between versions, the API endpoint changes
with these numbers. It is hard to figure out compatibility and I think
the general assumption by developers is none.

>> Currently I'm re-wrapping https://github.com/odeke-em/drive (I had done
>> this before when there were no Go helper eclasses).
> 
> Oh, that could be handy for drive users.
> 
It's a decent alternative to what was Grive. Although I have only
learned recently of the fork to fix Grive for the newer APIs (already on
Portage).

The other option on building Drive is to emulate `go get` (put itself
and all deps in SRC_URI and fix up a GOROOT to compile with). Some
packages already do this partially, like go-oauth2 which grabs other
things in SRC_URI that could be separated out.

Go is nice, but is difficult to package.

Andrew



Re: [gentoo-dev] Google API Go Client packages; slotting?

2016-03-21 Thread Zac Medico
On 03/21/2016 12:44 AM, Andrew Udvare wrote:
> On 21/03/16 00:05, Zac Medico wrote:
>> On 03/20/2016 11:45 PM, Andrew Udvare wrote:
>>> Currently I'm re-wrapping https://github.com/odeke-em/drive (I had done
>>> this before when there were no Go helper eclasses).
>>
>> Oh, that could be handy for drive users.
>>
> It's a decent alternative to what was Grive. Although I have only
> learned recently of the fork to fix Grive for the newer APIs (already on
> Portage).
> 
> The other option on building Drive is to emulate `go get` (put itself
> and all deps in SRC_URI and fix up a GOROOT to compile with). Some
> packages already do this partially, like go-oauth2 which grabs other
> things in SRC_URI that could be separated out.
> 
> Go is nice, but is difficult to package.

Yeah, I know. Anyway, I went ahead and packaged it. Please try it out
and file bugs if there's anything wrong:

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2ebd6535d66e0ba011c1a1beeb33df570dcff8d
-- 
Thanks,
Zac



Re: [gentoo-dev] Google API Go Client packages; slotting?

2016-03-22 Thread Andrew Udvare
On 21/03/16 02:27, Zac Medico wrote:
> Yeah, I know. Anyway, I went ahead and packaged it. Please try it out
> and file bugs if there's anything wrong:
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2ebd6535d66e0ba011c1a1beeb33df570dcff8d
> 
Works well, except on hardened I get this:

drive: error while loading shared libraries: cannot make segment
writable for relocation: Permission denied

strace output:

execve("/usr/bin/drive", ["drive"], [/* 59 vars */]) = 0
brk(0)  = 0x1b63e83750
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x3d6f913c000
access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=82250, ...}) = 0
mmap(NULL, 82250, PROT_READ, MAP_PRIVATE, 3, 0) = 0x3d6f911d000
close(3)= 0
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3,
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360`\0\0\0\0\0\0"...,
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=133656, ...}) = 0
mmap(NULL, 2212496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x3d6f8cf5000
mprotect(0x3d6f8d0d000, 2093056, PROT_NONE) = 0
mmap(0x3d6f8f0c000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x3d6f8f0c000
mmap(0x3d6f8f0e000, 12944, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3d6f8f0e000
close(3)= 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3,
"\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\v\2\0\0\0\0\0"...,
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1730032, ...}) = 0
mmap(NULL, 3838936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x3d6f8945000
mprotect(0x3d6f8ae5000, 2093056, PROT_NONE) = 0
mmap(0x3d6f8ce4000, 24576, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19f000) = 0x3d6f8ce4000
mmap(0x3d6f8cea000, 17368, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3d6f8cea000
close(3)= 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x3d6f913b000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x3d6f9135000
arch_prctl(ARCH_SET_FS, 0x3d6f9135740)  = 0
mprotect(0x3d6f8ce4000, 16384, PROT_READ) = 0
mprotect(0x3d6f8f0c000, 4096, PROT_READ) = 0

mprotect(0x1b617f6000, 12369920, PROT_READ|PROT_WRITE) = -1 EACCES
(Permission denied)

writev(2, [{"drive", 5}, {": ", 2}, {"error while loading shared
libra"..., 36}, {": ", 2}, {"", 0}, {"", 0}, {"cannot make segment
writable for"..., 43}, {": ", 2}, {"Permission denied", 17}, {"\n", 1}],
10drive: error while loading shared libraries: cannot make segment
writable for relocation: Permission denied
) = 108
exit_group(127) = ?
+++ exited with 127 +++



Re: [gentoo-dev] Google API Go Client packages; slotting?

2016-03-22 Thread Zac Medico
On 03/22/2016 12:33 AM, Andrew Udvare wrote:
> On 21/03/16 02:27, Zac Medico wrote:
>> Yeah, I know. Anyway, I went ahead and packaged it. Please try it out
>> and file bugs if there's anything wrong:
>>
>> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f2ebd6535d66e0ba011c1a1beeb33df570dcff8d
>>
> Works well, except on hardened I get this:
> 
> drive: error while loading shared libraries: cannot make segment
> writable for relocation: Permission denied
> 
> strace output:
> 
> execve("/usr/bin/drive", ["drive"], [/* 59 vars */]) = 0
> brk(0)  = 0x1b63e83750
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
> = 0x3d6f913c000
> access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or
> directory)
> open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=82250, ...}) = 0
> mmap(NULL, 82250, PROT_READ, MAP_PRIVATE, 3, 0) = 0x3d6f911d000
> close(3)= 0
> open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
> read(3,
> "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360`\0\0\0\0\0\0"...,
> 832) = 832
> fstat(3, {st_mode=S_IFREG|0755, st_size=133656, ...}) = 0
> mmap(NULL, 2212496, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
> 0) = 0x3d6f8cf5000
> mprotect(0x3d6f8d0d000, 2093056, PROT_NONE) = 0
> mmap(0x3d6f8f0c000, 8192, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x3d6f8f0c000
> mmap(0x3d6f8f0e000, 12944, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3d6f8f0e000
> close(3)= 0
> open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
> read(3,
> "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\v\2\0\0\0\0\0"...,
> 832) = 832
> fstat(3, {st_mode=S_IFREG|0755, st_size=1730032, ...}) = 0
> mmap(NULL, 3838936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
> 0) = 0x3d6f8945000
> mprotect(0x3d6f8ae5000, 2093056, PROT_NONE) = 0
> mmap(0x3d6f8ce4000, 24576, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19f000) = 0x3d6f8ce4000
> mmap(0x3d6f8cea000, 17368, PROT_READ|PROT_WRITE,
> MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3d6f8cea000
> close(3)= 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
> = 0x3d6f913b000
> mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
> = 0x3d6f9135000
> arch_prctl(ARCH_SET_FS, 0x3d6f9135740)  = 0
> mprotect(0x3d6f8ce4000, 16384, PROT_READ) = 0
> mprotect(0x3d6f8f0c000, 4096, PROT_READ) = 0
> 
> mprotect(0x1b617f6000, 12369920, PROT_READ|PROT_WRITE) = -1 EACCES
> (Permission denied)
> 
> writev(2, [{"drive", 5}, {": ", 2}, {"error while loading shared
> libra"..., 36}, {": ", 2}, {"", 0}, {"", 0}, {"cannot make segment
> writable for"..., 43}, {": ", 2}, {"Permission denied", 17}, {"\n", 1}],
> 10drive: error while loading shared libraries: cannot make segment
> writable for relocation: Permission denied
> ) = 108
> exit_group(127) = ?
> +++ exited with 127 +++
> 

There's some information about this type of error here:

https://wiki.gentoo.org/wiki/Hardened/FAQ#I_keep_getting_the_message:_.22error_while_loading_shared_libraries:_cannot_make_segment_writable_for_relocation:_Permission_denied..22_What_does_this_mean.3F

Please file a bug, and we'll see about resolving it.
-- 
Thanks,
Zac