Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-11 Thread Benda Xu
Hi anoteros,

anote...@teknik.io writes:

> Having used Gentoo for a few years now, one thing that has been
> annoying to me is the tremendous duplication of effort and uphill
> battle of creating ebuilds (build recipes) for language-specific
> packages that already have their own build systems.
>
> For example, many languages such as Python (pip), Node (npm), Ruby
> (gems), TeXLive (tlmgr), Haskell (cabal), Rust (cargo) have ways of
> redistributing up-to-date dependencies and ensuring that they build
> properly in most environments. Portage, it seems, does not take
> advantage of this at all. If I want to install the package 'foo',
> which has 'bar' as a dependency (which has been installed through
> cabal, for instance). Why should portage download some outdated second
> copy of the sources for 'bar', rebuild it, and scatter it around the
> file system where it cannot be used by other programs installed by
> cabal?

There have been quite a lot of effort before.  What I know are:

* R_Overlay

R_Overlay uses roverlay[1] to generate ebuilds from CRAN and BIOC.  It
works for 90% of the packages, and has a dozen of users.

The biggest burden of maintenance is parsing random strings upstream
would put in the dependency fields (e.g. [6]).


* Maven Overlay

It is based on java-ebuilder[2] to generate ebuilds from Java Maven
repository.  The proof of concept overlay works well for Apache
spark[3].

A bit of scripting resolved the incompatibility of version schemes
mentioned by kentnl[5].

I am proposing a GSOC idea to mentor a student on it,

  
https://wiki.gentoo.org/wiki/Google_Summer_of_Code/2018/Ideas/Maven_Java_overlay

* g-sorcery

A general purpose ebuild generator in Gentoo (app-portage/g-sorcery)[4],
I have been using it for pip (app-portage/gs-pypi) and elpa
(app-portage/gs-elpa).  It works but a bit out-of-date.  Help welcome.


>From my experiences with the ebuild generators, they can be made very
reliable and painless. 

By far IMHO the R Overlay is the most successful.  The overlay is
generated on a server exposed into layman list.  The generation process
needs to be maintained and can have bugs when the upstream evolves.  It
can be a pain for an average user to debug.

Therefore, Gentoo semi-offical automatic overlays from language-specific
repositories provides a promising potential solution.

Yours,
Benda

1. https://github.com/dywisor, developed by dywisor as a GSOC project
   with calchan.

2. https://github.com/gentoo/java-ebuilder, lead by fordfrog of the Java
   Project.

3. https://github.com/heroxbd/maven-overlay

4. developed by jauhien as a GSOC project.

5. 
https://archives.gentoo.org/gentoo-dev/message/487f5eb7b2d1ba00ae607b3f88bbb8c9

6. 
https://github.com/dywisor/roverlay/blob/master/config/simple-deprules.d/dev-libs



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-10 Thread Kent Fredric
On Wed, 7 Mar 2018 14:55:43 -0600
R0b0t1  wrote:

> I think you missed my point: Why are they easier to use?

Because it decouples your projects requirements from your OS and Vendor
requirements.

This becomes really useful if your OS/Vendor wishes to upgrade things
and force people to upgrade things, but your production software isn't
ready for it yet.

Having to block your entire OS from critical upgrades simply because of
that is just not great.

That doesn't mean I think this is the right approach, but it does
explain why people do that sort of thing. 

*especially* for people who aren't using Gentoo.


pgpC0PcxZZwZZ.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-09 Thread Kent Fredric
On Wed, 7 Mar 2018 11:06:47 -0500
anote...@teknik.io wrote:

> Having used Gentoo for a few years now, one thing that has been annoying
> to me is the tremendous duplication of effort and uphill battle of
> creating ebuilds (build recipes) for language-specific packages that
> already have their own build systems.

As much as this would be nice, for some ecosystems this is entirely impossible.

Notably, Perl would be an impossible target, because instead of using
package level dependencies like Gentoo does, it uses module level dependencies.

A package has >= 1 module. And to make matters interesting, "the
package" a given module ships in can change as a function of time.

Sometimes, 2 packages fuse to become 1, and other times, 1 splits to
become 2.

Within CPAN, this happens pretty transparently, mostly because they
don't actually have an ahead-of-time dependency resolution system.

Dependency resolution is performed via:

   1. Get the module name
   2. Fetch a copy of the index
   3. Look up module name in index
   4. Install resolved package

And that "index" is updated every time a new package is uploaded.

Which basically means that system is only useful for asking the
question "Where is the latest version of X", not "where is Y version of
X"

And to add insult to injury, CPAN's versioning scheme is incompatible
with Gentoo's.

( They have a right to, they had both versions and package management
before we did )

We have a hack of sorts to circumnavigate the version scheme[1]
situation, but it only works in one direction ( eg: you can convert
CPAN versions to normalised Gentoo versions, but not vice versa )

But solving the package/module version resolution missmatch is an
ongoing nightmare which all my efforts have so far concluded, that only
humans are capable of solving, and a large volume of my efforts
engaging with upstream have been driven by this single problem.

Native integration would be really nice, but alas, the best of my
understanding so far is its a giant fantasy that attracts lots of
people with good ideas, that ultimately all fail in application. ( And
part of that is because the upstream you're dealing with is not a
machine, but another human who is prone to deviating from spec on a
regular basis enough to cause headaches for us )

1: https://wiki.gentoo.org/wiki/Project:Perl/Version-Scheme


pgp5xHkRuVPfp.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-09 Thread Rich Freeman
On Fri, Mar 9, 2018 at 3:11 PM, R0b0t1  wrote:
> On Fri, Mar 9, 2018 at 10:17 AM, Alec Warner  wrote:
>> The containers are nominally stateless, so there is less chance of 'gunk'
>> building up and surprising me later. It also makes the lifecycle simpler.
>>
>> Obviously its somewhat harder for stateful services (databases, etc.) but I
>> suspect things like SANs (or Ceph) can really provide the storage backing
>> for the database.
>> (database "schema" cleanliness is perhaps a separate issue that I'll defer
>> for another time ;p)
>>
>
> Containers are stateless, which prevents programs from munging state,
> because there is none. This is okay except when one needs state, which
> one does for most desktop activities.
>

Containers don't have to be stateless.  However, if you want them to
be completely disposable then they obviously need to be.

Bind-mounting something into a container is a simple solution for many
situations.  If your desktop only stores state in /home then that is
probably very practical.  You still need to be able to rapidly build a
suitable desktop container and easily deploy it in the context of
something like a laptop.  But, I don't think this was being proposed
as a solution for desktops in the first place, which of course then
raises the issue that until they do cover desktops containers aren't
really a substitute for keeping your filesystem reasonably clean.

-- 
Rich



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-09 Thread R0b0t1
On Fri, Mar 9, 2018 at 10:17 AM, Alec Warner  wrote:
> The containers are nominally stateless, so there is less chance of 'gunk'
> building up and surprising me later. It also makes the lifecycle simpler.
>
> Obviously its somewhat harder for stateful services (databases, etc.) but I
> suspect things like SANs (or Ceph) can really provide the storage backing
> for the database.
> (database "schema" cleanliness is perhaps a separate issue that I'll defer
> for another time ;p)
>

Restated:

Containers are stateless, which prevents programs from munging state,
because there is none. This is okay except when one needs state, which
one does for most desktop activities.

This implies it doesn't solve the problem. Working around it may be
valid, but only if state can be preserved.

Cheers,
 R0b0t1



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-09 Thread Rich Freeman
On Fri, Mar 9, 2018 at 11:17 AM, Alec Warner  wrote:
>
> In contrast with disposable containers:
>
> Automated build process for my containers.
>
> If there is a bug in the build, I can throw my buggy containers away and
> build new ones.
>
> Containers are encouraged to be stateless, so logging in to the container as
> root is unlikely to scale well; the containers are likely to remain 'clean.'
>
> If my containers are dirty, I can just throw them away and build new ones.
>
> If I need to change roles, I can just destroy the webnode container and
> deploy a LDAP node container.
>
> The containers are nominally stateless, so there is less chance of 'gunk'
> building up and surprising me later. It also makes the lifecycle simpler.
>
> Obviously its somewhat harder for stateful services (databases, etc.) but I
> suspect things like SANs (or Ceph) can really provide the storage backing
> for the database.
> (database "schema" cleanliness is perhaps a separate issue that I'll defer
> for another time ;p)
>

Certainly this is a great way to approach things, but it is also not
the process we have in our handbook, and therefore it seems a bit much
to expect users to actually be following it.

If every one of our profiles shipped with an ansible config file or
similar that just results in a working image with a few edits this
would be somewhat more practical, though I'm not sure I've really seen
a clean solution for something like "docker on the desktop."  Docker
won't even fetch an IP address from my router using DHCP...

-- 
Rich



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-09 Thread Alec Warner
On Thu, Mar 8, 2018 at 11:44 AM, R0b0t1  wrote:

> On Wed, Mar 7, 2018 at 3:06 PM, Rich Freeman  wrote:
> > On Wed, Mar 7, 2018 at 3:55 PM, R0b0t1  wrote:
> >> On Wed, Mar 7, 2018 at 1:15 PM, Alec Warner  wrote:
> >>>
> >>> Because containers are awesome and are way easier to use.
> >>>
> >>
> >> I think you missed my point: Why are they easier to use?
> >>
> >
> > I suspect that he was equating "containers" with "Docker," which both
> > runs containers and also is an image management solution (one that I
> > don't particularly like, but probably because I don't have heavy needs
> > so I find myself fighting it more than anything else - it doesn't hurt
> > that for the life of me I can't get it to connect containers to my
> > bridge, and it seems like it is completely opposed to just using DHCP
> > to obtain IPs).
> >
> > But, if you're using Docker, sure, you can run whatever the command is
> > to download an image of a container with some software pre-installed
> > and run it.
> >
> > If you're using something other than Docker to manage your containers
> > then you still have to get the software you want to use installed in
> > your container image.
> >
>
> I think I was equating containers to Docker as well. My point was
> instead of trying to manage dependencies, containers allow people to
> shove everything into an empty root with no conflicts. The
> enthusiastic blog post seems to restate this.
>
>
I think the premise on which I disagree is that somehow portage (and
package managers in general)
somehow allow you to keep a system 'clean'. Clean being a generic sort of
idea like:

1) All system files are owned by a package.
2) Only the packages that need to be installed are installed.
3) As the administrator, I fully understand the state of the system at all
times.

This is a useful abstraction (because its how many people do systems
administration) but I don't like it for a few reasons.

1) People log in and run stuff as root. Stuff running as root doesn't have
to follow the rules of the PM, and so the system state can diverge (even by
accident.)
  a) (Note that 'People' is often 'me'; I'm not immune!
2) The PM itself (or the code it runs, such as pre / post installs) can
have bugs, and so those bugs also can cause stage to diverge.
3) In general, the state of the machine evolves organically over time.
  a) Start with a clean stage3.
  b) You install your configuration management software (puppet / cfengine
/ chef / whatever your CM is)
  c) You commit some code into your CM, but it has a bug, so you
accidentally mutate some unexpected state)
  d) Your CM is really great at doing things like "deploying a web node"
but its bad at "undeploying the web node" (perhaps you never implemented
this recipe.)
1) You deploy a web node CM recipe on your server. It works great and
runs as a web node for six months.
2) The web node is getting busy, so you decide to move servers. You run
your web node recipe on another server and decide to repurpose the server
in 1.
3) You deploy an LDAP node CM recipe on the server in 1. Maybe its also
still running the web node; maybe it has the web node files but not apache
(because you uninstalled it.)

To me this was systems administration in the 90s / 2000s. The case of 3
(organic machine growth over N years) was rampant. On physical machines and
VMs we commonly addressed this problem by having a machine + service
lifecycle, making reinstalls automated, and reinstalling machines when they
switched roles. Reinstalls were 'clean' and we built new installer images
weekly. It also means I can test my procedures and be sure that I can say,
deploy a new webnode or slave and not worry about never doing deploys; its
common for automation to go stale if unused.

I am reminded a bit of a security mindset; once the machine is compromised
its really hard to prove that its no longer compromised (which is why
backup + re-image is a common remediation in security-land.)
I tend to use this as well in machines. If I logged in and did stuff as
root, its probable its not in configuration management, the package manager
may not know, and its now 'unclean.'

Its also possible that you write CM recipes really well (or distribute all
software in packages maybe.) You don't have bugs very often, or you just
don't care about this idiom of "clean" machines. The intent of this text
was merely to provide context for my experience.

In contrast with disposable containers:

   1. Automated build process for my containers.
  1. If there is a bug in the build, I can throw my buggy containers
  away and build new ones.
   2. Containers are encouraged to be stateless, so logging in to the
   container as root is unlikely to scale well; the containers are likely to
   remain 'clean.'
  1. If my containers are dirty, I can just throw them away and build
  new ones.
   3. If I need to change roles, I can just 

Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-08 Thread Rich Freeman
On Thu, Mar 8, 2018 at 4:00 PM, R0b0t1  wrote:
> On Thu, Mar 8, 2018 at 11:50 AM, Rich Freeman  wrote:
>> If you have util-linux installed then try running (as any user - you
>> don't have to be root):
>> unshare -i -m -n -p -u -C -f --mount-proc -U -r  /bin/bash
>>
>
> Interesting. I hadn't found a good interface to containers and
> clone(2) besides Docker. Of course, I didn't look very hard. I half
> expect a "new" process model to develop around the kernel namespaces,
> as people realize GID separation only is too coarse.

Well, the original userspace tools are in app-emulation/lxc (I can see
how it ended up in this category, but obviously it doesn't fit).

Docker is the most popular one.

My personal favorite is systemd-nspawn.  That basically has almost
nothing to do with systemd per-se, but I have no idea if it can work
standalone.  It is a bit more minimal while still being fairly
functional.

unshare/nsenter are the util-linux commands that give relatively
direct access to the system calls themselves.  I used unshare to
illustrate that these really are just system calls and how you use
them is up to you.

>
> I still see some odd claims about container security, though: claiming
> containers are more secure than user accounts still seems odd to me,
> as if you don't trust the kernel to enforce user accounts, why trust
> it to enforce namespace separation?
>

I'm not sure I'd say that containers are more than user accounts
per-se, though with UID mapping it could be easier to avoid sharing
user/group IDs across different services that might otherwise share
them.

I'd say that the security of a container is a bit like the security of
running something in a chroot jail.  It is one additional level of
isolation that something needs to break out of.

Processes running as root inside a container (and I mean the real
root, not root in a user namespace like in my example - unless you ran
the command I gave while logged in as root) are not secure today as
far as I'm aware.  Sure, the isolation is such that a process isn't
going to accidentally escape from the container, so that is a form of
security.  However, a malicious process running as root inside a
container (or a chroot) is generally going to be able to escape if it
wants to.  Maybe some kernel hardening approaches would help with
that.

Also, a process running in a container has less info on the host,
especially if in a chroot (which is typically the case).  If you run a
shell as nobody you could probably glean quite a bit about what is
going on with the host, even if you can't directly touch most of it.
If you could run a process as nobody on many hosts maybe you could
identify which hosts you want to prioritize for further attacks.  If
they're doing the same thing on processes trapped in a
container+chroot then they're basically not going to know about any
other services on the host other than the one they've already hacked
into.

Stuff running as non-root inside a container should be very well
contained, barring kernel bugs.  As we saw a few months ago with
meltdown even running in a VM isn't a perfect guarantee of isolation.
But, I would agree that stuff running under a different UID is also
reasonably secure other than information leaks.

The main benefit of containers is isolation, IMO.  Stuff inside a
container just doesn't see anything outside, which means fewer
incompatibilities.  I run a bunch of nspawn containers mostly running
Gentoo (some with other distros inside), and the nice thing about it
is that when I update a container I know it only provides one service,
so I only have one service I need to test, vs doing a glibc update and
having to test everything.  On the other hand it is that many more
updates to do, and there is a bit more memory cost since libraries
aren't shared across them the way they would be if they all ran on the
host.

-- 
Rich



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-08 Thread R0b0t1
On Thu, Mar 8, 2018 at 11:50 AM, Rich Freeman  wrote:
> If you have util-linux installed then try running (as any user - you
> don't have to be root):
> unshare -i -m -n -p -u -C -f --mount-proc -U -r  /bin/bash
>

Interesting. I hadn't found a good interface to containers and
clone(2) besides Docker. Of course, I didn't look very hard. I half
expect a "new" process model to develop around the kernel namespaces,
as people realize GID separation only is too coarse.

I still see some odd claims about container security, though: claiming
containers are more secure than user accounts still seems odd to me,
as if you don't trust the kernel to enforce user accounts, why trust
it to enforce namespace separation?



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-08 Thread James Le Cuirot
On Wed, 7 Mar 2018 11:06:47 -0500
anote...@teknik.io wrote:

> Having used Gentoo for a few years now, one thing that has been annoying
> to me is the tremendous duplication of effort and uphill battle of
> creating ebuilds (build recipes) for language-specific packages that
> already have their own build systems.
> 
> For example, many languages such as Python (pip), Node (npm), Ruby
> (gems), TeXLive (tlmgr), Haskell (cabal), Rust (cargo) have ways of
> redistributing up-to-date dependencies and ensuring that they build
> properly in most environments.

I was expecting to see Java's Maven in this list. Gentoo Java is in
trouble because we have basically given up trying to keep up with the
ecosystem. The last time anything under dev-java was bumped, other than
JVMs and Tomcat-related stuff, was January 20th. We could be bumping 5
packages a day and still not keep up, never mind all the things we
haven't packaged at all yet.

Java's problem is somewhat unique in that although you can have
optional dependencies at runtime, unless you go out of your way
(and nobody ever does), all these optional dependencies are required
at build time. Suddenly a package that might normally only have 2
dependencies now has 20. But wait, that's just the first level of
dependencies! This can repeat on and on and you end up battered and
bruised having packaged 100 things but still not the one you actually
wanted.

I therefore put some thought into something along the lines of what you
have suggested. Java is supposed to be write (or really build) once,
run anywhere so why are we wasting time building things that we don't
have to? That's certainly why upstreams look at us like we're crazy
whenever we dare to contact them. If we can leverage Maven or whatever
to grab the platform-neutral dependencies for us, we can focus
attention on the few that have native libraries and also things like
icons, desktop entries, etc, that Maven doesn't deal with.

But how would this work? I thought perhaps the dependencies we don't
care about could be installed into a Maven repository, essentially
untracked by Portage but still self-contained, by fetching them in
src_unpack (or src_fetch, which I'd like to introduce) and then
installing them in pkg_preinst. However, unless src_fetch is
implemented, it would not be possible to install Java packages offline.
This approach would also break binary packages, effectively forcing
Java packages to have RESTRICT="bindist", although there would arguably
be little building to do anyway.

Apart from the fact that I haven't had time to do any of this, is this
even what Gentoo users want? I suspect not. But what's worse, this or a
totally stale or practically empty package repository?

Others have experimented with from-source ebuild generators but that
doesn't change the fact that putting all these ebuilds into the tree is
still a huge maintenance burden and because of the build time
dependency issue, end users will still have to build hundreds of
packages they don't even care about.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer


pgpui06L7uQ_G.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-08 Thread Rich Freeman
On Thu, Mar 8, 2018 at 11:44 AM, R0b0t1  wrote:
>
> I think I was equating containers to Docker as well. My point was
> instead of trying to manage dependencies, containers allow people to
> shove everything into an empty root with no conflicts. The
> enthusiastic blog post seems to restate this.
>

That is one of many things they can do.  You can also run a service
like apache in a container even if it is installed in the same root
filesystem as all your other applications.  (In fact, I think this is
sort-of the default behavior if you start apache with the systemd unit
supplied.)

Ultimately on linux the governing functionality are kernel namespaces
and chroot (and I guess you might lump in chuid).  Kernel namespaces
involve the various types of namespaces themselves, and then the
clone/setns/unshare system calls.  There are a lot of things you can
do with various applications of these, and you don't have to run a
process in every possible separated namespace.

I mention it mainly because people tend to limit themselves by
thinking that container=docker, when linux provides a number of system
calls that administrators can employ to do useful things, and you
don't need any kind of fancy management system to use any of them, any
more than you need any fancy tools to run chroot.

If you have util-linux installed then try running (as any user - you
don't have to be root):
unshare -i -m -n -p -u -C -f --mount-proc -U -r  /bin/bash

Congrats.  You are now root in a container.  You're in the same root
filesystem as always.  You'll note that you can't actually see
anything that you couldn't see before.  If you run ps -ea you'll see
that you're the only process running on the system.  Devices like
/dev/sda aren't actually accessible.  A lot of container managers
would mount a new /dev and just hide most of that stuff.  You can
probably imagine how something like this could be useful for isolating
processes.  Try mounting a tmpfs somewhere - you'll see you can do it.
The tmpfs will be invisible to other processes though that aren't
inside the container.

-- 
Rich



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-08 Thread R0b0t1
On Wed, Mar 7, 2018 at 3:06 PM, Rich Freeman  wrote:
> On Wed, Mar 7, 2018 at 3:55 PM, R0b0t1  wrote:
>> On Wed, Mar 7, 2018 at 1:15 PM, Alec Warner  wrote:
>>>
>>> Because containers are awesome and are way easier to use.
>>>
>>
>> I think you missed my point: Why are they easier to use?
>>
>
> I suspect that he was equating "containers" with "Docker," which both
> runs containers and also is an image management solution (one that I
> don't particularly like, but probably because I don't have heavy needs
> so I find myself fighting it more than anything else - it doesn't hurt
> that for the life of me I can't get it to connect containers to my
> bridge, and it seems like it is completely opposed to just using DHCP
> to obtain IPs).
>
> But, if you're using Docker, sure, you can run whatever the command is
> to download an image of a container with some software pre-installed
> and run it.
>
> If you're using something other than Docker to manage your containers
> then you still have to get the software you want to use installed in
> your container image.
>

I think I was equating containers to Docker as well. My point was
instead of trying to manage dependencies, containers allow people to
shove everything into an empty root with no conflicts. The
enthusiastic blog post seems to restate this.



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-08 Thread kuzetsa
On 03/07/2018 11:06 AM, anote...@teknik.io wrote:

> It seems reasonable to me to 'hook' portage into these
> other package managers, so that running 'emerge bar'
> would actually run 'cabal install bar' rather than
> downloading sources and running 'ghc'.

it gets tricky when there's no good way to even fetch
the source, I mean. Sorry about not proofreading:

On 03/08/2018 09:47 AM, kuzetsa wrote:
> dependencies which can't otherwise be satisfied is the
> point of the original poster / creator of this thread:

I'm certain I worded that wrong. My intent had been to
say that a point which //was not addressed by// the OP

(oops)



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-08 Thread kuzetsa
On 03/08/2018 07:25 AM, Michael Orlitzky wrote:
> On 03/08/2018 12:54 AM, Benda Xu wrote:
>>
>> This title itself is amusing enough
>>
>>   Motherfuckers need package management
>>
> 
> Which if it is not clear, is intended to be funny.
> 
> 

the colorful language was proportional to the enthusiasm.

decent info, even though the excited person who wrote it
made me roll my eyes (I clicked for the info ::shrug::)

as per this thread: NuGET (mentioned in the article) is
something I had briefly considered trying to hook into:

an upstream decided that one of their own libraries (it
was written / maintained by upstream) should be unbundled
rather than vendored, but instead of giving it standalone
packaging, they decided to make it only available via
NuGET. Since I had never used .NET before, I had no idea
what that even was, initially. It was a "an experience".

dependencies which can't otherwise be satisfied is the
point of the original poster / creator of this thread:

On 03/07/2018 11:06 AM, anote...@teknik.io wrote:

> Is this a feature/improvement other Gentoo users/developers
> would be interested in? If so, I would love to help discuss
> and potentially help with its implementation.
>

The problem with something like NuGET, is that I don't
know how to safely support the package manager itself.

I think it's a terrible idea to let "something like that"
loose on a gentoo system...

https://docs.microsoft.com/en-us/visualstudio/mac/nuget-walkthrough

^ I guess they officially support mac, but still.
what happens when the developer of a package manager
decide they need root access to your system, but then
do things "their way"? I've got some concerns.



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-08 Thread Michael Orlitzky
On 03/08/2018 12:54 AM, Benda Xu wrote:
> 
> This title itself is amusing enough
> 
>   Motherfuckers need package management
> 

Which if it is not clear, is intended to be funny.




Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Dawid Weglinski
2018-03-08 3:38 GMT+01:00 Benda Xu :

> Dear Rich,
>
> Rich Freeman  writes:
>
> > Everybody I know has these sorts of complaints about language-based
> > PMs, whether they prefer Ubuntu, or Debian, or CentOS, or whatever.
> > Nobody wants random programs downloading random stuff and dropping
> > orphan files all over their filesystem with no way to identify these
> > or clean them up.  They're usually written by the same sorts of people
> > who tell you to pipe curl into sudo bash...
>
> One observation.  There are a lot of people on this planet who will
> format their disk and reinstall their whatever operating systems upon
> getting fscked by random programs downloading random stuff and dropping
> orphan files all over their filesystem.  So far the volume of this group
> of people is growing fast.


I'm glad there are people who can take care of their stuff on desktop, but
imagine,
there are plenty of those, who run Gentoo on production and do not wish
some POS
to broke their system.




> That give an illusion of tolerance from the users, enouraging this evil
> to go deeper.
>
> Luckily in Gentoo, we are with competent friends who are taking care of
> their own systems.
>
> Cheers,
> Benda
>
>
>


-- 
Pozdrawiam
Dawid Węgliński


Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Benda Xu
Hi Folks,

Michael Orlitzky  writes:

> These other package managers don't solve any hard problems -- they're
> basically a fancy interface around wget and "git clone." Portage on the
> other hand has ~20 years of good ideas and hard work on the hard
> problems in package management. For example...

I just want to point out one very nice article by Michael thoroughly
discussing there issues:

  
http://michael.orlitzky.com/articles/motherfuckers_need_package_management.xhtml


This title itself is amusing enough

  Motherfuckers need package management


Benda








Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Benda Xu
Dear Rich,

Rich Freeman  writes:

> Everybody I know has these sorts of complaints about language-based
> PMs, whether they prefer Ubuntu, or Debian, or CentOS, or whatever.
> Nobody wants random programs downloading random stuff and dropping
> orphan files all over their filesystem with no way to identify these
> or clean them up.  They're usually written by the same sorts of people
> who tell you to pipe curl into sudo bash...

One observation.  There are a lot of people on this planet who will
format their disk and reinstall their whatever operating systems upon
getting fscked by random programs downloading random stuff and dropping
orphan files all over their filesystem.  So far the volume of this group
of people is growing fast.

That give an illusion of tolerance from the users, enouraging this evil
to go deeper.

Luckily in Gentoo, we are with competent friends who are taking care of
their own systems.

Cheers,
Benda




Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Rich Freeman
On Wed, Mar 7, 2018 at 3:55 PM, R0b0t1  wrote:
> On Wed, Mar 7, 2018 at 1:15 PM, Alec Warner  wrote:
>>
>> Because containers are awesome and are way easier to use.
>>
>
> I think you missed my point: Why are they easier to use?
>

I suspect that he was equating "containers" with "Docker," which both
runs containers and also is an image management solution (one that I
don't particularly like, but probably because I don't have heavy needs
so I find myself fighting it more than anything else - it doesn't hurt
that for the life of me I can't get it to connect containers to my
bridge, and it seems like it is completely opposed to just using DHCP
to obtain IPs).

But, if you're using Docker, sure, you can run whatever the command is
to download an image of a container with some software pre-installed
and run it.

If you're using something other than Docker to manage your containers
then you still have to get the software you want to use installed in
your container image.

-- 
Rich



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread R0b0t1
On Wed, Mar 7, 2018 at 1:15 PM, Alec Warner  wrote:
>
>
> On Wed, Mar 7, 2018 at 1:22 PM, R0b0t1  wrote:
>>
>> On Wed, Mar 7, 2018 at 11:52 AM, Alec Warner  wrote:
>> > On Wed, Mar 7, 2018 at 11:51 AM, Michael Orlitzky 
>> > wrote:
>> >>
>> >> On 03/07/2018 11:06 AM, anote...@teknik.io wrote:
>> >> > Why should portage download some outdated second copy of the
>> >> > sources for 'bar', rebuild it, and scatter it around the file system
>> >> > where it cannot be used by other programs installed by cabal?
>> >>
>> >
>> > I'm really not happy with the tone of this email, so I'm going to
>> > comment on
>> > it a bit.
>> >
>>
>> I can't help but agree with Mr. Orlitzky's sentiment. All language
>> package managers suffer from the same sophomoric problems:
>>
>>
>> 1) I usually don't know where things are downloaded from.
>> 2) I can't integrate these changes with my distrbution (Gentoo,
>> Ubuntu, Debian, Fedora, CentOS) safely without serious work.
>> 3) I can't figure out easily what dependencies a package has. Usually
>> I see if there are compile or runtime errors. Sometimes the
>> dependencies are listed somewhere. If the dependency is not what is
>> currently in e.g. Ubuntu's repository, I may have to maintain separate
>> versions to be compatible.
>> 4) Sometimes they aren't set up to be built at all. Let the magic
>> package manager do everything for you. This works, except when your
>> shared objects are not in the right places. (But it makes me feel
>> dirty.)
>>
>> >>
>> >> These other package managers don't solve any hard problems -- they're
>> >> basically a fancy interface around wget and "git clone." Portage on the
>> >> other hand has ~20 years of good ideas and hard work on the hard
>> >> problems in package management. For example...
>> >
>> >
>> > Portage is also full of not-good ideas; many of these we papered over
>> > with
>> > PMS and EAPI to make
>> > the actual API people use less horrific. Lets not preach from our ivory
>> > tower here.
>> >
>>
>> The magnitude of "not good" is, I would suggest, very different.
>>
>> Cabal is a pretty hilarious example. Have you ever tried to build it
>> without using the release binaries? I suppose this is a second problem
>> though, where people want to be "self-reliant" and instead just end up
>> making things impossible to verify or make reproducible.
>>
>> For the longest time Cabal did not authenticate or verify the code it
>> would run (as root). Very recently this was fixed, but I still feel
>> bad any time I let it run, even if it's on a separate development
>> system.
>
>
> Gentoo just got signature checking enabled by default...in ~arch? I'm not
> sure if that version of portage is stable yet.
> Like I said, be careful how one preaches from the ivory tower.
>

webrsync-gpg has been an option for a long time.

Package maintenance for Gentoo is not the ivory tower. If anything,
the ivory tower is language development, in that tower the language
developers are isolated from the wider reaching consequences of their
actions.

>>
>>
>> >>
>> >> > It seems reasonable to me to 'hook' portage into these other package
>> >> > managers, so that running 'emerge bar' would actually run 'cabal
>> >> > install
>> >> > bar'
>> >>
>> >> Can "cabal install" build or even identify the C libraries that your
>> >> Haskell package needs? No, because nobody ever thought of that, and it
>> >> seems kind of hard now that the cabal build system has no ability to
>> >> build non-Haskell packages, so no one is ever going to work on it.
>> >>
>> >> Can "cabal install" rebuild your Haskell packages when the ABI of some
>> >> library changes? No, because "cabal install" doesn't have any idea
>> >> what's installed on your system.
>> >>
>> >> Can "cabal install" uninstall a package? Nope, it has no idea what was
>> >> done during the installation, and thus no idea what to undo.
>> >>
>> >> Can "cabal install" verify the integrity of your downloaded source
>> >> code?
>> >> No, because by design it fetches and runs code from complete strangers.
>> >>
>> >> Can "cabal install" use a local tarball to function without network
>> >> access? Etc. We're dead in the water.
>> >>
>> >> Every other language-specific package manager has the same problems,
>> >> because they're all written by people who didn't know anything about
>> >> package management and then got bored when they realized that there's
>> >> more to it than parsing a json file of dependencies.
>> >>
>> >
>> > They are written by people who are not you, who have different problems
>> > than
>> > you and often don't care about the above use cases.
>> > It turns out this stuff exists because:
>> >
>> > 1) Upstream wants to push 1 single thing and have it work in all
>> > distros.
>> > 2) pip / virtualenv / cargo / whatever work reasonable well.
>> > 3) Rolling-based distros couldn't keep up with packaging.
>> > 4) Snapshot-based distros 

Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Alec Warner
On Wed, Mar 7, 2018 at 3:12 PM, Michael Orlitzky  wrote:

> On 03/07/2018 12:52 PM, Alec Warner wrote:
> >
> > I'm really not happy with the tone of this email, so I'm going to
> > comment on it a bit.
> >
>
> Ok, it would have benefited from a do-I-sound-like-a-dick proofread. I
> don't want to sound discouraging because this is an area with lots of
> room for improvement. A better conclusion:
>
> Ultimately, people want to integrate the various PMs with portage
> because portage is pretty good at keeping your system reliable,
> up-to-date, and secure. The language-specific PMs on the other hand only
> care about ease of use and how fast they can get bleeding-edge releases
> to you. Having both would be ideal, but if we simply shell out to the
> language-specific PM, then that would sidestep the good parts of portage
> making the integration pointless. The time and attention involved in
> ebuild packaging turn out to be critical parts of the product.
>
>
I really appreciate this reply. I also think that portage provides a lot of
value (particularly for complex projects that are perhaps not
so well suited for use with the less featureful tooling.)

-A


Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Michael Orlitzky
On 03/07/2018 12:52 PM, Alec Warner wrote:
> 
> I'm really not happy with the tone of this email, so I'm going to
> comment on it a bit.
>  

Ok, it would have benefited from a do-I-sound-like-a-dick proofread. I
don't want to sound discouraging because this is an area with lots of
room for improvement. A better conclusion:

Ultimately, people want to integrate the various PMs with portage
because portage is pretty good at keeping your system reliable,
up-to-date, and secure. The language-specific PMs on the other hand only
care about ease of use and how fast they can get bleeding-edge releases
to you. Having both would be ideal, but if we simply shell out to the
language-specific PM, then that would sidestep the good parts of portage
making the integration pointless. The time and attention involved in
ebuild packaging turn out to be critical parts of the product.



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Alec Warner
On Wed, Mar 7, 2018 at 1:22 PM, R0b0t1  wrote:

> On Wed, Mar 7, 2018 at 11:52 AM, Alec Warner  wrote:
> > On Wed, Mar 7, 2018 at 11:51 AM, Michael Orlitzky 
> wrote:
> >>
> >> On 03/07/2018 11:06 AM, anote...@teknik.io wrote:
> >> > Why should portage download some outdated second copy of the
> >> > sources for 'bar', rebuild it, and scatter it around the file system
> >> > where it cannot be used by other programs installed by cabal?
> >>
> >
> > I'm really not happy with the tone of this email, so I'm going to
> comment on
> > it a bit.
> >
>
> I can't help but agree with Mr. Orlitzky's sentiment. All language
> package managers suffer from the same sophomoric problems:
>

> 1) I usually don't know where things are downloaded from.
> 2) I can't integrate these changes with my distrbution (Gentoo,
> Ubuntu, Debian, Fedora, CentOS) safely without serious work.
> 3) I can't figure out easily what dependencies a package has. Usually
> I see if there are compile or runtime errors. Sometimes the
> dependencies are listed somewhere. If the dependency is not what is
> currently in e.g. Ubuntu's repository, I may have to maintain separate
> versions to be compatible.
> 4) Sometimes they aren't set up to be built at all. Let the magic
> package manager do everything for you. This works, except when your
> shared objects are not in the right places. (But it makes me feel
> dirty.)
>
> >>
> >> These other package managers don't solve any hard problems -- they're
> >> basically a fancy interface around wget and "git clone." Portage on the
> >> other hand has ~20 years of good ideas and hard work on the hard
> >> problems in package management. For example...
> >
> >
> > Portage is also full of not-good ideas; many of these we papered over
> with
> > PMS and EAPI to make
> > the actual API people use less horrific. Lets not preach from our ivory
> > tower here.
> >
>
> The magnitude of "not good" is, I would suggest, very different.
>
> Cabal is a pretty hilarious example. Have you ever tried to build it
> without using the release binaries? I suppose this is a second problem
> though, where people want to be "self-reliant" and instead just end up
> making things impossible to verify or make reproducible.
>
> For the longest time Cabal did not authenticate or verify the code it
> would run (as root). Very recently this was fixed, but I still feel
> bad any time I let it run, even if it's on a separate development
> system.
>

Gentoo just got signature checking enabled by default...in ~arch? I'm not
sure if that version of portage is stable yet.
Like I said, be careful how one preaches from the ivory tower.


>
> >>
> >> > It seems reasonable to me to 'hook' portage into these other package
> >> > managers, so that running 'emerge bar' would actually run 'cabal
> install
> >> > bar'
> >>
> >> Can "cabal install" build or even identify the C libraries that your
> >> Haskell package needs? No, because nobody ever thought of that, and it
> >> seems kind of hard now that the cabal build system has no ability to
> >> build non-Haskell packages, so no one is ever going to work on it.
> >>
> >> Can "cabal install" rebuild your Haskell packages when the ABI of some
> >> library changes? No, because "cabal install" doesn't have any idea
> >> what's installed on your system.
> >>
> >> Can "cabal install" uninstall a package? Nope, it has no idea what was
> >> done during the installation, and thus no idea what to undo.
> >>
> >> Can "cabal install" verify the integrity of your downloaded source code?
> >> No, because by design it fetches and runs code from complete strangers.
> >>
> >> Can "cabal install" use a local tarball to function without network
> >> access? Etc. We're dead in the water.
> >>
> >> Every other language-specific package manager has the same problems,
> >> because they're all written by people who didn't know anything about
> >> package management and then got bored when they realized that there's
> >> more to it than parsing a json file of dependencies.
> >>
> >
> > They are written by people who are not you, who have different problems
> than
> > you and often don't care about the above use cases.
> > It turns out this stuff exists because:
> >
> > 1) Upstream wants to push 1 single thing and have it work in all distros.
> > 2) pip / virtualenv / cargo / whatever work reasonable well.
> > 3) Rolling-based distros couldn't keep up with packaging.
> > 4) Snapshot-based distros (debian stable / ubuntu) were not designed with
> > this in mind as much; because packages were developed with a high
> velocity.
> >
>
>
This == upstream has a git tag (release X) and they sync the tag into pip
and they tell people to pip install X and their job is done.
Software, distributed.


> 1) What do you mean by this? Distributions are usually not binary
> compatible. This "works" by having each distribution customize and
> build a project by hand.
>

Right, and because 

Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Rich Freeman
On Wed, Mar 7, 2018 at 12:52 PM, Alec Warner  wrote:
>
> https://wiki.gentoo.org/wiki/Project:Perl/g-cpan is a project is in a
> similar space and basically reads perl CPAN metadata to generate stub
> ebuilds.
> Portage tracks these stub ebuilds (and so for example, it tracks what these
> cpan packages install and can remove them afterwards.)
>

This is the right general approach.  If somebody were willing to do
the work I'm sure it would be useful if portage had a more generic
interface for stuff like this, such as a way to do plugins/etc.  The
idea would be to run some outside package manager in some kind of
sandbox, then create a binary package from what gets installed.

Everybody I know has these sorts of complaints about language-based
PMs, whether they prefer Ubuntu, or Debian, or CentOS, or whatever.
Nobody wants random programs downloading random stuff and dropping
orphan files all over their filesystem with no way to identify these
or clean them up.  They're usually written by the same sorts of people
who tell you to pipe curl into sudo bash...

-- 
Rich



Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread R0b0t1
On Wed, Mar 7, 2018 at 11:52 AM, Alec Warner  wrote:
> On Wed, Mar 7, 2018 at 11:51 AM, Michael Orlitzky  wrote:
>>
>> On 03/07/2018 11:06 AM, anote...@teknik.io wrote:
>> > Why should portage download some outdated second copy of the
>> > sources for 'bar', rebuild it, and scatter it around the file system
>> > where it cannot be used by other programs installed by cabal?
>>
>
> I'm really not happy with the tone of this email, so I'm going to comment on
> it a bit.
>

I can't help but agree with Mr. Orlitzky's sentiment. All language
package managers suffer from the same sophomoric problems:

1) I usually don't know where things are downloaded from.
2) I can't integrate these changes with my distrbution (Gentoo,
Ubuntu, Debian, Fedora, CentOS) safely without serious work.
3) I can't figure out easily what dependencies a package has. Usually
I see if there are compile or runtime errors. Sometimes the
dependencies are listed somewhere. If the dependency is not what is
currently in e.g. Ubuntu's repository, I may have to maintain separate
versions to be compatible.
4) Sometimes they aren't set up to be built at all. Let the magic
package manager do everything for you. This works, except when your
shared objects are not in the right places. (But it makes me feel
dirty.)

>>
>> These other package managers don't solve any hard problems -- they're
>> basically a fancy interface around wget and "git clone." Portage on the
>> other hand has ~20 years of good ideas and hard work on the hard
>> problems in package management. For example...
>
>
> Portage is also full of not-good ideas; many of these we papered over with
> PMS and EAPI to make
> the actual API people use less horrific. Lets not preach from our ivory
> tower here.
>

The magnitude of "not good" is, I would suggest, very different.

Cabal is a pretty hilarious example. Have you ever tried to build it
without using the release binaries? I suppose this is a second problem
though, where people want to be "self-reliant" and instead just end up
making things impossible to verify or make reproducible.

For the longest time Cabal did not authenticate or verify the code it
would run (as root). Very recently this was fixed, but I still feel
bad any time I let it run, even if it's on a separate development
system.

>>
>> > It seems reasonable to me to 'hook' portage into these other package
>> > managers, so that running 'emerge bar' would actually run 'cabal install
>> > bar'
>>
>> Can "cabal install" build or even identify the C libraries that your
>> Haskell package needs? No, because nobody ever thought of that, and it
>> seems kind of hard now that the cabal build system has no ability to
>> build non-Haskell packages, so no one is ever going to work on it.
>>
>> Can "cabal install" rebuild your Haskell packages when the ABI of some
>> library changes? No, because "cabal install" doesn't have any idea
>> what's installed on your system.
>>
>> Can "cabal install" uninstall a package? Nope, it has no idea what was
>> done during the installation, and thus no idea what to undo.
>>
>> Can "cabal install" verify the integrity of your downloaded source code?
>> No, because by design it fetches and runs code from complete strangers.
>>
>> Can "cabal install" use a local tarball to function without network
>> access? Etc. We're dead in the water.
>>
>> Every other language-specific package manager has the same problems,
>> because they're all written by people who didn't know anything about
>> package management and then got bored when they realized that there's
>> more to it than parsing a json file of dependencies.
>>
>
> They are written by people who are not you, who have different problems than
> you and often don't care about the above use cases.
> It turns out this stuff exists because:
>
> 1) Upstream wants to push 1 single thing and have it work in all distros.
> 2) pip / virtualenv / cargo / whatever work reasonable well.
> 3) Rolling-based distros couldn't keep up with packaging.
> 4) Snapshot-based distros (debian stable / ubuntu) were not designed with
> this in mind as much; because packages were developed with a high velocity.
>

1) What do you mean by this? Distributions are usually not binary
compatible. This "works" by having each distribution customize and
build a project by hand.
2) Virtualenv works well, and cabal now has a local installation
option. Still, these are not perfect.
3) Use a git ebuild, or target stable versions. If a project has so
much churn that I can't keep up with it I will find something more
stable.
4) True, but prefix would be a lot better at fixing that problem. If
not that, something like virtualenv.

In the case of either #3 or #4, the distribution developers prefer you
use their package manager to install packages. You are only safe doing
anything else in an environment like virtualenv, which does not exist
for the vast majority of languages. This is why developers will pass

Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Alec Warner
On Wed, Mar 7, 2018 at 11:51 AM, Michael Orlitzky  wrote:

> On 03/07/2018 11:06 AM, anote...@teknik.io wrote:
> > Why should portage download some outdated second copy of the
> > sources for 'bar', rebuild it, and scatter it around the file system
> > where it cannot be used by other programs installed by cabal?
>
>
I'm really not happy with the tone of this email, so I'm going to comment
on it a bit.


