Azure / Azure/bicep

Difference in case-sensitivity between Linux and Windows for compile-time imports paths

Open
#12,119 2 comments 0 reactions 0 assignees View on GitHub
good first issue story: linter rules
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 21m
Merged PRs (30d)
79

Description

**Bicep version**
Bicep CLI version 0.22.6 (d62b94db31)

**Describe the bug**
When using `"compileTimeImports": true`, the behaviour of `import { x } from 'path'` is different between Windows and Linux.

On Windows, the path is case insensitive.

On Linux, the path is case sensitive.

**To Reproduce**

Folder structure:

- RootFolder
- Modules
- module.bicep
- Types
- Microsoft.Provider.bicep

Assuming the following import statement in `module.bicep`
```
import { MyCustomType } from '../types/Microsoft.Provider.bicep'
...
```

On Windows, the template is compiled successfully using `az bicep build`

On Linux, the following error is triggered `/home/vsts/work/.../Modules/module.bicep : Error BCP091: An error occurred reading file. Could not find a part of the path '/home/vsts/work/1/.../types/Microsoft.Provider.bicep'.
`

**Additional Context**
To avoid issues with CI/CD systems running on a different OS than the one using for development. It would be better if the behaviours would be normalized or a warning showed to the user if the casing between the `import` and actual filename differs.

Contributor guide

Open the contributing guide

Research direction

Reproduce the case difference with az bicep build using Modules/module.bicep and Types/Microsoft.Provider.bicep on Linux and Windows. Trace compile-time import path resolution from the import in module.bicep; done means behavior is normalized across systems or a casing warning is shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
cli, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.