{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml-omake/omake/issues/53","repository_url":"https://api.github.com/repos/ocaml-omake/omake","labels_url":"https://api.github.com/repos/ocaml-omake/omake/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/ocaml-omake/omake/issues/53/comments","events_url":"https://api.github.com/repos/ocaml-omake/omake/issues/53/events","html_url":"https://github.com/ocaml-omake/omake/issues/53","id":184163438,"number":53,"title":"Possible bug in variable expansion of scanner rules?","user":{"login":"sbriais","id":3365401,"avatar_url":"https://avatars.githubusercontent.com/u/3365401?v=3","gravatar_id":"","url":"https://api.github.com/users/sbriais","html_url":"https://github.com/sbriais","followers_url":"https://api.github.com/users/sbriais/followers","following_url":"https://api.github.com/users/sbriais/following{/other_user}","gists_url":"https://api.github.com/users/sbriais/gists{/gist_id}","starred_url":"https://api.github.com/users/sbriais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbriais/subscriptions","organizations_url":"https://api.github.com/users/sbriais/orgs","repos_url":"https://api.github.com/users/sbriais/repos","events_url":"https://api.github.com/users/sbriais/events{/privacy}","received_events_url":"https://api.github.com/users/sbriais/received_events","type":"User","site_admin":false},"labels":[{"id":134005418,"url":"https://api.github.com/repos/ocaml-omake/omake/labels/question","name":"question","color":"cc317c","default":true},{"id":134005419,"url":"https://api.github.com/repos/ocaml-omake/omake/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-10-20T08:19:53Z","updated_at":"2017-02-01T09:51:54Z","closed_at":"2017-02-01T09:51:54Z","body":"Please find a very small OMake project. We are wondering why it does not work.\n\nThe idea is the following:\n- we have an external tool that computes the dependencies needed for some files (typically a ppx), here we generate a dummy script depend.sh\n- the scanner rule is written in a generic way but it depends on a variable (here called COMPUTEDEPS) which is set when needed\n\nFor the attached project, we have defined a scanner rule for C files (called scan-gccplouf-%.c) which depends on the C file and the value of the variable COMPUTEDEPS.\n\nWe generate a dummy file main.c.\n\nWe generate a dummy script shell depend.sh that returns the dependencies needed to build the %.o file.\n\nWe define a generic rule for building %.o file that depends on the %.c file and the scanner scan-gccplouf-%.c\n\nWe have set the variable COMPUTEDEPS after the definition of the .SCANNER which is equal to $(file depend.sh).\n\nWe have two scenario:\n1. If we run omake (on linux), we get an error, because it does not build depend.sh before running the scanner. Of course, if we run \"omake depend.sh\" before, it works.\n2. If we move the definition of COMPUTEDEPS before the .SCANNER, this works. But of course, in our situation, we cannot do this. \n\nNote that I commented two \"echo\" commands. This allows to inspect the value of COMPUTEDEPS when running the rules. You'll see that in both scenario, the content of log file is correct (contains depend.sh).\n\n[scanner.zip](https://github.com/ocaml-omake/omake/files/541146/scanner.zip)\n\nAny ideas or comments?\n\nIn addition, in our use case, we have the feeling that the value of the variable inside the scanner rules is bad (the path of the file is not good), does it ring a bell?\n"},"comment":{"url":"https://api.github.com/repos/ocaml-omake/omake/issues/comments/276615694","html_url":"https://github.com/ocaml-omake/omake/issues/53#issuecomment-276615694","issue_url":"https://api.github.com/repos/ocaml-omake/omake/issues/53","id":276615694,"user":{"login":"gerdstolpmann","id":1489498,"avatar_url":"https://avatars.githubusercontent.com/u/1489498?v=3","gravatar_id":"","url":"https://api.github.com/users/gerdstolpmann","html_url":"https://github.com/gerdstolpmann","followers_url":"https://api.github.com/users/gerdstolpmann/followers","following_url":"https://api.github.com/users/gerdstolpmann/following{/other_user}","gists_url":"https://api.github.com/users/gerdstolpmann/gists{/gist_id}","starred_url":"https://api.github.com/users/gerdstolpmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gerdstolpmann/subscriptions","organizations_url":"https://api.github.com/users/gerdstolpmann/orgs","repos_url":"https://api.github.com/users/gerdstolpmann/repos","events_url":"https://api.github.com/users/gerdstolpmann/events{/privacy}","received_events_url":"https://api.github.com/users/gerdstolpmann/received_events","type":"User","site_admin":false},"created_at":"2017-02-01T09:51:54Z","updated_at":"2017-02-01T09:51:54Z","body":"This seems to be more a wrong interpretation of the omake DSL than a real issue."}}
{"actor":{"display_login":"gerdstolpmann"}}