unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Danny Milosavljevic <dannym@scratchpost.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH v2] gnu: Add dub-build-system.
Date: Thu, 09 Feb 2017 18:06:40 +0100	[thread overview]
Message-ID: <87h943waxr.fsf@gnu.org> (raw)
In-Reply-To: <20170202101138.5e1d523c@scratchpost.org> (Danny Milosavljevic's message of "Thu, 2 Feb 2017 10:11:38 +0100")

Hello!

Danny Milosavljevic <dannym@scratchpost.org> skribis:

>> Do you have experience using it on real DUB packages?  IOW, how complete
>> is it?  :-)
>
> Yeah, I've tested it on a small subset of all code.dlang.org packages. About half of the ones I tested work fine. This is my log:

Impressive!  I guess we can consider the importer mostly ready.  :-)

>>Rather: (chmod "." #o755).
>
> Thanks. Note that it's a workaround because git-download leaves the build directory read-only for some reason. Should the problem be found and fixed there? Or is it on purpose?

It’s not really on purpose, it’s just that the checkout in /gnu/store is
read-only and the ‘unpack’ phase simply copies it as-is.

>>Could you add a comment above explaining why this needs to be done?
>
> Sure. (it prepares a directory which can be used to find all the (D) dependencies by going just one level down; earlier versions just used /gnu/store directly but that would mean if you put such a package (without any subdirs in it) into your profile it would pollute the root)
>
> I'm just thinking out loud about the comment :)
>
> Something like this?
>
> ;; Prepare one new directory with all the required dependencies.
> ;; It's necessary to do this (instead of just using /gnu/store as the directory) because we want to hide the libraries in subdirectories lib/dub/... instead of polluting the user's profile root.

Sounds good (with wrapped lines).

>>If HOME is relied on, please add a comment explaining why.
>
> The dub build system uses it to [...]

No need to comment here, I trust you to do the right thing ;-), but
please just provide an explanation as a comment so people later can know
why things are done this way.

>> +  (if (or (zero? (system* "grep" "-q" "sourceLibrary" "package.json"))
>> +          (zero? (system* "grep" "-q" "sourceLibrary" "dub.sdl")) ; note: format is different!
>> +          (zero? (system* "grep" "-q" "sourceLibrary" "dub.json")))
>
>>Would be best to avoid calling out to ‘grep’.  At worst you can do:
>>  (define (grep string file)
>>    (string-contains (call-with-input-file file get-string-all)
>>                     string))
>
> Thanks. I'll use it. Will it break when it can't find the file? That
> would be bad. Usually there's only one of these files available.

Then you can do, say:

  (or (not (file-exists? file))
      (string-contains …))

With these issues addressed, I think you can push the updated patch.

Thank you!

Ludo’.

      reply	other threads:[~2017-02-09 17:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 23:42 [PATCH v2] gnu: Add dub-build-system Danny Milosavljevic
2017-02-01 22:13 ` Ludovic Courtès
2017-02-02  9:11   ` Danny Milosavljevic
2017-02-09 17:06     ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h943waxr.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=dannym@scratchpost.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).