{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/11242","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/11242/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11242/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/11242/events","html_url":"https://github.com/JuliaLang/julia/pull/11242","id":75459510,"number":11242,"title":"NTuples made me sad (so I nixed them)","user":{"login":"timholy","id":1525481,"avatar_url":"https://avatars.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"timholy","id":1525481,"avatar_url":"https://avatars.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/JuliaLang/julia/milestones/14","html_url":"https://github.com/JuliaLang/julia/milestones/0.5.0","labels_url":"https://api.github.com/repos/JuliaLang/julia/milestones/14/labels","id":868319,"number":14,"title":"0.5.0","description":"Release-defining items for v0.5 - the `Arraymageddon` release.","creator":{"login":"vtjnash","id":330950,"avatar_url":"https://avatars.githubusercontent.com/u/330950?v=3","gravatar_id":"","url":"https://api.github.com/users/vtjnash","html_url":"https://github.com/vtjnash","followers_url":"https://api.github.com/users/vtjnash/followers","following_url":"https://api.github.com/users/vtjnash/following{/other_user}","gists_url":"https://api.github.com/users/vtjnash/gists{/gist_id}","starred_url":"https://api.github.com/users/vtjnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vtjnash/subscriptions","organizations_url":"https://api.github.com/users/vtjnash/orgs","repos_url":"https://api.github.com/users/vtjnash/repos","events_url":"https://api.github.com/users/vtjnash/events{/privacy}","received_events_url":"https://api.github.com/users/vtjnash/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":46,"state":"open","created_at":"2014-11-16T16:16:12Z","updated_at":"2016-05-03T01:52:14Z","due_on":"2016-04-01T04:00:00Z","closed_at":null},"comments":98,"created_at":"2015-05-12T04:42:04Z","updated_at":"2016-05-03T12:20:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/11242","html_url":"https://github.com/JuliaLang/julia/pull/11242","diff_url":"https://github.com/JuliaLang/julia/pull/11242.diff","patch_url":"https://github.com/JuliaLang/julia/pull/11242.patch"},"body":"This rabbit hole turned out to be a giant dungeon, ~~instead, and I haven't yet found the exit. I think I'm very close, but I've spent far too much time on this and I'm beginning to run out of ideas and energy.~~, but yay, I found the exit.\r\n\r\nThis is the latest attempt at `NTuple{N,T} -> Tuple{Vararg{T,N}}`, aka #10911, #10691. Julia builds and passes ~~many~~ all tests, ~~but borks on some (e.g., `subarray`). The current problem seems to be that a `VarState(Tuple{_<:Vararg{T,N}},false)` gets injected somewhere (leading ultimately to an attempted `Tuple{Vararg, ASCIIString}` and `Vararg type in non-final position` error). It's probably a 3-line fix, but I have not yet succeeded in finding the correct 3 lines (inference.jl is difficult for not-Jeff to hack on).~~\r\n\r\n~~This still contains~~The intermediate commits contain a lot of debugging code that ~~will eventually be~~ was deleted in the later commits. In the end, the way I got this ~~far~~to work was to write new versions of `jl_intersect_type`, `jl_subtype_le`, `type_morespecific`, and `type_match_`, which (1) called the old algorithm and stored the result, then (2) translated NTuples on-the-fly and then called the new algorithm with the translated arguments, and (3) printed some output if the two disagreed. ~~This branch is partway through the deletion of all that debugging code; before completing the migration I'd love to figure out where the problem is.~~\r\n\r\nIt turns out that we have enough differences in how `NTuple`s and `Tuple{Vararg}`s behave that some disagreements are unavoidable; one of the best things about this, presumably, is that such differences will go away. I even went to the trouble to catalog the differences; in the \"best\" column I use \"N\" to indicate that I think the new algorithm yields the most sensible result, and \"O\" to indicate the old algorithm. Only two of those four algorithms had differences, of which representative examples are:\r\n\r\n`jl_intersect_type`:\r\nnone (as measured by a <: b && b <: a)\r\n\r\n`jl_subtype_le`:\r\n\r\n| a | b | ta | invariant | old result | new result | best |\r\n| --- | --- | --- | --------- | ---------- | ---------- | ---- |\r\n| `_<:Tuple` | `Tuple` | 0 | 0 | 0 | 1 | N |\r\n| `_<:Tuple{_<:Vararg{T<:Any, N<:Any}}` | `Tuple{Vararg{#T<:Any, N<:Any}}` | 0 | 0 | 0 | 1 | N? |\r\n| `Tuple{}` | `NTuple{#_<:Any, #T<:Any}` | 0 | 1 | 1 | ~~0~~1 | ~~O~~same |\r\n| `Tuple{Tuple{_<:Tuple{Any, Any}}}` | `Tuple{Tuple{Tuple{Any, Any}}}` | 0 | 0 | 0 | 1 | N? |\r\n| `_<:Tuple{Vararg{Int64, #N<:Any}}` | `Tuple{Vararg{#T<:Any, #_<:Any}}` | 0 | 0 | 0 | 1 | N? |\r\n| `Tuple{Symbol, Integer}` | `Tuple{Vararg{#T<:Any, N<:Any}}` | 0 | 1 | 0 | 1 | ? |\r\n| `Tuple{Char, Char}` | `Tuple{Vararg{#T<:Any, N<:Any}}` | 0 | 1 | 0 | 1 | N |\r\n| `Tuple{Type{Tuple{Int64, Int64}}}` | `Tuple{Type{Tuple{Int64, Vararg{Int64, N<:Any}}}}` | 0 | 0 | 0 | 1 | N? |\r\n| `Tuple{Type{Tuple{Char}}, Tuple{Vararg{Any, N<:Any}}}` | `Tuple{Type{Tuple{Vararg{#T<:Any, N<:Any}}}, Tuple}` | 0 | 0 | 0 | 1 | N |\r\n| `Tuple{Tuple{_<:Tuple{Vararg{Any, N<:Any}}}, Int64}` | `Tuple{Tuple{Tuple{Vararg{Any, N<:Any}}}, Int64}` | 0 | 0 | 0 | 1 | N? |\r\n| `Tuple{Tuple{Symbol, Vararg{Symbol, N<:Any}}, DataType, Type{T<:Any}}` | `Tuple{Vararg{#T<:Any, N<:Any}}` | 0 | 1 | 0 | 1 | N |\r\n| `_<:Tuple{Symbol, Vararg{Symbol, N<:Any}}` | `Tuple` | 0 | 0 | 0 | 1 | N |\r\n| `Tuple{DataType, Type}` | `Tuple{Vararg{#T<:Any, N<:Any}}` | 0 | 1 | 0 | 1 | N? |\r\n| `_<:Tuple{Tuple{Symbol, Vararg{Symbol, N<:Any}}, DataType, Type{T<:Any}}` | `Tuple{Tuple{Vararg{Any, N<:Any}}, DataType, Vararg{Any, N<:Any}}` | 0 | 0 | 0 | 1 | N? |\r\n| `Tuple{Type{Tuple{Type{Base.IteratorsMD.CartesianIndex}, Tuple{Int64, Int64, Int64}}}, UInt64}` | `Tuple{Type{Tuple{Type{Base.IteratorsMD.CartesianIndex}, Tuple{Vararg{Int64, N<:Any}}}}, UInt64}` | 0 | 0 | 0 | 1 | N? |\r\n\r\n`jl_type_morespecific`:\r\nnone\r\n\r\n`type_match_`:\r\n\r\n| child | parent | morespecific | invariant | old result | new result | best |\r\n| ----- | ------ | ------------ | --------- | ---------- | ---------- | ---- |\r\n| `NTuple{#N<:Any, Int}` | `NTuple{#N<:Any, Integer}` | 0 | 0 | 0 | 1 | N |\r\n| `Tuple{Ptr{#T<:Any}, NTuple{#N<:Any, Int64}}` | `Tuple{Ptr{#T<:Any}, NTuple{#N<:Any, Integer}}` | 1 | 0 | 0 | 1 | N |\r\n\r\nNote that ~~in only one case does~~there are no cases where the result in current master seems to make more sense to me than the version here. I think there's some chance that, once working, this will fix some ambiguity and similar problems.\r\n"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/216510907","html_url":"https://github.com/JuliaLang/julia/pull/11242#issuecomment-216510907","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11242","id":216510907,"user":{"login":"jrevels","id":3277443,"avatar_url":"https://avatars.githubusercontent.com/u/3277443?v=3","gravatar_id":"","url":"https://api.github.com/users/jrevels","html_url":"https://github.com/jrevels","followers_url":"https://api.github.com/users/jrevels/followers","following_url":"https://api.github.com/users/jrevels/following{/other_user}","gists_url":"https://api.github.com/users/jrevels/gists{/gist_id}","starred_url":"https://api.github.com/users/jrevels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrevels/subscriptions","organizations_url":"https://api.github.com/users/jrevels/orgs","repos_url":"https://api.github.com/users/jrevels/repos","events_url":"https://api.github.com/users/jrevels/events{/privacy}","received_events_url":"https://api.github.com/users/jrevels/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T12:20:28Z","updated_at":"2016-05-03T12:20:28Z","body":"This PR's build failed on @nanosoldier (it tried to run `make -j 6`):\r\n\r\n```\r\nAssembler messages:\r\nFatal error: can't create CMakeFiles/libgit2_clar.dir/tests/cherrypick/bare.c.o: Operation not permitted\r\nAssembler messages:\r\nFatal error: can't create .libs/fdiv_q.o: Operation not permitted\r\nAssembler messages:\r\nFatal error: can't create CMakeFiles/libgit2_clar.dir/tests/cherrypick/workdir.c.o: Operation not permitted\r\nmake[4]: *** [CMakeFiles/libgit2_clar.dir/tests/cherrypick/workdir.c.o] Error 1\r\nmake[4]: *** Waiting for unfinished jobs....\r\nmake[4]: *** [CMakeFiles/libgit2_clar.dir/tests/cherrypick/bare.c.o] Error 1\r\nmake[3]: *** [CMakeFiles/libgit2_clar.dir/all] Error 2\r\nmake[2]: *** [all] Error 2\r\nmake[1]: *** [build/libgit2-785d8c48ea8725691da3c50e7dae8751523d4c30/libgit2.so] Error 2\r\nmake[1]: *** Waiting for unfinished jobs....\r\nmake[7]: Makefile: Operation not permitted\r\nmake[7]: *** No rule to make target `all-am'.  Stop.\r\nmake[6]: *** [all] Error 2\r\nmake[5]: *** [all-recursive] Error 1\r\nmake[4]: *** [all-recursive] Error 1\r\nmake[3]: *** [all-recursive] Error 1\r\nmake[2]: *** [all] Error 2\r\nmake[1]: *** [build/fftw-3.3.4-double/.libs/libfftw3.so] Error 2\r\nmake[4]: *** [fdiv_q.lo] Error 1\r\nmake[4]: *** Waiting for unfinished jobs....\r\n/bin/bash: ../../../libtool: Operation not permitted\r\n/bin/bash: ../libtool: Operation not permitted\r\nmake[4]: *** [fdiv_qr.lo] Error 126\r\nmake[7]: *** [genus.lo] Error 126\r\nmake[7]: *** Waiting for unfinished jobs....\r\n/bin/bash: ../../../libtool: Operation not permitted\r\nmake[7]: *** [codlist.lo] Error 126\r\n        From worker 2:  libtool: compile:  gcc -m64 -std=gnu99 -DHAVE_CONFIG_H -I. -I/mirror/mpiuser/workdir/tmpH8zkGn/julia_cd910cf7553cddd300a37c091145d92f0edf7313/deps/srccache/gmp-6.1.0/mpz -I.. -D__GMP_WITHIN_GMP -I/mirror/mpiuser/workdir/tmpH8zkGn/julia_cd910cf7553cddd300a37c091145d92f0edf7313/deps/srccache/gmp-6.1.0 -O2 -pedantic -fomit-frame-pointer -m64 -mtune=k8 -march=k8 -c /mirror/mpiuser/workdir/tmpH8zkGn/julia_cd910cf7553cddd300a37c091145d92f0edf7313/deps/srccache/gmp-6.1.0/mpz/fdiv_q_ui.c  -fPIC -DPIC -o .libs/fdiv_q_ui.o\r\ncc1: fatal error: /mirror/mpiuser/workdir/tmpH8zkGn/julia_cd910cf7553cddd300a37c091145d92f0edf7313/deps/srccache/gmp-6.1.0/mpz/fdiv_q_ui.c: Operation not permitted\r\ncompilation terminated.\r\nmake[7]: *** [q1bv_8.lo] Error 1\r\nmake[6]: *** [all] Error 2\r\nmake[5]: *** [all-recursive] Error 1\r\nmake[4]: *** [all-recursive] Error 1\r\nmake[3]: *** [all-recursive] Error 1\r\nmake[2]: *** [all] Error 2\r\nmake[1]: *** [build/fftw-3.3.4-single/.libs/libfftw3f.so] Error 2\r\nmake[4]: *** [fdiv_q_ui.lo] Error 1\r\nmake[3]: *** [all-recursive] Error 1\r\nmake[2]: *** [all] Error 2\r\nmake[1]: *** [build/gmp-6.1.0/.libs/libgmp.so] Error 2\r\nmake: *** [julia-deps] Error 2\r\n```\r\n\r\nLooks like a deps permissions issue though - did something there change recently? @nanosoldier's most recent build before this (#1607) went fine."}}