Skip to content
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

Local build for v6.0.14 on Oracle Linux 9 is failing on Yarn #46821

Closed
leocb opened this issue Feb 22, 2023 · 21 comments
Closed

Local build for v6.0.14 on Oracle Linux 9 is failing on Yarn #46821

leocb opened this issue Feb 22, 2023 · 21 comments
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved

Comments

@leocb
Copy link

leocb commented Feb 22, 2023

First of all, I need to compile my own linux runtimes because of my company policy on third party software and distribution. I already tested our project with the pre-compiled docker runtime and it works flawlessly, we just can't use that for our production environment, hence my headache.

My build is failing while trying to build from source under linux (WSL Ubuntu 22)
here's the steps I took:

then

$ git clone --recursive https://github.com/dotnet/aspnetcore.git
$ git checkout v6.0.14
$ git clean -dfx
$ git submodule update --init --recursive -f
$ ./restore.sh
$ . ./activate.sh # I also tried without this step, same result
$ ./eng/build.sh -c release --arch x64 --os-name linux --build-managed --no-test

The output:

warning: Building of C# project is enabled and has dependencies on NodeJS projects. Building of NodeJS projects is enabled since node is detected on PATH.
[...]
Restore was successful
[...]
Build FAILED.

YARN : error : Cannot find module '/root/.nuget/packages/yarn.msbuild/1.22.10/dist/bin/yarn.js' [/home/lbottaro/git/dotnet.aspnetcore/src/JSInterop/Microsoft.JSInterop.JS/src/Microsoft.JSInterop.JS.npmproj]
/home/lbottaro/git/dotnet.aspnetcore/eng/targets/Npm.Common.targets(79,5): error : Command failed with exit code 1. [/home/lbottaro/git/dotnet.aspnetcore/src/JSInterop/Microsoft.JSInterop.JS/src/Microsoft.JSInterop.JS.npmproj]
/home/lbottaro/git/dotnet.aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(68,5): error : in asset size limit: The following asset(s) exceed the recommended size limit (120 KiB).
/home/lbottaro/git/dotnet.aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(68,5): error : in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
/home/lbottaro/git/dotnet.aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(68,5): error : in webpack performance recommendations:
/home/lbottaro/git/dotnet.aspnetcore/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj(67,5): error : in asset size limit: The following asset(s) exceed the recommended size limit (120 KiB).
/home/lbottaro/git/dotnet.aspnetcore/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj(67,5): error : in webpack performance recommendations:
    0 Warning(s)
    7 Error(s)

Time Elapsed 00:20:29.18
Build failed with exit code 1. Check errors above.

Version info:

$ node --version
v12.22.9
$ java --version
openjdk 11.0.17 2022-10-18
OpenJDK Runtime Environment (build 11.0.17+8-post-Ubuntu-1ubuntu222.04)
OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode, sharing)
$ yarn --version
1.22.19

I also tried manually running $ sudo yarn add global msbuild (and the npm variant), same result.

Any help or insights on what I might be missing? thanks!

@mkArtakMSFT mkArtakMSFT added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Feb 23, 2023
@mkArtakMSFT
Copy link
Member

Thanks for contacting us. This is not something we've seen in the past, so most probably it's something specific to your environemnt.
Try to pass the following parameters to your build.sh script, if you don't need to use Node.js:

--no-build-nodejs

@mkArtakMSFT mkArtakMSFT added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Feb 28, 2023
@ghost
Copy link

ghost commented Feb 28, 2023

Hi @leocb. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@leocb
Copy link
Author

leocb commented Mar 2, 2023

Hi, I tried with that argument, I get another error telling me I'm missing some dependencies and that it couldn't find a previous version of the files to use instead. Then the build fails anyways.
I can't get that log as I've switched computers, but yeah, doesn't work either.

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Mar 2, 2023
@leocb
Copy link
Author

leocb commented Mar 2, 2023

I just need the "core" functionality, I'm not using Blazor or SignalR, which afaik are the ones that need java and yarn. If there's a way to build without them, please let me know

@wtgodbe
Copy link
Member

wtgodbe commented Mar 7, 2023

What features do you need? In general, each feature area has a build.sh script you can run to build just those components, e.g. https://github.com/dotnet/aspnetcore/blob/main/src/Http/build.sh

As for your new error, we'd need to see the actual error message to be able to help diagnose the issue.

