question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Publish optimization uses a hardcoded runtime linux-x64 again.

See original GitHub issue

Description

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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
normjcommented, Oct 1, 2020

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?

2reactions
boemekeldcommented, Sep 21, 2020

Thanks for that @derwasp

Read more comments on GitHub >

github_iconTop Results From Across the Web

ampproject/toolbox-runtime-version
Use it to query cdn.ampproject.org for the current release or canary version of the AMP Runtime. Uses a stale-while-revalidate caching strategy to avoid ......
Read more >
NET 5.0 Single File Publish user.config issue
I'm trying to migrate WPF project from .NET Core 3.1 to .NET 5.0. My project uses default properties file (user.config) to store some...
Read more >
ampproject/toolbox-script-csp
Fast, reliable, and secure dependency management.
Read more >
.NET Core Self-Contained and Framework-Dependent ...
In this post, I explain the difference between framework-dependent deployments and self-contained deployments, review the pros and cons of each, ...
Read more >
An Optimized Intermediate Representation for Binary ...
A binary rewriter can reuse the work performed by the original compiler to minimize the optimization time at runtime. Different techniques were invented...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found