Azure / Azure/bicep

Set Invariant Globalization for bicep

Open
#1,938 3 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
v0.3.1

**Describe the bug**
Wen trying to use bicep and cli on buster-slim image I was receiving error:
```
Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
at System.Environment.FailFast(System.String)
at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
at System.Globalization.GlobalizationMode..cctor()
at System.Globalization.CultureData.CreateCultureWithInvariantData()
at System.Globalization.CultureData.get_Invariant()
at System.Globalization.CultureInfo..cctor()
at System.Globalization.CultureInfo.get_InvariantCulture()
at System.Text.RegularExpressions.Regex.Init(System.String, System.Text.RegularExpressions.RegexOptions, System.TimeSpan, System.Globalization.CultureInfo)
at System.Text.RegularExpressions.Regex..ctor(System.String, System.Text.RegularExpressions.RegexOptions, System.TimeSpan, System.Globalization.CultureInfo)
at System.Text.RegularExpressions.Regex..ctor(System.String, System.Text.RegularExpressions.RegexOptions)
at Bicep.Core.Resources.ResourceTypeReference..cctor()
at Bicep.Core.Resources.ResourceTypeReference.TryParse(System.String)
at Bicep.Core.Resources.ResourceTypeReference.Parse(System.String)
at Bicep.Core.TypeSystem.Az.AzResourceTypeProvider+<>c.b__8_0(System.Collections.Generic.KeyValuePair`2)
at System.Linq.Enumerable.ToDictionary[[System.Collections.Generic.KeyValuePair`2[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Collections.Generic.IEnumerable`1>, System.Func`2,System.__Canon>, System.Func`2,System.__Canon>, System.Collections.Generic.IEqualityComparer`1)
at Bicep.Core.TypeSystem.Az.AzResourceTypeProvider.GetAvailableResourceTypes(Azure.Bicep.Types.Az.ITypeLoader)
at Bicep.Core.TypeSystem.Az.AzResourceTypeProvider..ctor(Azure.Bicep.Types.Az.ITypeLoader)
at Bicep.Core.TypeSystem.Az.AzResourceTypeProvider..ctor()
at Bicep.Cli.Program.Main(System.String[])
```
**To Reproduce**
pull docker buster-slim image, install CLI and bicep, try to deploy image

**Additional context**
solution to this is to either:
1) set environment variable on the docker DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
2) set InvartiantGlobalization to true in project settings: https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#invariantglobalization

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure by running the Bicep CLI in a Debian buster-slim image, using the stack trace through Bicep.Cli.Program.Main as the entry point. Check how the CLI is packaged and launched, then verify that it starts and can deploy without the ICU error when the selected globalization setting is applied.

Written by the indexing model from the issue text.

Assessment

Tech stack
debian, docker
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.