CC @captainsafia also in case you have any additional thoughts.

@wtgodbe wtgodbe added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Mar 7, 2023
@ghost
Copy link

ghost commented Mar 7, 2023

Hi @leocb. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost
Copy link

ghost commented Mar 13, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Mar 16, 2023
@leocb
Copy link
Author

leocb commented Mar 27, 2023

Hi, sorry for the long delay, I got snagged on higher priority tasks.
I did manage to build everything correctly on ubuntu, however that was just a test and I can't use ubuntu due to my company licensing and security policies.
I'm currently trying to build on Oracle Linux 9 (CentOS based, RHEL compatible).

I was getting the error Waiting for the other yarn instance to finish (5856). However, when forcing the process to run on a single core, I got a different error output, which I think is more descriptive, maybe (I guess multi-threaded build is broken on some environments?)

I'd like to add that I managed to build the full .net runtime on this environment without any issues.

These are the commands I'm using and the error output:

$ cd ~/git
$ git clone --recursive https://github.com/dotnet/aspnetcore.git
$ cd ~/aspnetcore
$ git checkout v6.0.14
$ git clean -xfd
$ git submodule update --init --recursive -f
$ export OPENSSL_ENABLE_SHA1_SIGNATURES=1 #without this command I get some OpenSSL errors regarding SHA1
$ ./eng/build.sh -c release --arch x64 --os-name linux --build-managed --restore --no-test

[...]

Build FAILED.

Error : error : 0308010C:digital envelope routines::unsupported [/home/lbottaro/git/aspnetcore/src/SignalR/clients/ts/signalr/signalr.npmproj]
/home/lbottaro/git/aspnetcore/eng/targets/Npm.Common.targets(79,5): error : Command failed with exit code 1. [/home/lbottaro/git/aspnetcore/src/SignalR/clients/ts/signalr/signalr.npmproj]
/home/lbottaro/git/aspnetcore/eng/targets/Npm.Common.targets(79,5): error : Command failed with exit code 1. [/home/lbottaro/git/aspnetcore/src/SignalR/clients/ts/signalr/signalr.npmproj]
Error : error : 0308010C:digital envelope routines::unsupported [/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj]
/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(68,5): error : Command failed with exit code 1.
    0 Warning(s)
    5 Error(s)

Build failed with exit code 1. Check errors above.

these are the versions in my system

$ java --version
openjdk 17.0.6 2023-01-17 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.6.0.10-3.0.1.el9_1) (build 17.0.6+10-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.6.0.10-3.0.1.el9_1) (build 17.0.6+10-LTS, mixed mode, sharing)
$ node
v18.12.1
$ yarn -v
1.22.19

If I try to build with the flag --no-build-nodejs I get this warning at the beginning then the build fails:

warning: Some managed projects depend on NodeJS projects. Building NodeJS is disabled so the managed projects will fallback to using the output from previous builds. The output may not be correct or up to date.

 [...]

Build FAILED.

