You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to pack build an application that contains a global.json file that looks like this:
{
"sdk": {
"version": "2.1.0"
}
}
In the dotnet-core-sdk buildpack, the global.json file is a part of the plan entry resolver priority list, so we should be looking at this file as a version source.
What did you expect to happen?
Expected the app to build properly, and to see "2.1.0" with the version source global.json in the SDK buildpack logs.
What was the actual behavior? Please provide log output, if possible.
Logs from SDK that do not include global.json
Paketo .NET Core SDK Buildpack 0.1.4
Resolving .NET Core SDK version
Candidate version sources (in priority order):
RUNTIME_VERSION -> "2.1.812"
simple_brats.csproj -> "2.1.*"
<unknown> -> "*"
The pack build failed during publish:
Paketo .NET Publish Buildpack 0.1.3
Executing build process
Running 'dotnet publish /workspace --configuration Release --runtime ubuntu.18.04-x64 --self-contained false --output /tmp/dotnet-publish-output047634497'
failed to execute 'dotnet publish': exit status 145
Failed after 2.741886ms
A compatible SDK version for global.json version: [2.1.0] from [/workspace/global.json] was not found
Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
ERROR: failed to build: exit status 1
The global.json file allows you to define which .NET SDK version is used when you run .NET CLI commands. Selecting the .NET SDK is independent from specifying the runtime your project targets. The .NET SDK version indicates which versions of the .NET CLI is used.
Given the intended purpose of the global.json file, I think it should be considered as an SDK version source. In fact, I think the version source should probably overrule the version determined by RUNTIME_VERSION. A global.json file is the canonical manner of indicating what version of the .NET CLI to use for an app, and I think it should be respected even if it results in a "no available compatible version" error. This way, a developer will be alerted to a difference between their local build environment and the environment of the buildpack build.
What happened?
Trying to pack build an application that contains a
global.json
file that looks like this:In the dotnet-core-sdk buildpack, the
global.json
file is a part of the plan entry resolver priority list, so we should be looking at this file as a version source.Expected the app to build properly, and to see "2.1.0" with the version source
global.json
in the SDK buildpack logs.Logs from SDK that do not include global.json
The
pack build
failed during publish:Build Configuration
Trying to build this app: https://github.com/cloudfoundry/dotnet-core-buildpack/tree/v2.3.22/fixtures/source_2.1_global_json_templated
With the
global.json
changed to have version2.1.0
inside instead of templating.pack
,kpack
,tekton
buildpacks plugin, etc.) are youusing? Please include a version.
pack v0.15.1+git-79adc30.build-1660
What buildpacks are you using? Please include versions.
What builder are you using? If custom, can you provide the output from
pack inspect-builder <builder>
?Can you provide a sample app or relevant configuration (
buildpack.yml
,nginx.conf
, etc.)?Checklist
The text was updated successfully, but these errors were encountered: