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

Fixes for 0.18.1 #62

Merged
merged 2 commits into from
May 26, 2018
Merged

Fixes for 0.18.1 #62

merged 2 commits into from
May 26, 2018

Conversation

genotrance
Copy link
Collaborator

Fixes for ""[0]

tests/tester.nim Outdated
else:
result.add(c[0])
return
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When writing code like this, instead of wrapping the code in an if, just write the following above the code:

if c.len() == 0:
  return

It's the same and it makes the code less messy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

try:
eraseLine()
except OSError:
discard
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a valid fix for whatever issue this fixes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This happens when running tests - there's no terminal available so eraseLine() raises OSError.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then how have the tests worked before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only Windows raises OSError, Linux does not so I can only guess that this wasn't tested on Windows before.

quotedArgs = quoted_args.map((x: string) => ("\"" & x & "\""))
for i in 0..quotedArgs.len-1:
if " " in quotedArgs[i]:
quotedArgs[i] = "\"" & quotedArgs[i] & "\""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a reason to do this. Quoting everything is fine, and the code is much more succinct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it is failing tests even on 0.18.0 since it is appending spaces or " to file paths for --nimbleDir or --choosenimDir which then no longer resolve as paths. It's easier fixing the tester than changing choosenim parseCliParams().

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, how did this pass before?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't pass for me even on 0.18.0, I think it is probably because of running the tests on Windows. It never passed for me because the command line params were getting messed up.

@genotrance
Copy link
Collaborator Author

Verified tests pass on latest #head of Nim on both Windows and Linux. I require the patched untar without which the following error occurs.

 Extracting nim-0.16.0.tar.xz
       Tip: 1 messages have been suppressed, use --verbose to show them.
     Error: choosenim.nim(206)       choosenim
        ... choosenim.nim(187)       performAction
        ... choosenim.nim(89)        choose
        ... choosenim.nim(72)        chooseVersion
        ... choosenim.nim(39)        installVersion
        ... utils.nim(51)            extract
        ... Unable to extract. Error was 'invalid integer: '.

Invalid integer is raised by parseOctInt(). I'm checking to see if there were any code changes in that proc recently.

@dom96 dom96 merged commit 0144383 into dom96:master May 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants