Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[urgent] [CI] broke recently for all PRs: tests/assign/tassign.nim broke #9339

Closed
timotheecour opened this issue Oct 12, 2018 · 4 comments
Closed

Comments

@timotheecour
Copy link
Member

timotheecour commented Oct 12, 2018

eg:
https://travis-ci.org/nim-lang/Nim/jobs/440787636 for a PR #9336 that only touches doc/manual.rst

testament/tester '--nim:compiler/nim ' cat assign 
FAIL: tassign.nim C
Test "tests/assign/tassign.nim" in category "assign"
Failure: reOutputsDiffer
Expected:
TEMP=C:\Programs\xyz\bin
8 5 0 0
pre test a:test b:1 c:2 haha:3
assignment test a:test b:1 c:2 haha:3
Concrete '='
Concrete '='
Concrete '='
Concrete '='
Concrete '='
GenericT[T] '=' int
GenericT[T] '=' float
GenericT[T] '=' float
GenericT[T] '=' float
GenericT[T] '=' string
GenericT[T] '=' int8
GenericT[T] '=' bool
GenericT[T] '=' bool
GenericT[T] '=' bool
GenericT[T] '=' bool
Gotten:
TEMP=C:\Programs\xyz\bin
8 5 0 0
pre test a:test b:1 c:2 haha:3
assignment test a:test b:1 c:2 haha:3

even if we fix this, how could it have passed through CI's testing ?

EDIT
I'm suspecting #9318 since it last touched tests/assign/tassign.nim but how come the CI was green for that PR? we shouldn't close this issue until we figure out root cause
/cc @narimiran @Araq

@LemonBoy
Copy link
Contributor

It was @Araq's last couple of commits that broke the CI and were directly pushed to devel

@timotheecour timotheecour changed the title [CI] broke recently for all PRs: tests/assign/tassign.nim broke [urgent] [CI] broke recently for all PRs: tests/assign/tassign.nim broke Oct 12, 2018
@narimiran
Copy link
Member

narimiran commented Oct 12, 2018

I'm suspecting #9318 since it last touched tests/assign/tassign.nim but how come the CI was green for that PR?

After that file was modified, the tests were run for six times in that PR: all six times there were no problems with that file.


EDIT: Building the latest Nim devel and running tests/assign/tassign.nim now produces this unexpected result.

This part:

import typetraits
block toverload_asgn:
  type
    Concrete = object
      a, b: string

  proc `=`(d: var Concrete; src: Concrete) =
    shallowCopy(d.a, src.a)
    shallowCopy(d.b, src.b)
    echo "Concrete '='"

  var x, y: array[0..2, Concrete]
  var cA, cB: Concrete

  var cATup, cBTup: tuple[x: int, ha: Concrete]

  x = y
  cA = cB
  cATup = cBTup

  type
    GenericT[T] = object
      a, b: T

  proc `=`[T](d: var GenericT[T]; src: GenericT[T]) =
    shallowCopy(d.a, src.a)
    shallowCopy(d.b, src.b)
    echo "GenericT[T] '=' ", type(T).name

  var ag: GenericT[int]
  var bg: GenericT[int]

  ag = bg

  var xg, yg: array[0..2, GenericT[float]]
  var cAg, cBg: GenericT[string]

  var cATupg, cBTupg: tuple[x: int, ha: GenericT[int8]]

  xg = yg
  cAg = cBg
  cATupg = cBTupg

  var caSeqg, cbSeqg: seq[GenericT[bool]]
  newSeq(cbSeqg, 4)
  caSeqg = cbSeqg

  when false:
    type
      Foo = object
        case b: bool
        of false: xx: GenericT[int]
        of true: yy: bool

    var
      a, b: Foo
    a = b

used to produce:

Concrete '='
Concrete '='
Concrete '='
Concrete '='
Concrete '='
GenericT[T] '=' int
GenericT[T] '=' float
GenericT[T] '=' float
GenericT[T] '=' float
GenericT[T] '=' string
GenericT[T] '=' int8
GenericT[T] '=' bool
GenericT[T] '=' bool
GenericT[T] '=' bool
GenericT[T] '=' bool

but now there's no output.

@Araq
Copy link
Member

Araq commented Oct 13, 2018

but now there's no output.

Sorry, my move optimizations now optimize away all the assignments...

@Araq Araq closed this as completed Oct 13, 2018
@timotheecour
Copy link
Member Author

timotheecour commented Oct 13, 2018

ref: 1475697 but unclear to me whether it's a proper fix or temporary workaround (in which case should we re-open?)

I'm disabling this section of the test... it's hard to fix, the compiler is way too smart/aggressive (gitter)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants