{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/35543","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/35543/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/35543/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/35543/events","html_url":"https://github.com/NixOS/nixpkgs/issues/35543","id":300028213,"number":35543,"title":"buildPackages should not know about the top-level targetPlatform","user":{"login":"shlevy","id":487050,"avatar_url":"https://avatars3.githubusercontent.com/u/487050?v=4","gravatar_id":"","url":"https://api.github.com/users/shlevy","html_url":"https://github.com/shlevy","followers_url":"https://api.github.com/users/shlevy/followers","following_url":"https://api.github.com/users/shlevy/following{/other_user}","gists_url":"https://api.github.com/users/shlevy/gists{/gist_id}","starred_url":"https://api.github.com/users/shlevy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shlevy/subscriptions","organizations_url":"https://api.github.com/users/shlevy/orgs","repos_url":"https://api.github.com/users/shlevy/repos","events_url":"https://api.github.com/users/shlevy/events{/privacy}","received_events_url":"https://api.github.com/users/shlevy/received_events","type":"User","site_admin":false},"labels":[{"id":6314750,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/0.kind:%20bug","name":"0.kind: bug","color":"84b6eb","default":false},{"id":443329087,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/6.topic:%20cross-compilation","name":"6.topic: cross-compilation","color":"fef2c0","default":false},{"id":549491066,"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/6.topic:%20developer%20experience","name":"6.topic: developer experience","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":{"login":"Ericson2314","id":1055245,"avatar_url":"https://avatars3.githubusercontent.com/u/1055245?v=4","gravatar_id":"","url":"https://api.github.com/users/Ericson2314","html_url":"https://github.com/Ericson2314","followers_url":"https://api.github.com/users/Ericson2314/followers","following_url":"https://api.github.com/users/Ericson2314/following{/other_user}","gists_url":"https://api.github.com/users/Ericson2314/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericson2314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericson2314/subscriptions","organizations_url":"https://api.github.com/users/Ericson2314/orgs","repos_url":"https://api.github.com/users/Ericson2314/repos","events_url":"https://api.github.com/users/Ericson2314/events{/privacy}","received_events_url":"https://api.github.com/users/Ericson2314/received_events","type":"User","site_admin":false},"assignees":[{"login":"Ericson2314","id":1055245,"avatar_url":"https://avatars3.githubusercontent.com/u/1055245?v=4","gravatar_id":"","url":"https://api.github.com/users/Ericson2314","html_url":"https://github.com/Ericson2314","followers_url":"https://api.github.com/users/Ericson2314/followers","following_url":"https://api.github.com/users/Ericson2314/following{/other_user}","gists_url":"https://api.github.com/users/Ericson2314/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericson2314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericson2314/subscriptions","organizations_url":"https://api.github.com/users/Ericson2314/orgs","repos_url":"https://api.github.com/users/Ericson2314/repos","events_url":"https://api.github.com/users/Ericson2314/events{/privacy}","received_events_url":"https://api.github.com/users/Ericson2314/received_events","type":"User","site_admin":false}],"milestone":null,"comments":15,"created_at":"2018-02-25T13:58:50Z","updated_at":"2018-02-26T22:18:34Z","closed_at":null,"author_association":"MEMBER","body":"Currently when cross-compiling, the `buildPackages` set sees the top-level `targetPlatform` and thus cross-compiling-aware toolchain components are built to target `targetPlatform` instead of `buildPlatform`. To get access to a `buildPlatform`-targeted version of the tool, you need to access `buildPackages.buildPackages` or, in the special case of cc, we have a hack to make `buildPackages.stdenv.cc` do the right thing.\r\n\r\nAlso, anything that checks `targetPlatform != buildPlatform` (which is now aliased to `stdenv.isCross`) will get the wrong answer inside `buildPackages`.\r\n\r\nSemantically, it seems like `buildPackages` should be exactly the same package set you'd get if you weren't cross-compiling at all. Ideally we'd live in a world where all tools were like clang and didn't need specific advance target awareness, but for tools that do isn't this *exactly* what `targetPackages` is for? That is, shouldn't I take my build-native compiler from `buildPackages`, my cross-compiler from `targetPackages`, and my cross-compiled target-native compiler from `hostPackages`?\r\n\r\nAs an aside, those names are really unclear even though they are conventional. I'd expect `targetPackages` to be \"packages that run on the target\" and something like `crossPackages` to be the source of cross-compiling tools."},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/368671146","html_url":"https://github.com/NixOS/nixpkgs/issues/35543#issuecomment-368671146","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/35543","id":368671146,"user":{"login":"Ericson2314","id":1055245,"avatar_url":"https://avatars3.githubusercontent.com/u/1055245?v=4","gravatar_id":"","url":"https://api.github.com/users/Ericson2314","html_url":"https://github.com/Ericson2314","followers_url":"https://api.github.com/users/Ericson2314/followers","following_url":"https://api.github.com/users/Ericson2314/following{/other_user}","gists_url":"https://api.github.com/users/Ericson2314/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericson2314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericson2314/subscriptions","organizations_url":"https://api.github.com/users/Ericson2314/orgs","repos_url":"https://api.github.com/users/Ericson2314/repos","events_url":"https://api.github.com/users/Ericson2314/events{/privacy}","received_events_url":"https://api.github.com/users/Ericson2314/received_events","type":"User","site_admin":false},"created_at":"2018-02-26T22:18:34Z","updated_at":"2018-02-26T22:18:34Z","author_association":"MEMBER","body":"> Yes, but I still maintain the terminology is confusing. When you say \"your target\" in this context, I think \"the place this build will run\", not \"the place the things this build will build will run\".\r\n\r\nI agree the autoconf names suck. I kept them because the the concept of a \"target platform\" also sucks, and I wanted to use just one name for this lousy concept. I guess what I'm getting at is lets figure out if the naming scheme you want is isomorphic to what we have and then bikeshed the exact identifiers :)."}}
{"actor":{"display_login":"Ericson2314"}}