-
Notifications
You must be signed in to change notification settings - Fork 650
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
[Bug] GitVersion.MSBuild dotnet pack
fails under Linux
#2591
Comments
dotnet pack
fails under Linuxdotnet pack
fails under Linux
There is a property that sets the
|
You have 2 options, either remove/update that environment variable (but that might break something), or you can set the Language as a msbuild property (either in the csproj directly or via commandline) |
Those are good suggestions and I'll certainly try them as a workaround and report back. However, please note:
|
Actually that is not what GitVersion sets. That's the msbuild Property that msbuild sets |
Those are good suggestions and I'll certainly try them as a workaround and report back. However, please note:
|
I believe that MSBuild promotes environment variables to build properties. So this I don't understand why the |
In issue #2595 I have made some suggestions for handling the Language setting differently. The current approach is clearly flawed and in my humble opinion something needs to change. In my opinion, things should work for any valid MSBuild project on any platform/OS and not just for C#, F# and VB projects under Windows. |
This is a very annoying issue. The |
MSBuild's When looking at those files, I notice that in addition to
|
@ermshiperete thanks for taking the time to dig in. Can you try locally on your machine this potential fix? If it works can you fill in a PR? |
Yes, I tried it locally and it works. |
Great, then, could you please send us a PR with the fix? |
During regular builds MSBuild initializes `Language` to the language of the currently building project, e.g. C#. However, when running some targets like `pack` this doesn't happen. Therefore GitVersion has to add a default value for `Language`. Unfortunately `Language` is also an environment variable that GNU gettext uses, so the `pack` target will fail on most Linux systems where that environment variable is set. This change implements a fix by additionally checking `DefaultLanguageSourceExtension` which gets set by MSBuild at the same time as `Language`. If that isn't set we can be pretty sure that `Language` didn't get set automatically by MSBuild and can set a default value. This will cause existing builds to break IF they rely on being able to explicitly set `Language` to a value different from C#. However, I don't think this is a scenario that happens very often, and it can be easily worked around by setting the `DefaultLanguageSourceExtension` property to a non-empty value. This fixes #2591.
🎉 This issue has been resolved in version 5.6.7 🎉 Your GitReleaseManager bot 📦🚀 |
Describe the bug
My solution builds correctly and sets the TeamCity build number with the correct SemVer. It runs and passes all the unit tests.
Then it fails when running
dotnet pack
with the following build log output:(full build log at http://teamcity.tigra-astronomy.com:8111/viewLog.html?buildId=9842&buildTypeId=TigraOss_TaReactiveCommunications&tab=buildLog&branch_TigraOss=hotfix%2F1.3.2)
Expected Behavior
I would expect this step to have succeeded since the build step worked successfully and produced the correct SemVer.
I do not understand how I get different results for
dotnet build
anddotnet pack
.Actual Behavior
Some crazy error about an "unknown language". Why does it even require a language?
Steps to Reproduce
Unfortunately I'm not able to provide a test solution as I don't really understand the failure mechanism.
Context
It's a showstopper, I'm unable to complete my build. I don't believe there's anything wrong with my solution or build configuration. I'm not aware that GitVersion provides any way for me to pass in a
Language
parameter so this appears to be purely an internal error.Your Environment
TeamCity build server
Linux (Ubuntu 20.04) build agent (in a docker container) with GitVersion installed on the agent image.
The solution being built is https://github.com/Tigra-Astronomy/TA.ReactiveCommunications/tree/hotfix/1.3.2
The TeamCity build is http://teamcity.tigra-astronomy.com:8111/viewType.html?buildTypeId=TigraOss_TaReactiveCommunications&branch_TigraOss=hotfix%2F1.3.2&tab=buildTypeStatusDiv
The text was updated successfully, but these errors were encountered: