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

See original GitHub issue

LambdaDotNetCLIWrapper.cs has the following optimization, which is supposed to make the resulting zip smaller:

                // If you set the runtime linux-x64 it will trim out the Windows and Mac OS specific dependencies but Razor view precompilation
                // will not run. So only do this packaging optimization if there are no Razor views.
                if (Directory.GetFiles(fullProjectLocation, "*.cshtml", SearchOption.AllDirectories).Length == 0)
                {
                    arguments.Append(" -r linux-x64 --self-contained false /p:PreserveCompilationContext=false");
                }

However, if one has a dependency on some native libraries using nuget packages and such a dependency package has a bunch of monikers and not only linux or linux-x64, but e.g. rhel-x64, the resulting output is unusable, since the publish result will contain a wrong library. An example of such a package would be LibGit2Sharp.NativeBinaries:

image

Temporary workaround:

~Add an empty .cshtml file and a dependency to Microsoft.AspNetCore.Razor so the if in the optimization above is ignored.~

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
normjcommented, Aug 23, 2018

Interesting. I’ll take a look to see how we can better handle this.

0reactions
normjcommented, Sep 5, 2018

Nothing wrong with the PR. I have the PR staged with the next release. I’m going to close this and use the https://github.com/aws/aws-extensions-for-dotnet-cli/pull/29 to track it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Publish optimization uses a hardcoded runtime linux-x64 ...
Description. I fixed this issue 2 years ago(#26), and now it seems like it's back. Starting with #112 the linux-x64 moniker is used...
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 >
In angular 8, when uplaod the build error occurs due to ...
I am used ng build --prod --aot --build-optimizer command to build the app. angular · Share.
Read more >
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 >
bash - error while loading shared libraries
I am using Ubuntu 10.10.) g++ -o ex_addinst ./ex_addinst.o -L/home/li/work/tools/lindo/lindoapi/bin/linux64 ...
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