> These other package managers don't solve any hard problems -- they're
> basically a fancy interface around wget and "git clone." Portage on the
> other hand has ~20 years of good ideas and hard work on the hard
> problems in package management. For example...
>

Portage is also full of not-good ideas; many of these we papered over with
PMS and EAPI to make
the actual API people use less horrific. Lets not preach from our ivory
tower here.


>
>
> > It seems reasonable to me to 'hook' portage into these other package
> > managers, so that running 'emerge bar' would actually run 'cabal install
> > bar'
>
> Can "cabal install" build or even identify the C libraries that your
> Haskell package needs? No, because nobody ever thought of that, and it
> seems kind of hard now that the cabal build system has no ability to
> build non-Haskell packages, so no one is ever going to work on it.
>
> Can "cabal install" rebuild your Haskell packages when the ABI of some
> library changes? No, because "cabal install" doesn't have any idea
> what's installed on your system.
>
> Can "cabal install" uninstall a package? Nope, it has no idea what was
> done during the installation, and thus no idea what to undo.
>
> Can "cabal install" verify the integrity of your downloaded source code?
> No, because by design it fetches and runs code from complete strangers.
>
> Can "cabal install" use a local tarball to function without network
> access? Etc. We're dead in the water.
>
> Every other language-specific package manager has the same problems,
> because they're all written by people who didn't know anything about
> package management and then got bored when they realized that there's
> more to it than parsing a json file of dependencies.
>
>
They are written by people who are not you, who have different problems
than you and often don't care about the above use cases.
It turns out this stuff exists because:

1) Upstream wants to push 1 single thing and have it work in all distros.
2) pip / virtualenv / cargo / whatever work reasonable well.
3) Rolling-based distros couldn't keep up with packaging.
4) Snapshot-based distros (debian stable / ubuntu) were not designed with
this in mind as much; because packages were developed with a high velocity.




> If you want to eliminate the duplication of effort, tell these people to
> use Gentoo Prefix instead of writing the N+1st crippled PM. Doing it the
> other way around won't work because we'd be replacing one good thing
> with 75 shitty things.


I agree that in theory they could have published ebuilds for Gentoo prefix
and it would have 'worked everywhere' but I think that boat sailed about 10
years ago.

https://wiki.gentoo.org/wiki/Project:Perl/g-cpan is a project is in a
similar space and basically reads perl CPAN metadata to generate stub
ebuilds.
Portage tracks these stub ebuilds (and so for example, it tracks what these
cpan packages install and can remove them afterwards.)

I think this is the most pragmatic approach I've seen used as its mostly an
adapter (to cpan) that just generates ebuilds.
Its plausible that with some careful eclass magic you might be able to make
the installed packages compatible with pip, cargo, etc.

I think its more of a struggle to make it compatible with things like
virtualenv or pip --user though.

-A


Re: [gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread Michael Orlitzky
On 03/07/2018 11:06 AM, anote...@teknik.io wrote:
> Why should portage download some outdated second copy of the
> sources for 'bar', rebuild it, and scatter it around the file system
> where it cannot be used by other programs installed by cabal?

These other package managers don't solve any hard problems -- they're
basically a fancy interface around wget and "git clone." Portage on the
other hand has ~20 years of good ideas and hard work on the hard
problems in package management. For example...


> It seems reasonable to me to 'hook' portage into these other package
> managers, so that running 'emerge bar' would actually run 'cabal install
> bar'

Can "cabal install" build or even identify the C libraries that your
Haskell package needs? No, because nobody ever thought of that, and it
seems kind of hard now that the cabal build system has no ability to
build non-Haskell packages, so no one is ever going to work on it.

Can "cabal install" rebuild your Haskell packages when the ABI of some
library changes? No, because "cabal install" doesn't have any idea
what's installed on your system.

Can "cabal install" uninstall a package? Nope, it has no idea what was
done during the installation, and thus no idea what to undo.

Can "cabal install" verify the integrity of your downloaded source code?
No, because by design it fetches and runs code from complete strangers.

Can "cabal install" use a local tarball to function without network
access? Etc. We're dead in the water.

Every other language-specific package manager has the same problems,
because they're all written by people who didn't know anything about
package management and then got bored when they realized that there's
more to it than parsing a json file of dependencies.

If you want to eliminate the duplication of effort, tell these people to
use Gentoo Prefix instead of writing the N+1st crippled PM. Doing it the
other way around won't work because we'd be replacing one good thing
with 75 shitty things.



[gentoo-dev] Integrating Portage with other package managers

2018-03-07 Thread anoteros
Having used Gentoo for a few years now, one thing that has been annoying
to me is the tremendous duplication of effort and uphill battle of
creating ebuilds (build recipes) for language-specific packages that
already have their own build systems.

For example, many languages such as Python (pip), Node (npm), Ruby
(gems), TeXLive (tlmgr), Haskell (cabal), Rust (cargo) have ways of
redistributing up-to-date dependencies and ensuring that they build
properly in most environments. Portage, it seems, does not take
advantage of this at all. If I want to install the package 'foo', which
has 'bar' as a dependency (which has been installed through cabal, for
instance). Why should portage download some outdated second copy of the
sources for 'bar', rebuild it, and scatter it around the file system
where it cannot be used by other programs installed by cabal?

It seems reasonable to me to 'hook' portage into these other package
managers, so that running 'emerge bar' would actually run 'cabal install
bar' rather than downloading sources and running 'ghc'. This would make
managing dependencies much easier as versions change, since most (all?)
these alternate package managers have ways of specifying specific
versions of packages or pinning. It would also put an end to the
breakage caused by, for example, running 'pip' as root and breaking all
the python libraries portage has pulled in.

I also notice that there is a GSoC 2018 project for integrating Rust
more closely within Gentoo. It seems to me that allowing ebuilds to be
written like this would help resolve this not only for Rust, but for all
languages with similar build systems (which is most modern languages,
frankly).

The only real issue I see with this is the potential loss of granularity
with USE flags for some of these packages, but having poked around the
sort of language-specific libraries and bindings available, hardly any
have any USE flags available, and those that do only offer debug symbols
or documentation, which many of these other build systems offer as well,
so I doubt this would be an issue for anyone. I could of course be wrong.

Is this a feature/improvement other Gentoo users/developers would be
interested in? If so, I would love to help discuss and potentially help
with its implementation.