-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
package formulas #6
Comments
We were already thinking of doing something along these lines. Originally we were wondering if perhaps this information could just be encoded in JSON, though. My thinking was that within the JSON would be the URL for a git repository. Then there would be a dictionary mapping version numbers to commit SHAs. As you say, there would also need to be instructions on how to go about compiling including, perhaps, certain compile options. We'd also need a list of compilers (and versions) which will work, perhaps changing depending on the version of the package. Much of this logic would work regardless of whether this was in JSON or Python. The advantage of JSON would be that the package maintainer wouldn't need to know Python. Of course, doing it in Python makes it easier for the maintainer to add more complicated options and build logic. It would also mean that we (the authors of FLATPack) would not need to worry about messing around converting JSON to a Package object. Final thought: how do we go about choosing the compiler at build time? This would, presumably, depend on the build system. Perhaps have the package maintainer include a different set of build instructions for each compiler? |
See #7... Basically I think you just build a version of the package for all possible compiler's when you install the package. This will be the intersection of available compilers on the system and compilers supported by the package. Maybe the user can also limit what is built. |
I realize that. What I mean is, how do we tell the build system which compiler to use? This may be a trivial question, but I'm not that familiar with anything more complicated than |
Some ideas and suggestions:
|
I've pushed some sample JSON files to the repo, to provoke conversation. compilers.json would be a system file describing the available compilers. json-fortran.json is an example package file for json-fortran. The build commands which I provide for the Intel and NAG compilers are meaningless--I'm not sure what the proper way to choose the compiler is, so I just added something random to indicate that the commands would be different compared to GNU. |
Looking at YAML, I've concluded that it looks like a much nicer (and certainly more Pythonic) serialization format to use than JSON. There is the additional advantage that PyYAML makes it trivially easy to convert the YAML data into a Python object. Take a look at the compilers.yml and json-fortran.yml, as well as compiler.py to see. |
Hi @cmacmackin |
In response to @milancurcic’s comment:
👍
See #7. I think in general FLATPack should build a version for each supported compiler on the system, but with the option that the user can restrict the build to a single compiler. Using @cmacmackin’s example files, by default when installing json-fortran FLATPack would cross reference the compilers listed in the json-fortran.yml formula and this available on the given system from the compilers.yml and build a version of json-fortran for each compiler that FLATPack can. Then the user can switch which compiler environment is available as described in #7. Building a version for each compiler will be time consuming but will make installation of a given package a one time even for sysadmins and will make each package highly available to users. Thoughts?
Fair point… perhaps this is best to have a setting for. Let the user/sysadmin choose the desired behavior? Or maybe large/slow projects can be flagged in their formulas to be one environment installs only?
Yes, it certainly will. I think that this is unavoidable and that we should follow the Homebrew philosophy of defining package formulas, kept under version control, that anybody can contribute via a pull request. I don’t know of any other way to get around this issue. |
@cmacmackin : I love the ease of use of YAML with Python and the simple syntax. The proposed formula looks great in JSON or YAML. I think that we want to keep as little duplicate information in the package formulae as possible though—I’d prefer to leave out author, maintainer and email info. That information should be available from the project site. My one hesitation about YAML is that it can be a bit awkward to embed shell commands in it sometimes due to its strict indentation rules, but that certainly is not a deal breaker. I think the benefits probably outweigh this shortcoming. I think most packages have builds that can be categorized into two to 5 phases, and it might be worthwhile for FLATPack to know about them:
|
@zbeekman @milancurcic |
Sounds good |
As I've been thinking more about this project, I've realized how little I know about build processes. As such, I'm probably not the best person to be designing the structure of FLATPack formulas. Some initial ideas can be found here. In particular, I would be interested on people's thoughts about how to specify different compile options. For example, how to compile with documentation, how to compile with multi-threading, etc. Or perhaps it would be better just to have separate packages for docs (as done in Debian/Ubuntu) and for multi-threaded versions. |
I think that the formula just needs to be able to be told about build details that are provided by the actual software packages. The initial formulas look like they are definitely on the right track. FLATPack need not force conventions on packages, rather it should just require them to adhere to sane Unix-like install conventions. I can work on this some more when I get some free time, but right now finishing my thesis is the main priority. |
Okay, take your time. Good luck on your thesis. |
Go Zaak, this is your time to fly! We are all with you! @cmacmackin I am not sure how can I help you. I like zaak idea that FLATPack should be as most agnostic as possible. Why you are complaining with compilations flags or such low-level "garbage"? |
Well, I'd be fine with avoiding that sort of stuff. I just noticed that it was present in the Homebrew formula. For example, there are the lines specifying different install options:
There are also some lines specifying arguments:
That may not be necessary for FLATPack, but as I'm not experienced with build systems I am not sure. |
Yes, we will need some generic install related options for CMake, Makefiles etc. The formula just provides specification of those things if necessary to conform with the FLATPack install structure, etc… There are standard conventions for relocating install directories that we can take advantage of. I’m happy to help out with this logic, but probably not for a month or two. |
Hi all,
Just a suggestion about how to manage different packages, and a place to discuss.
I really like the way Homebrew keeps track of packages. It stores instructions for downloading, building and installing packages as relatively simple ruby scripts. I think this idea is much more powerful than trying to do something like duplicating package sources via cloning existing git repos. If FLATPack used a similar formula structure, the formula can indicate which compilers a certain package works with (and what versions and/or which language features or standards are required) and contain specialized build instructions for each compiler.
Here is a link to the Homebrew documentation for writing formulas and for submitting pull requests to add them to Homebrew.
Here is the json-fortran Homebrew formula for reference. It’s pretty concise and simple, and Homebrew has a
create
command which you pass a URL to and will extract version info, the sha256 hash and stub to expand. Thebottle do
stuff is just precompiled binaries built during the formula testing process and automatically added by the testbot:This encodes everything home-brew needs to know about
json-fortran
and this is what build options/info it provides to the user:The text was updated successfully, but these errors were encountered: