Re: Guix to participate in the Google Summer of Code

2018-02-21 Thread Ricardo Wurmus

Chris Marusich  writes:

> Ricardo Wurmus  writes:
>
>> Garbage collection in the context of Guix is not very difficult to
>> understand.  The garbage collector may remove any item that has zero
>> users; the link count on a store item is indicative of the number of
>> users that item has.  For garbage collection you essentially go through
>> all items and check if the link count is zero.

[…]

> It looks like, in nix/libstore/gc.cc, we basically walk the references
> graph starting from the GC roots and delete anything that can't be
> reached from a root.

Yes, this is more accurate.  Thanks for the correction.

(Link counts only matter for deduplication.)

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





Re: Guix to participate in the Google Summer of Code

2018-02-20 Thread Chris Marusich
Ricardo Wurmus  writes:

> Garbage collection in the context of Guix is not very difficult to
> understand.  The garbage collector may remove any item that has zero
> users; the link count on a store item is indicative of the number of
> users that item has.  For garbage collection you essentially go through
> all items and check if the link count is zero.

Is this correct?  My understanding is that the link count of a store
path (i.e., the count of hard links for a given file in the store) is
unrelated to whether or not that store path is live.  It looks like, in
nix/libstore/gc.cc, we basically walk the references graph starting from
the GC roots and delete anything that can't be reached from a root.
This makes sense, since anything that can be reached from a root is live
and must not be deleted, and anything that can't be reached from any
root can be deleted.  Link counts (e.g., the number of hard links) do
not seem to play a role here.

In addition to the C++ code, the Nix thesis has a good discussion of the
garbage collection algorithm.  I don't know if it's accurate, but it
helps shed light on the intent.

-- 
Chris


signature.asc
Description: PGP signature


Re: Guix to participate in the Google Summer of Code

2018-02-19 Thread Alex Vong
Hello Ricardo,

Ricardo Wurmus  writes:

> Hi Alex,
>
>> I want to be a student this year since this will be my final chance (I
>> am graduating this year). I look at the libreplanet page and I think
>> only the build daemon project is suitable for me since I don't have
>> knowledge in networking. Is it possible for me to work on last-year
>> Bournish project?
>
> The Bournish project is poorly defined now that gash exists, a Bash
> interpreter written in Guile.  It wouldn’t be a lot of work to integrate
> gash into Guix and replace Bournish; in fact I wanted to do this myself
> in a few weeks.
>
OK, so we already have a working Bash interpreter written in Guile. It
makes sense to drop the old plan then.

> I’m afraid that the Bournish project would no longer be suitable for
> GSoC, and that’s why it had been removed from the list of project ideas.
>
I see. So this is why I think I have seen it before. It was on the list
of idea but then get removed.

> The guix-daemon project is larger but also much more useful to us.
> Garbage collection in the context of Guix is not very difficult to
> understand.  The garbage collector may remove any item that has zero
> users; the link count on a store item is indicative of the number of
> users that item has.  For garbage collection you essentially go through
> all items and check if the link count is zero.
>
I will join the guix-daemon project then. My understading is that the
garbage collector also uses info from 'list-runtime-roots', right? So
together we have registered roots and runtime roots.

> The reference scanner is already implemented in the form of grafts.  The
> code opens each file and searches efficiently for store references.
>
Does this mean we have procedure to do a single find-reference and the
remaining work is to build a recursive find-reference?

> For that project it is best to spend a day or two browsing the existing
> Guile sources and noting the many things that already implement large
> parts of the daemon features.
>
> --
> Ricardo
>
> GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
> https://elephly.net

Cheers,
Alex



Re: Guix to participate in the Google Summer of Code

2018-02-18 Thread Ricardo Wurmus

Hi Alex,

> I want to be a student this year since this will be my final chance (I
> am graduating this year). I look at the libreplanet page and I think
> only the build daemon project is suitable for me since I don't have
> knowledge in networking. Is it possible for me to work on last-year
> Bournish project?

The Bournish project is poorly defined now that gash exists, a Bash
interpreter written in Guile.  It wouldn’t be a lot of work to integrate
gash into Guix and replace Bournish; in fact I wanted to do this myself
in a few weeks.

I’m afraid that the Bournish project would no longer be suitable for
GSoC, and that’s why it had been removed from the list of project ideas.

The guix-daemon project is larger but also much more useful to us.
Garbage collection in the context of Guix is not very difficult to
understand.  The garbage collector may remove any item that has zero
users; the link count on a store item is indicative of the number of
users that item has.  For garbage collection you essentially go through
all items and check if the link count is zero.

The reference scanner is already implemented in the form of grafts.  The
code opens each file and searches efficiently for store references.

For that project it is best to spend a day or two browsing the existing
Guile sources and noting the many things that already implement large
parts of the daemon features.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





Re: Guix to participate in the Google Summer of Code

2018-02-17 Thread Alex Vong
Hello,

l...@gnu.org (Ludovic Courtès) writes:

[...]
>
> We also need topics: consider updating
> .
>
> Last but not least, we need candidates: if you’re a student lurking,
> let’s get in touch; if you’re a contributor, spread the word!
>
> Ludo’.
>
[...]

I want to be a student this year since this will be my final chance (I
am graduating this year). I look at the libreplanet page and I think
only the build daemon project is suitable for me since I don't have
knowledge in networking. Is it possible for me to work on last-year
Bournish project?

I am taking a compiler course right now (sadly it is in Java not ML). I
am more confident in working on Bournish than working on the build
daemon. Well, I would have to study how garbage collection works if I
were to work on the build daemon (of course this could be fun as well).

Cheers,
Alex