/home/lbottaro/git/aspnetcore/src/Components/Directory.Build.targets(30,5): error : '/home/lbottaro/git/aspnetcore/src/Components/Web.JS/dist/Release/blazor.webassembly.js' does not exist. Enable NodeJS to build this project. [/home/lbottaro/git/aspnetcore/src/Components/benchmarkapps/Wasm.Performance/TestApp/Wasm.Performance.TestApp.csproj]
/home/lbottaro/git/aspnetcore/src/Components/Directory.Build.targets(30,5): error : '/home/lbottaro/git/aspnetcore/src/Components/Web.JS/dist/Release/blazor.webassembly.js' does not exist. Enable NodeJS to build this project. [/home/lbottaro/git/aspnetcore/src/Components/test/testassets/BasicTestApp/BasicTestApp.csproj]
/home/lbottaro/git/aspnetcore/src/Components/Directory.Build.targets(30,5): error : '/home/lbottaro/git/aspnetcore/src/Components/Web.JS/dist/Release/blazor.webassembly.js' does not exist. Enable NodeJS to build this project. [/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/testassets/Wasm.Authentication.Client/Wasm.Authentication.Client.csproj]
/home/lbottaro/git/aspnetcore/src/Components/Directory.Build.targets(30,5): error : '/home/lbottaro/git/aspnetcore/src/Components/Web.JS/dist/Release/blazor.webassembly.js' does not exist. Enable NodeJS to build this project. [/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/testassets/HostedInAspNet.Client/HostedInAspNet.Client.csproj]
/home/lbottaro/git/aspnetcore/src/Components/Directory.Build.targets(30,5): error : '/home/lbottaro/git/aspnetcore/src/Components/Web.JS/dist/Release/blazor.webassembly.js' does not exist. Enable NodeJS to build this project. [/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/testassets/CustomBasePathApp/CustomBasePathApp.csproj]
/home/lbottaro/git/aspnetcore/src/Components/Directory.Build.targets(30,5): error : '/home/lbottaro/git/aspnetcore/src/Components/Web.JS/dist/Release/blazor.webassembly.js' does not exist. Enable NodeJS to build this project. [/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/testassets/Wasm.Prerendered.Client/Wasm.Prerendered.Client.csproj]
/home/lbottaro/git/aspnetcore/src/Components/Directory.Build.targets(30,5): error : '/home/lbottaro/git/aspnetcore/src/Components/Web.JS/dist/Release/blazor.webassembly.js' does not exist. Enable NodeJS to build this project. [/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/Samples/HostedBlazorWebassemblyApp/Client/HostedBlazorWebassemblyApp.Client.csproj]
/home/lbottaro/git/aspnetcore/src/Components/Directory.Build.targets(30,5): error : '/home/lbottaro/git/aspnetcore/src/Components/Web.JS/dist/Release/blazor.webassembly.js' does not exist. Enable NodeJS to build this project. [/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/testassets/WasmLinkerTest/WasmLinkerTest.csproj]
    0 Warning(s)
    8 Error(s)

Thanks for your help in advance!

@BrennanConroy
Copy link
Member

https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

@leocb
Copy link
Author

leocb commented Mar 27, 2023

Just downgrading to node 16 gives the exact same error.

Using export NODE_OPTIONS=--openssl-legacy-provider on node 18 or 16 gives a different set of errors:

Build FAILED.

YARN : error : You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer [/home/lbottaro/git/aspnetcore/src/SignalR/clients/ts/signalr-protocol-msgpack/signalr-protocol-msgpack.npmproj]
/home/lbottaro/git/aspnetcore/eng/targets/Npm.Common.targets(79,5): error : Command failed with exit code 1. [/home/lbottaro/git/aspnetcore/src/SignalR/clients/ts/signalr-protocol-msgpack/signalr-protocol-msgpack.npmproj]
/home/lbottaro/git/aspnetcore/eng/targets/Npm.Common.targets(79,5): error : Command failed with exit code 1. [/home/lbottaro/git/aspnetcore/src/SignalR/clients/ts/signalr-protocol-msgpack/signalr-protocol-msgpack.npmproj]
/home/lbottaro/.nuget/packages/playwrightsharp/0.192.0/build/netstandard2.0/PlaywrightSharp.targets(18,5): error MSB3073: The command "./playwright.sh install" exited with code 9. [/home/lbottaro/git/aspnetcore/src/Shared/BrowserTesting/src/Microsoft.AspNetCore.BrowserTesting.csproj]
/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(68,5): error : in asset size limit: The following asset(s) exceed the recommended size limit (120 KiB).
/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(68,5): error : in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(68,5): error : in webpack performance recommendations: 
/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj(67,5): error : in asset size limit: The following asset(s) exceed the recommended size limit (120 KiB).
/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/Authentication.Msal/src/Microsoft.Authentication.WebAssembly.Msal.csproj(67,5): error : in webpack performance recommendations: 
    0 Warning(s)
    9 Error(s)

@leocb leocb changed the title Local build for v6.0.14 on Linux (WSL) is failing on Yarn Local build for v6.0.14 on Oracle Linux 9 is failing on Yarn Mar 29, 2023
@leocb
Copy link
Author

leocb commented Mar 30, 2023

@wtgodbe sorry to ping you like this, but could this issue be re-opened please?

@wtgodbe wtgodbe reopened this Mar 30, 2023
@wtgodbe
Copy link
Member

wtgodbe commented Mar 30, 2023

@BrennanConroy is this a known thing that we have another issue open for somewhere?

@BrennanConroy
Copy link
Member

