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

Testament megatest fails with Nim not found #10049

Closed
cooldome opened this issue Dec 19, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@cooldome
Copy link
Member

commented Dec 19, 2018

C:\nim-devel2\testament\tester.exe c megatest
joinable specs: 458
tester.nim(591)          tester
tester.nim(559)          main
categories.nim(644)      processCategory
categories.nim(562)      runJoinedTest
tester.nim(88)           execCmdEx2
osproc.nim(586)          startProcess
oserr.nim(67)            raiseOSError
Error: unhandled exception: The system cannot find the file specified.
Additional info: "Requested command not found: \'nim\'. OS error:" [OSError]

Both nim and nim_temp are available in C:\nim-devel2\bin location.

Also koch tests c megatest successfully builds Nim, but it is not used by megatest

@cooldome cooldome changed the title Testament megatest fails with nim not found Testament megatest fails with Nim not found Dec 19, 2018

@timotheecour

This comment has been minimized.

Copy link
Contributor

commented Dec 19, 2018

  • Would be nice to cleanup the logic for where to find default nim in testament (and maybe other places), using the new getCurrentCompilerExe, which doesnt require any PATH

  • is nim in your PATH?
    here's the relevant line:

var (buf, exitCode) = execCmdEx2(command = "nim", args = args, options = {poStdErrToStdOut, poUsePath}, input = "")
  • in any case, there's IMO a bug here:
    tester has
--nim:path                use a particular nim executable (default: compiler/nim)

but isn't used for megatest (and perhaps in other places)

@Araq

This comment has been minimized.

Copy link
Member

commented Dec 20, 2018

Do not use getCurrentCompilerExe, nobody wants binaries that are machine specific!

@cooldome

This comment has been minimized.

Copy link
Member Author

commented Dec 20, 2018

In the path I usually have release or stable version of Nim, this version of nim does not require further testing.
IMO, it is the right answer:

--nim:path                use a particular nim executable (default: compiler/nim)
@timotheecour

This comment has been minimized.

Copy link
Contributor

commented Dec 20, 2018

so the code we have (that relies on PATH) is wrong:
var (buf, exitCode) = execCmdEx2(command = "nim", args = args, options = {poStdErrToStdOut, poUsePath}, input = "")
as it's inconsistent with other tests and should be fixed so that the logic used for specifying which nim compiler is used should be same for megatest as for other tests.

so a potential fix:

  • add a single proc findTestingNimExe() (used everywhere relevant in testament) that:
    • uses --nim:path if specified
    • else, use compiler/nim

note

compiler/nim is build when you run ./koch tests :

proc tests(args: string) =
  nimexec "cc --opt:speed testament/tester"
  # Since tests take a long time (on my machine), and we want to defy Murhpys
  # law - lets make sure the compiler really is freshly compiled!
  nimexec "c --lib:lib -d:release --opt:speed compiler/nim.nim"
  let tester = quoteShell(getCurrentDir() / "testament/tester".exe)
  let success = tryExec tester & " " & (args|"all")
  if not existsEnv("TRAVIS") and not existsEnv("APPVEYOR"):
    exec tester & " html"
  if not success:
    quit("tests failed", QuitFailure)

/cc @Araq

timotheecour added a commit to timotheecour/Nim that referenced this issue Dec 23, 2018

@Araq Araq closed this in #10083 Dec 23, 2018

Araq added a commit that referenced this issue Dec 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.