{"action":"created","issue":{"url":"https://api.github.com/repos/hashdist/hashdist/issues/339","labels_url":"https://api.github.com/repos/hashdist/hashdist/issues/339/labels{/name}","comments_url":"https://api.github.com/repos/hashdist/hashdist/issues/339/comments","events_url":"https://api.github.com/repos/hashdist/hashdist/issues/339/events","html_url":"https://github.com/hashdist/hashdist/pull/339","id":81403982,"number":339,"title":"New parameter system (WIP)","user":{"login":"dagss","id":118410,"avatar_url":"https://avatars.githubusercontent.com/u/118410?v=3","gravatar_id":"","url":"https://api.github.com/users/dagss","html_url":"https://github.com/dagss","followers_url":"https://api.github.com/users/dagss/followers","following_url":"https://api.github.com/users/dagss/following{/other_user}","gists_url":"https://api.github.com/users/dagss/gists{/gist_id}","starred_url":"https://api.github.com/users/dagss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagss/subscriptions","organizations_url":"https://api.github.com/users/dagss/orgs","repos_url":"https://api.github.com/users/dagss/repos","events_url":"https://api.github.com/users/dagss/events{/privacy}","received_events_url":"https://api.github.com/users/dagss/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashdist/hashdist/labels/NOMERGE","name":"NOMERGE","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2015-05-27T11:09:37Z","updated_at":"2015-06-12T11:24:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hashdist/hashdist/pulls/339","html_url":"https://github.com/hashdist/hashdist/pull/339","diff_url":"https://github.com/hashdist/hashdist/pull/339.diff","patch_url":"https://github.com/hashdist/hashdist/pull/339.patch"},"body":"Preview of the new parameter system, I'm sure I'll discover issues that should be fixed as me and @johannesring work tomorrow to move Hashstack over.\r\n\r\n## Changes\r\n\r\n* Parameter expansion is done *after* YAML parsing instead of before. As a result, any parameter expansion must now be quoted:\r\n\r\n```yaml\r\nfoo: \"{{FOO}}\"  # LEGAL\r\nfoo: {{FOO}}  # NOT LEGAL\r\n```\r\n\r\n* For the same reason, the form `[item1, item2, {{many_items}}]` no longer works. The `build_with` must be replaced with the new optional dependency system.\r\n\r\n* Optional dependencies:\r\n\r\n```yaml\r\ndependencies:\r\n    build: [x, \"y?\"] # y is optional\r\n```\r\n\r\n* Explicit parameter declaration. \"defaults\" section is still supported for old packages, but you must either use that, or the new parameters section.\r\n\r\n```yaml\r\nparameters:\r\n  - name: HOST_CMAKE\r\n    type: str # default, others are int, bool, ...\r\n    default: \"/usr/bin/cmake\"\r\n```\r\n\r\n* Parameters will not be passed to a package if it is not declared\r\n\r\n* Inside of `{{ }}` there is full Python expression support\r\n\r\n* Should be able to do `{{numpy.version}}`, this is actually untested ATM..\r\n\r\n* In profile.yaml files, dependencies are really parameters.\r\n\r\n* The `use:` construct is now a pure re-direct. Should consider removing it in favor of the new pass-package-as-parameters feature.\r\n\r\n* Possible to use the `when` construct with a value leafs, i.e., this now works:\r\n\r\n```yaml\r\n- url: http://downloads.sourceforge.net/project/libpng/zlib/{{version}}/zlib-{{version}}.tar.gz\r\n  key:\r\n    when version == '1.2.7': tar.gz:7kojzbry564mxdxv4toviu7ekv2r4hct\r\n    when version == '1.2.8': tar.gz:gzsyzn3iuvgb2tpmipbrc3bh5wet5cfq\r\n```\r\n\r\n## TODO:\r\n\r\n- [x] Remove need for quotes around optional dependencies, `x?` not `\"x?\"` *went with +x*\r\n- [x] In profiles, specifying `foo` package parameter should set both `foo` and the hidden `_run_foo`\r\n- [x] Change behaviour of +x to that decided on list *WIP in twopass branch*\r\n- [ ] Write documentation for the profile DSL\r\n- [x] Version type\r\n- [x] `constraints:` section\r\n- [x] Test `{{numpy.version}}`\r\n- [x] In `when version == '1.2.7'` we should not need to quote the version; run through a preprocessor to make it `Version('1.2.7')`.\r\n- [ ] `LOCATION UNKNOWN` when parameter is missing\r\n- [x] Auto-declare `package` parameter\r\n- [x] Nicer error on YAML syntax error\r\n- [x] Must be possible to override default of parameter inherited from base package\r\n- [x] Only python-from-host.yaml should need to declare use_python_packages_from_host, not python.yaml\r\n- [ ] Unit-test `_store_files` in `package.py`\r\n- [x] Fix `hit show build-spec`\r\n- [x] No import of `patchelf` in `bzip2`, why?\r\n- [ ] Make build order of packages more deterministic\r\n- [x] Pythons attempt to build before bzip2\r\n- [x] If a parameter is only used in a `when` clause in build_stages is not declared or provided it doesn't stop build from happening\r\n- [x] Fix bug below:\r\n\r\n```\r\n[CRITICAL]     r[key] = prune_nohash(value)\r\n[CRITICAL]   File \"/home/dagss/hashdist/hashdist/hashdist/core/hasher.py\", line 71, in prune_nohash\r\n[CRITICAL]     raise TypeError('document contains illegal type %r' % type(doc))\r\n[CRITICAL] TypeError: document contains illegal type <class 'hashdist.spec.spec_ast.bool_node'>\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/hashdist/hashdist/issues/comments/111457715","html_url":"https://github.com/hashdist/hashdist/pull/339#issuecomment-111457715","issue_url":"https://api.github.com/repos/hashdist/hashdist/issues/339","id":111457715,"user":{"login":"dagss","id":118410,"avatar_url":"https://avatars.githubusercontent.com/u/118410?v=3","gravatar_id":"","url":"https://api.github.com/users/dagss","html_url":"https://github.com/dagss","followers_url":"https://api.github.com/users/dagss/followers","following_url":"https://api.github.com/users/dagss/following{/other_user}","gists_url":"https://api.github.com/users/dagss/gists{/gist_id}","starred_url":"https://api.github.com/users/dagss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dagss/subscriptions","organizations_url":"https://api.github.com/users/dagss/orgs","repos_url":"https://api.github.com/users/dagss/repos","events_url":"https://api.github.com/users/dagss/events{/privacy}","received_events_url":"https://api.github.com/users/dagss/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T11:24:40Z","updated_at":"2015-06-12T11:24:40Z","body":"Additions to todo list:\r\n\r\n- [ ] Johannes' request above\r\n- [ ] Nicer error message when YAML parser fails\r\n"}}