From mboxrd@z Thu Jan 1 00:00:00 1970 From: swedebugia@riseup.net Subject: Help wanted with recursive npm import returning #f Date: Tue, 04 Dec 2018 13:43:54 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_b292637331da5844507246d4b931a986" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUIU4-0002H7-Q3 for guix-devel@gnu.org; Tue, 04 Dec 2018 16:44:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUIU1-0005hd-DZ for guix-devel@gnu.org; Tue, 04 Dec 2018 16:44:00 -0500 Received: from mx1.riseup.net ([198.252.153.129]:34188) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUIU0-0005fV-UW for guix-devel@gnu.org; Tue, 04 Dec 2018 16:43:57 -0500 Received: from piha.riseup.net (piha-pn.riseup.net [10.0.1.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 407E51A230C for ; Tue, 4 Dec 2018 13:43:55 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by piha.riseup.net with ESMTPSA id 02E452CBB7 for ; Tue, 4 Dec 2018 13:43:54 -0800 (PST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel --=_b292637331da5844507246d4b931a986 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Hi Introduction ------------ Inspired by Ricardos commit here I rewrote most of the npm importer. Added memoization, receive, stream->list, values and rewrote the tarball fetcher to use only npm-uri and tarballs from the registry. Additionally I implemented handling of scoped packages (e.g. @babel/core). It contains less lines of code than Jelles importer. The single import works and is a lot faster and more reliable than before when fuzzy matching on github was used. See it in action: http://paste.debian.net/1054384/ Caveats: 1) we don't know if the registry-tarballs are reproducible. 2) filename is the same as the upstream tarball -> we should convert it to guix-name. 3) we have to download the tarball because sha256 is not among the hashes computed by npm. (I emailed npm@npmjs.org to ask for them to compute it for all their tarballs :) ) Help wanted ----------- There is a bug which only affects the recursive importer. I tried hard finding it but I'm in way over my head and my guile-foo does not seem to cut it with this one. :) For recursive output it downloads but outputs #f in the end instead of the sexps. See example output: http://paste.debian.net/1054383/ Trying to debug via the REPL I met this: scheme@(guile-user) [1]> (npm-recursive-import "async") $3 = # Any ideas? -- Cheers Swedebugia --=_b292637331da5844507246d4b931a986 Content-Transfer-Encoding: base64 Content-Type: text/plain; name=npm.scm Content-Disposition: attachment; filename=npm.scm; size=12786 Ozs7IEdOVSBHdWl4IC0tLSBGdW5jdGlvbmFsIHBhY2thZ2UgbWFuYWdlbWVudCBmb3IgR05VCjs7 OyBDb3B5cmlnaHQgwqkgMjAxNSBEYXZpZCBUaG9tcHNvbiA8ZGF2ZXRAZ251Lm9yZz4KOzs7IENv cHlyaWdodCDCqSAyMDE2IEplbGxlIExpY2h0IDxqbGljaHRAZnNmZS5vcmc+Cjs7OyBDb3B5cmln aHQgwqkgMjAxOCBzd2VkZWJ1Z2lhIDxzd2VkZWJ1Z2lhQHJpc2V1cC5uZXQ+Cjs7Owo7OzsgVGhp cyBmaWxlIGlzIHBhcnQgb2YgR05VIEd1aXguCjs7Owo7OzsgR05VIEd1aXggaXMgZnJlZSBzb2Z0 d2FyZTsgeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeSBpdAo7OzsgdW5kZXIg dGhlIHRlcm1zIG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBhcyBwdWJsaXNoZWQg YnkKOzs7IHRoZSBGcmVlIFNvZ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gIkdpdmVuIHRo ZSBQQUNLQUdFLUFMSVNUIG9mIGFuIGFscmVhZHkgZG93bmxvYWRlZCBUQVJCQUxMLCByZXR1cm4g YSBsaXN0IG9mCm5hbWUvdmFyaWFibGUgcGFpcnMgZGVzY3JpYmluZyB0aGUgcmVxdWlyZWQgaW5w dXRzIG9mIHRoaXMgcGFja2FnZS4gIEFsc28KcmV0dXJuIHRoZSB1bmFsdGVyZWQgbGlzdCBvZiB1 cHN0cmVhbSBkZXBlbmRlbmN5IG5hbWVzLiIKICAobGV0ICgoZGVwZW5kZW5jaWVzCiAgICAgICAg IChyZW1vdmUgKGN1dCBzdHJpbmc9PyAiYXJncGFyc2UiIDw+KQogICAgICAgICAgICAgICAgIChs aXN0LXJlcXVpcmVtZW50cyBwYWNrYWdlLWFsaXN0KSkpKQogICAgKHZhbHVlcyAoc29ydAogICAg ICAgICAgICAgKG1hcCAobGFtYmRhIChpbnB1dCkKICAgICAgICAgICAgICAgICAgICAobGV0ICgo Z3VpeC1uYW1lIChub2RlLT5wYWNrYWdlLW5hbWUgaW5wdXQpKSkKICAgICAgICAgICAgICAgICAg ICAgIChsaXN0IGd1aXgtbmFtZSAobGlzdCAndW5xdW90ZSAoc3RyaW5nLT5zeW1ib2wgZ3VpeC1u YW1lKSkpKSkKICAgICAgICAgICAgICAgICAgZGVwZW5kZW5jaWVzKQogICAgICAgICAgICAgKGxh bWJkYSBhcmdzCiAgICAgICAgICAgICAgIChtYXRjaCBhcmdzCiAgICAgICAgICAgICAgICAgKCgo YSBfIC4uLikgKGIgXyAuLi4pKQogICAgICAgICAgICAgICAgICAoc3RyaW5nLWNpPD8gYSBiKSkp KSkKICAgICAgICAgICAgZGVwZW5kZW5jaWVzKSkpCgooZGVmaW5lIChtYWtlLW5wbS1zZXhwIG5h bWUgdmVyc2lvbiBob21lLXBhZ2UgZGVzY3JpcHRpb24KICAgICAgICAgICAgICAgICAgICAgICBk ZXBlbmRlbmNpZXMgZGV2LWRlcGVuZGVuY2llc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ICAgICAgICAgICAgICAgICAgKG5hbWUgLGd1aXhuYW1lKQogICAgICAgICAgICAgICAg ICAgICAodmVyc2lvbiAsdmVyc2lvbikKICAgICAgICAgICAgICAgICAgICAgKHNvdXJjZSAob3Jp Z2luCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWV0aG9kIHVybC1mZXRjaCkKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1cmkgKG5wbS11cmkgLG5hbWUgdmVyc2lvbikp CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2hhMjU2CgkJCQkoYmFzZTMyCgkJCQkg LChndWl4LWhhc2gtdXJsIHRlbXApKSkpKQogICAgICAgICAgICAgICAgICAgICAoYnVpbGQtc3lz dGVtIG5vZGUtYnVpbGQtc3lzdGVtKQogICAgICAgICAgICAgICAgICAgICAsQChtYXliZS1pbnB1 dHMgaW5wdXQtcGFja2FnZS1uYW1lcykKICAgICAgICAgICAgICAgICAgICAgKHN5bm9wc2lzICxk ZXNjcmlwdGlvbikgOyBubyBzeW5vcHNpcyBmaWVsZCBpbiBwYWNrYWdlLmpzb24gZmlsZXMKICAg ICAgICAgICAgICAgICAgICAgKGRlc2NyaXB0aW9uICxkZXNjcmlwdGlvbikKICAgICAgICAgICAg ICAgICAgICAgKGhvbWUtcGFnZSAsaG9tZS1wYWdlKQogICAgICAgICAgICAgICAgICAgICAobGlj ZW5zZSAsbGljZW5zZSkpKSkpCiAgICAgICAgICAgICB1cHN0cmVhbS1kZXBlbmRlbmN5LW5hbWVz KSkpKSkpCgooZGVmaW5lIChleHRyYWN0LWxpY2Vuc2UgcGFja2FnZS1qc29uKQogIChsZXQgKChs aWNlbnNlLWVudHJ5IChhc3NvYy1yZWYgcGFja2FnZS1qc29uICJsaWNlbnNlIikpCiAgICAgICAg KGxpY2Vuc2UtbGVnYWN5IChhc3NvYy1yZWYgcGFja2FnZS1qc29uICJsaWNlbnNlcyIpKSkKICAg IChjb25kCiAgICAgKChzdHJpbmc/I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gobmFtZSAoYXNzb2MtcmVmIHBh Y2thZ2UgIm5hbWUiKSkKICAgICAgICAgICAgICAgICAgICh2ZXJzaW9uIChucG0tbGF0ZXN0LXJl bGVhc2UgcGFja2FnZSkpCiAgICAgICAgICAgICAgICAgICAoY3VyciAoYXNzb2MtcmVmKiBwYWNr YWdlICJ2ZXJzaW9ucyIgdmVyc2lvbikpCiAgICAgICAgICAgICAgICAgICAoZGVwZW5kZW5jaWVz IChhc3NvYy1yZWYgY3VyciAiZGVwZW5kZW5jaWVzIikpCiAgICAgICAgICAgICAgICAgICAoZGV2 LWRlcGVuZGVuY2llcyAoYXNzb2MtcmVmIGN1cnIgImRldkRlcGVuZGVuY2llcyIpKQogICAgICAg ICAgICAgICAgICAgKGRlc2NyaXB0aW9uIChhc3NvYy1yZWYgcGFja2FnZSAiZGVzY3JpcHRpb24i KSkKICAgICAgICAgICAgICAgICAgIChob21lLXBhZ2UgKGFzc29jLXJlZiBwYWNrYWdlICJob21l cGFnZSIpKQogICAgICAgICAgICAgICAgICAgKGxpY2Vuc2UgKGV4dHJhY3QtbGljZW5zZSBjdXJy KSkKICAgICAgICAgICAgICAgICAgIChzb3VyY2UtdXJsIChucG0tdGFyYmFsbCBwYWNrYWdlIHZl cnNpb24pKSkKICAgICAgICAgICAgICAobWFrZS1ucG0tc2V4cCBuYW1lIHZlcnNpb24gaG9tZS1w YWdlIGRlc2NyaXB0aW9uCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwZW5kZW5jaWVz IGRldi1kZXBlbmRlbmNpZXMgbGljZW5zZSBzb3VyY2UtdXJsCiAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgOzsgUGFzcyB0aGUgd2hvbGUgYWxpc3Qgb24gdG8gY29tcHV0ZS1pbnB1dHMgZnJv bQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIDs7IGl0IGluIHRoZSBuZXh0IHN0ZXAuCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2FnZSkpKS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