/home/lbottaro/git/aspnetcore/src/Components/WebAssembly/WebAssembly.Authentication/src/Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj(68,5): error : in asset size limit: The following asset(s) exceed the recommended size limit (120 KiB).

This is something Blazor checks, there is a similar issue at #47324

@leocb
Copy link
Author

leocb commented Mar 30, 2023

I've seen this asset size error/warning in the ubuntu test build, but it still completed the build successfully. In this case it's not completing, what I'm worried about are the errors in the first 3 lines

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Mar 30, 2023
@wtgodbe
Copy link
Member

wtgodbe commented Mar 30, 2023

YARN : error : You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer.initialize({ 'lib/mappings.wasm': ... }) before using SourceMapConsumer [/home/lbottaro/git/aspnetcore/src/SignalR/clients/ts/signalr-protocol-msgpack/signalr-protocol-msgpack.npmproj]

This could speak to a change needed in SignalR, @BrennanConroy do you know?

@BrennanConroy
Copy link
Member

The internet claims node 18 broke source mapping nodejs/node#42638
Potential fixes involve using --no-experimental-fetch and updating source-map (which we don't reference but maybe if you add it, it'll work?)

@leocb
Copy link
Author

leocb commented Mar 31, 2023

I managed to build, but using a workaround, I'll test if everything is in working order in the following weeks.

I basically built it in two steps: first with the "legacy flag" on node, this fails in the native code part, but it compiles the js files correctly, then I remove this flag and build again with the "--no-build-nodejs" flag.

From my investigations, it really seems to be all linked to OpenSSL Oracle Linux 9 is using, maybe they compiled it with more strict safety policies. When I tried build my own OpenSSL and replaced it, I bricked the whole OS, so who knows what special sauce is there.

Here's what I did in the end:

Step 1: Build with these flags

# Enables SHA1 on the OpenSSL library, building without this flag fails
export OPENSSL_ENABLE_SHA1_SIGNATURES=1
# same as above, but for MD4 hashes:
export NODE_OPTIONS=--openssl-legacy-provider
# multi-core building breaks on yarn, so use only single core:
numactl --physcpubind=+1 ./eng/build.sh -c release --arch x64 --os-name linux --build-managed --restore --no-test

⚠️At this point the build WILL FAIL, this is expected because it seems some native code doesn't support building with the node "legacy provider" flag.

Step 2: Run the build again with these commands:

# Remove node flags
export NODE_OPTIONS=
# Build without touching nodejs files
numactl --physcpubind=+1 ./eng/build.sh -c release --arch x64 --os-name linux --build-managed --restore --no-test --no-build-nodejs

✅The build should succeed.

I tried this because I noticed this in the middle of the build log (which was not flagged with the other errors) when building with NODE_OPTIONS=--openssl-legacy-provider:

# This was NOT shown in the bottom in the errors list.
/home/lbottaro/git/aspnetcore/artifacts/bin/Microsoft.AspNetCore.BrowserTesting/release/net6.0/.playwright/unix/native/node: --openssl-legacy-provider is not allowed in NODE_OPTIONS 
# Followed by this, which was shown at the bottom with other errors 
/home/lbottaro/.nuget/packages/playwrightsharp/0.192.0/build/netstandard2.0/PlaywrightSharp.targets(18,5): error MSB3073: The command "./playwright.sh install" exited with code 9.

@mkArtakMSFT mkArtakMSFT added Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Apr 4, 2023
@ghost
Copy link

ghost commented Apr 4, 2023

Hi @leocb. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@ghost
Copy link

ghost commented Apr 10, 2023

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

See our Issue Management Policies for more information.

@captainsafia captainsafia removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. Status: No Recent Activity labels Apr 13, 2023
@captainsafia
Copy link
Member

@leocb It looks like you've been able to resolve this issue. I'm going to mark this as resolved for now with the hope that the information you provided here is helpful to folks building on the same target.

At the moment, it looks like there isn't anything directly related to the ASP.NET Core build here...

@captainsafia captainsafia added the ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. label Apr 13, 2023
@ghost ghost added the Status: Resolved label Apr 13, 2023
@ghost
Copy link

ghost commented Apr 14, 2023

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

@ghost ghost closed this as completed Apr 14, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 14, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. Status: Resolved
Projects
None yet
Development

No branches or pull requests

6 participants
@captainsafia @BrennanConroy @leocb @wtgodbe @mkArtakMSFT and others