{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/26051","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/26051/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/26051/comments","events_url":"https://api.github.com/repos/golang/go/issues/26051/events","html_url":"https://github.com/golang/go/issues/26051","id":335512674,"node_id":"MDU6SXNzdWUzMzU1MTI2NzQ=","number":26051,"title":"x/build: add js/wasm Chrome/Firefox capable trybot","user":{"login":"myitcv","id":3374574,"node_id":"MDQ6VXNlcjMzNzQ1NzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3374574?v=4","gravatar_id":"","url":"https://api.github.com/users/myitcv","html_url":"https://github.com/myitcv","followers_url":"https://api.github.com/users/myitcv/followers","following_url":"https://api.github.com/users/myitcv/following{/other_user}","gists_url":"https://api.github.com/users/myitcv/gists{/gist_id}","starred_url":"https://api.github.com/users/myitcv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myitcv/subscriptions","organizations_url":"https://api.github.com/users/myitcv/orgs","repos_url":"https://api.github.com/users/myitcv/repos","events_url":"https://api.github.com/users/myitcv/events{/privacy}","received_events_url":"https://api.github.com/users/myitcv/received_events","type":"User","site_admin":false},"labels":[{"id":943041965,"node_id":"MDU6TGFiZWw5NDMwNDE5NjU=","url":"https://api.github.com/repos/golang/go/labels/Arch-Wasm","name":"Arch-Wasm","color":"5319e7","default":false},{"id":223401461,"node_id":"MDU6TGFiZWwyMjM0MDE0NjE=","url":"https://api.github.com/repos/golang/go/labels/Builders","name":"Builders","color":"ededed","default":false},{"id":373540105,"node_id":"MDU6TGFiZWwzNzM1NDAxMDU=","url":"https://api.github.com/repos/golang/go/labels/FeatureRequest","name":"FeatureRequest","color":"bfd4f2","default":false},{"id":373399998,"node_id":"MDU6TGFiZWwzNzMzOTk5OTg=","url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/22","html_url":"https://github.com/golang/go/milestone/22","labels_url":"https://api.github.com/repos/golang/go/milestones/22/labels","id":1067491,"node_id":"MDk6TWlsZXN0b25lMTA2NzQ5MQ==","number":22,"title":"Unreleased","description":"Issues that do not affect released Go code and binaries.\r\n","creator":{"login":"rsc","id":104030,"node_id":"MDQ6VXNlcjEwNDAzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":903,"closed_issues":1529,"state":"open","created_at":"2015-04-14T18:48:22Z","updated_at":"2018-08-04T06:21:10Z","due_on":"2099-12-31T08:00:00Z","closed_at":null},"comments":14,"created_at":"2018-06-25T18:11:58Z","updated_at":"2018-08-04T17:12:21Z","closed_at":null,"author_association":"MEMBER","body":"Follow on from https://github.com/golang/go/issues/26015#issuecomment-400029578\r\n\r\nWith a Chrome and/or Firefox capable trybot we'd be able to do more interesting WASM tests in a headless browser-based JS VM, and so have access to the DOM etc.\r\n\r\nThis issue is to decide whether or not such a trybot would be useful and therefore worth the effort."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/410463945","html_url":"https://github.com/golang/go/issues/26051#issuecomment-410463945","issue_url":"https://api.github.com/repos/golang/go/issues/26051","id":410463945,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDQ2Mzk0NQ==","user":{"login":"agnivade","id":1774000,"node_id":"MDQ6VXNlcjE3NzQwMDA=","avatar_url":"https://avatars1.githubusercontent.com/u/1774000?v=4","gravatar_id":"","url":"https://api.github.com/users/agnivade","html_url":"https://github.com/agnivade","followers_url":"https://api.github.com/users/agnivade/followers","following_url":"https://api.github.com/users/agnivade/following{/other_user}","gists_url":"https://api.github.com/users/agnivade/gists{/gist_id}","starred_url":"https://api.github.com/users/agnivade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agnivade/subscriptions","organizations_url":"https://api.github.com/users/agnivade/orgs","repos_url":"https://api.github.com/users/agnivade/repos","events_url":"https://api.github.com/users/agnivade/events{/privacy}","received_events_url":"https://api.github.com/users/agnivade/received_events","type":"User","site_admin":false},"created_at":"2018-08-04T17:12:21Z","updated_at":"2018-08-04T17:12:21Z","author_association":"MEMBER","body":"Looked into this a bit more. There is a non-standard filesystem API which is implemented only by Chrome. https://developer.mozilla.org/en-US/docs/Web/API/Window/requestFileSystem. Using this, we can read/write files from the browser. So, if we implement the `global.fs` object inside wasm_exec.js to fill out all the filesystem calls, then it can work.\r\n\r\nBut unfortunately, the sync versions of those [APIs](https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystemSync), which is what we need to use to call from Go space, do not work. The page itself says `This specification is more or less abandonned, failing to get significant traction.` and the w3c [page](https://www.w3.org/TR/file-system-api/) mentions `\r\nWork on this document has been discontinued and it should not be referenced or used as a basis for implementation.`.\r\n\r\nSo unless we can use the async APIs, it does not seem possible to read/write files from browser. The `syscall/fs_js.go` file uses sync APIs to interact with nodeJS. We would need to change that to be async, which seems pretty cumbersome to me, because there will be intricate callbacks to respond to browser functions.\r\n\r\nSo as it stands - \r\n- Go uses sync fs APIs.\r\n- Browser allows only async fs APIs.\r\n- Change Go to use async APIs ? Hard.\r\n- Somehow ignore filesystem errors when running tests in browser ? Not sure how. But that is the closest we can get to a working solution.\r\n\r\n@neelance \r\n\r\n"}}
{"actor":{"display_login":"agnivade"}}