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

Locale native test fails on Unix #2997

Closed
thezim opened this issue Jan 11, 2017 · 10 comments
Closed

Locale native test fails on Unix #2997

thezim opened this issue Jan 11, 2017 · 10 comments
Labels
Area-Maintainers-Build specific to affecting the build OS-Linux OS-macOS Resolution-Fixed The issue is fixed.

Comments

@thezim
Copy link
Contributor

thezim commented Jan 11, 2017

Steps to reproduce

Run build per documentation.

Expected behavior

Builds successfully.

Actual behavior

Build fails with the following.

[----------] 1 test from LocaleTest
[ RUN      ] LocaleTest.Success
/Users/foobaruser/Source/PowerShell/src/libpsl-native/test/test-locale.cpp:20: Failure
Value of: "US-ASCII"
Expected: nl_langinfo(0)
Which is: "UTF-8"
[  FAILED  ] LocaleTest.Success (0 ms)
[----------] 1 test from LocaleTest (0 ms total)

Environment data

macOS 10.12

@SteveL-MSFT SteveL-MSFT added Area-Maintainers-Build specific to affecting the build OS-macOS labels Jan 12, 2017
@SteveL-MSFT SteveL-MSFT added this to the 6.0.0-beta milestone Jan 12, 2017
@andyleejordan
Copy link
Member

@thezim this isn't a build failure, this is a unit test failure. Can you set your locale to UTF-8? .NET Core isn't expected to work with any other locales currently (that said, ASCII is probably going to work, but still going to fail the sanity test).

@thezim
Copy link
Contributor Author

thezim commented Jan 13, 2017

My text encoding was set to "UTF-8" in the Terminal app. While research how to change the locale I came across this article which was helpful. Unchecking the Terminal > Preferences > Advanced > Set locale environment variables on startup corrected the issue.

That being said should the build documentation be update with this tidbit as Set locale environment variables on startup is checked by default in macOS 10.12 (Sierra). I know 10.12 isn't officially supported yet but this will be an issue moving forward. I do not have access to a 10.11 machine so I cant tell you what the default setting there is.

With Set locale environment variables on startup checked.

thezim@foobarhost ~ $ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=
thezim@foobarhost ~ $ 

With Set locale environment variables on startup unchecked.

thezim@foobarhost ~ $ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
thezim@foobarhost ~ $ 

@mwallner
Copy link

this issue generally affects all terminals (#3063) that do not use utf-8 .. as @andschwa mentioned .NET core currently relies on UTF-8 I can't really complain that much .. still not a clean test ..

@vors
Copy link
Collaborator

vors commented Jan 27, 2017

I actually have problem earlier during the build on 10.12

PS /PowerShell> Start-PSBuild -Clean
Cleaning your working directory. You can also do it with 'git clean -fdX'
Removing powershell.version
VERBOSE: Using configuration 'Linux'
VERBOSE: Top project directory is /PowerShell/src/powershell-unix
VERBOSE: Using framework 'netcoreapp1.1'
The variable cannot be validated because the value osx.10.12-x64 is not a valid value for the Runtime variable.
At /PowerShell/build.psm1:528 char:9
+         $Runtime = dotnet --info | % {
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [], ValidationMetadataException
    + FullyQualifiedErrorId : ValidateSetFailure

Could not determine Runtime Identifier, please update dotnet
At /PowerShell/build.psm1:535 char:13
+             Throw "Could not determine Runtime Identifier, please upd ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not deter...e update dotnet:String) [], RuntimeException
    + FullyQualifiedErrorId : Could not determine Runtime Identifier, please update dotnet

@mwallner
Copy link

@vors what you are describing matches the issue text but is not related with the error @thezim is having (build failure vs test failure after successful build)

@vors
Copy link
Collaborator

vors commented Jan 28, 2017

Fair point

@vors vors changed the title Build fails on macOS 10.12 (Sierra) native test fails on macOS 10.12 (Sierra) Jan 28, 2017
@vors
Copy link
Collaborator

vors commented Jan 28, 2017

There was same problem reported on gitter
https://gist.github.com/mwallner/457bde412489830319be10212bfb91e7#file-psl-native-test-log

Looks like an incorrect test for me.
The locale is a machine-wide setting that could be not UTF8.

@mwallner
Copy link

@vors please remove macOS from the title (replace with Nix*-like OSes??) and add 'Linux' as label :-)

@vors vors added the OS-Linux label Jan 28, 2017
@vors vors changed the title native test fails on macOS 10.12 (Sierra) Locale native test fails on Unix Jan 28, 2017
@andyleejordan
Copy link
Member

@vors if the locale is not UTF-8, we have no guarantees that CoreCLR will work correctly. Much code depends on being able to marshal UTF-8 char* strings to C# UTF-16 strings. Can we verify how CoreCLR handles the case where the locale is not UTF-8?

@SteveL-MSFT SteveL-MSFT modified the milestones: 6.0.0-beta1, 6.0.0-beta2 Mar 16, 2017
@SteveL-MSFT SteveL-MSFT modified the milestones: 6.0.0-beta, 6.0.0 May 15, 2017
@SteveL-MSFT SteveL-MSFT removed this from the 6.0.0-NiceToHave milestone Jul 22, 2018
@SteveL-MSFT
Copy link
Member

Haven't seen an issue with this anymore

@iSazonov iSazonov added the Resolution-Fixed The issue is fixed. label Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Maintainers-Build specific to affecting the build OS-Linux OS-macOS Resolution-Fixed The issue is fixed.
Projects
None yet
Development

No branches or pull requests

6 participants