GSoC Proposal

KARAN SHETH karan.sheth at somaiya.edu
Thu Mar 28 18:28:37 UTC 2019


Hey,

On Thu, Mar 28, 2019 at 8:48 PM Mojca Miklavec <mojca at macports.org (mailto:mojca at macports.org)> wrote:
>
> We are looking forward. I hope that Cyril will also help with the process (my encounter with UPM so far was for the full two hours while hacking on it :).
I've written a basic npm frontend and macports backend for it so if we do something like:
upt package -f npm -b macports request

this is the output:
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0

name npm-request
version 2.9.3

maintainers nomaintainer
description Simplified HTTP request client.
long_description ${description}

platforms darwin
license Apache-2.0
homepage https://github.com/request/request#readme

master_sites git+https://github.com/request/request.git
I still have to add checksum and have a bit of doubt in it - to calculate checksum it will have to download distfiles from npm and calculate checksums for that right?
Another doubt that I have is how to test the Portfiles generated,because if I try to directly to install this files then it tries to get distfiles from the macport server I guess(I have never done this so have no clue on how to test it)
Also for every npm package multiple versions are available so should the script ask which version to use or by-default newest version.
> > This is what I have thought to do :
> >
> > - For npm frontend:
> > - get the json for any package from https://registry.npmjs.org/<package-name (https://registry.npmjs.org/%3Cpackage-name)>
> > - parse it as per upt-frontend template
> >
> >
> > - For macport backend:
> > - First I will fix the issues with the Pypi code and then add npm to it
> >
> >
> > Given all what I have tried out, I expect everything to go smoothly but if I have any doubt's, I will get in touch.
>
> OK.
>
> > I've also read about port livecheck but haven't tried it yet.
> >
> > One concern/doubt I have is - does the Portfile generated always have to be correct as I don't think that's achievable given the complexity sometimes, but sure upt can be a starting point and with few manual edits Portfile can be perfected.
>
> Yes, the Portfile should always be syntactically correct, even though it may not always be the final / ultimate version. There are definitely cases where external software is needed and the internal name of macports cannot simply be deduced from pypi or npm index. So I expect that further changes might often be needed.
>
> Note that my version did not yet print the checksums. This functionality has been added to upm after I played with it, so the checksums are definitely still missing.
>
> Now, this brings us to the question of how to keep these ports up to date, which might be even more important than creating those ports in the first place. This is something that needs to be investigated and needs some fresh ideas.
>
> We could in principle have some huge index file with all the data from various packages, and then individual portfiles would only list the name and version of each individual port, while the data (including all dependencies) would be fed from a table somewhere else in the system. Or some other clever method for updating the ports needs to be devoted / invented.
>
> See for example
> https://github.com/macports/macports-ports/blob/master/_resources/port1.0/group/crossgcc-1.0.tcl
> which simply lists various versions of gcc compiler, and then individual ports only say which version they want:
> https://github.com/macports/macports-ports/blob/master/cross/i386-elf-gcc/Portfile
>
>
>
>

I was thinking that it would make sense to create a portgroup for npm and other such frontends.

> I imagine that it would make sense to write MacPorts backend + some selected frontents like npm, and then:
> find an elegant and efficient way of updating ports while keeping in mind that manual additions to packages might be needed (there are multiple options)
>
> (maybe present some proof-of-concept solution for automatic updates of perl ports)
>
> find a way to recursively generate packages (if you need a package and thirty of its dependencies are still missing in our tree, it should be able generate all of them at once)
>
> automate the testing to some extent (pypi2port offers a command that creates the port, fetches the sources, compiles the port and maybe even runs the tests; I did not recheck it, so maybe I remember some details wrong)
>
> pick some areas in MacPorts with weak support (ruby, cabal, npm, ...) and try to improve multiple packages, bringing them up to date, adding dependencies so that software like pandoc, rails etc. could be built, ...
>
>
> These are just random ideas, picking up your favourites is up to you.
>
>
>
>
>
I will first complete Macports backend for all the frontends as for now only npm and pypi is working and that too not fully.
once this is done then I will work on POC for auto updates of perl ports.
Here my doubt is by autoupdate it means that if the package is updated then the corresponding portfile should be updated, right? but while updating, the manual edits should be taken care of I guess.

After this I would move on to automating the test, but for that I need help first with manual testing for npm.
I am still not fully clear with the exact path of stuff, is this the correct flow?
upt will be used to generate portfile from npm,cpan,etc.. including distfiles and checksums
then this portfiles should be tested and if its not working manual editing will be done after which it will be retested and if there are dependencies then that needs to be ported and build too.

Thanks,
Karan Sheth


-- 

 <https://www.somaiya.edu>        <http://www.somaiya-ayurvihar.org>  
<http://nareshwadi.org>  <http://somaiya.com>  <http://www.helpachild.in>  
<http://nareshwadi.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20190328/e44f5050/attachment.html>


More information about the macports-dev mailing list