Bug: Publish optimization uses a hardcoded runtime linux-x64 again.
See original GitHub issueDescription
I fixed this issue 2 years ago(https://github.com/aws/aws-extensions-for-dotnet-cli/issues/26), and now it seems like it’s back. Starting with #112 the linux-x64
moniker is used instead of the rhel.7.2-x64
. While rhel.7.2-x64
was not the perfect choice for the runtime, internet says that rhel is in general quite compatible with amazon linux. And that rhel7 and amazon linux 2 are pretty close. And this mention was in the code, but was removed here.
This time the bug is pretty sneaky, as for me everything broke after I updated to netcoreapp3.1. Now there’s a switch that selects the moniker here and it works fine for the previous versions, while for netcoreapp3.1 (well anything other than 1.0, 2.0 and 2.1) it selects linux-x64
and my app stops working.
The issue is the same for me as it was before. But this time not only for me, you can see @boemekeld posting about it here and here.
My experience shows that most of the time linux-x64
means ubuntu/debian distros and not rhel/centos/amazonlinux. Static linking will probably solve the issue, but so far I don’t see library developers doing it (and they have reasons for this). So in my eyes, it’s still reasonable to do best effort compatibility instead of asking users to build workarounds like @ashishdhingra suggested in his response to @boemekeld.
@boemekeld also said that rhel worked just fine for him. I didn’t re-test it, but I imagine that this would be the case, like with the old version.
@normj what was the reason to change the behavior? Can you please make it work again?
Reproduction Steps
See @boemekeld’s ticket here.
Logs
See @boemekeld’s ticket here.
Environment
- Build Version: 4.1.0
- OS Info: AmazonLinux
- Build Environment: CodeBuild’s Ubuntu standard 4.0
- Targeted .NET Platform: AnyCPU
Resolution
- 👋 I can/would-like-to implement a fix for this problem myself
Well, I can remove the switch, like so: https://github.com/aws/aws-extensions-for-dotnet-cli/pull/137
This is a 🐛 bug-report
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6 (4 by maintainers)
Top GitHub Comments
Sorry this change messed up your packaging. I made the change for 3.1 to use linux-x64 because it seemed like that is what the .NET team at Microsoft has been trying to push people to use and using the
rhel.7.2-x64
RID always seemed like a bit of a lie. Also Lambda 3.1 runs on Amazon Linux 2 which as I understand varies more then Amazon Linux from rhel.I would rather keep the linux-x64 but I wonder if I updated the deployment code to inspect the
--msbuild-parameters
switch and if it was specially setting the runtime then don’t override it with linux-x64. That would give you a workaround where you could just set the runtime in your aws-lambda-tools-defaults.json file. Would that be acceptable?Thanks for that @derwasp