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

Use assembly name for DotnetAssembly{Compile,Runtime}Info #435

Merged

Conversation

sin-ack
Copy link
Contributor

@sin-ack sin-ack commented Apr 24, 2024

Previously, we used the name of the target directly, which caused problems in the following configuration:

csharp_binary(
    name = "bar",
    out = "foo",
    // ...
)

publish_binary(
    name = "Bar",
    binary = ":bar",
)

publish_binary uses the name specified in DotnetAssemblyRuntimeInfo to generate the {assembly}.deps.json and {assembly}.runtimeinfo.json files, which are required for the .NET application to run. Since this was set to the target name, the generated filenames in the case above would be bar.deps.json and bar.runtimeinfo.json, causing the following error when trying to run the publish target:

A fatal error was encountered. The library 'libhostpolicy.so' required to execute the application was not found in '/dotnet/sdk/path'.

The default case is unaffected, since assembly_name defaults to the name attribute if out is not given.

Previously, we used the name of the target directly, which caused
problems in the following configuration:

    csharp_binary(
        name = "bar",
        out = "foo",
        // ...
    )

    publish_binary(
        name = "Bar",
        binary = ":bar",
    )

publish_binary uses the name specified in DotnetAssemblyRuntimeInfo to
generate the `{assembly}.deps.json` and `{assembly}.runtimeinfo.json` files,
which are required for the .NET application to run. Since this
was set to the target name, the generated filenames in the case above
would be `bar.deps.json` and `bar.runtimeinfo.json`, causing the
following error when trying to run the publish target:

    A fatal error was encountered. The library 'libhostpolicy.so'
    required to execute the application was not found in
    '/dotnet/sdk/path'.

The default case is unaffected, since assembly_name defaults to the
`name` attribute if `out` is not given.
@sin-ack sin-ack requested a review from purkhusid as a code owner April 24, 2024 07:53
Copy link

google-cla bot commented Apr 24, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Collaborator

@purkhusid purkhusid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for you contribution!

@purkhusid purkhusid merged commit b8a36bf into bazel-contrib:master Apr 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants