Giter Club home page Giter Club logo

Comments (8)

kormide avatar kormide commented on June 18, 2024 1

@purkhusid I cut a release with the fix: https://github.com/aspect-build/bazel-lib/releases/tag/v1.11.0. Closing for now, but you can reopen if the problem persists.

from bazel-lib.

kormide avatar kormide commented on June 18, 2024

This sounds familiar and may have been fixed in 80603fb. Do you want to try updating to the latest release, 1.10.1?

https://github.com/aspect-build/bazel-lib/releases/tag/v1.10.1

from bazel-lib.

purkhusid avatar purkhusid commented on June 18, 2024

@kormide I'm using the latest release. It seems like the fix fixes copy_to_bin but breaks copy_file_action in my case.
The change also doesn't make sense to me because by removing the label from the bat file name I would think that it would be more likely that the actions that create the bat output would collide.

from bazel-lib.

kormide avatar kormide commented on June 18, 2024

The change was made to support this case on Windows.

copy_to_bin(
    name = "a",
    srcs = [
        "file"
    ]
)

copy_to_bin(
    name = "b",
    srcs = [
        "file"
    ]
)

If the labels are different then two different scripts were created which declare the the same file as an output, so bazel complains about conflicting actions. After the fix, the targets create an identical script that outputs the copied file, which bazel is okay with.

Can you paste the error you're seeing or push a branch so that I can investigate further?

from bazel-lib.

purkhusid avatar purkhusid commented on June 18, 2024

Ah, the issue I have is that Bazel complains that there are 2 different targets that output the same script file. So it's not the outputs of the copy action that conflict but the script files. I'll paste the error when I'm back at the computer.

from bazel-lib.

kormide avatar kormide commented on June 18, 2024

https://github.com/purkhusid/rules_dotnet/blob/695ffff8b2dd4f4aae30372f0f3e094be52721dc/examples/publish_binary/BUILD#L21

In the example you linked to, are those two targets supposed to produce two different output files with the same content, or the same output file?

If it's the former, maybe what I need to do here is name the script after a hash of the source and the destination file, rather than just the source.

from bazel-lib.

kormide avatar kormide commented on June 18, 2024

I got a PR up that hopefully fixes your case: #221

from bazel-lib.

purkhusid avatar purkhusid commented on June 18, 2024

https://github.com/purkhusid/rules_dotnet/blob/695ffff8b2dd4f4aae30372f0f3e094be52721dc/examples/publish_binary/BUILD#L21

In the example you linked to, are those two targets supposed to produce two different output files with the same content, or the same output file?

If it's the former, maybe what I need to do here is name the script after a hash of the source and the destination file, rather than just the source.

Yes, that is the case. The error is:

ERROR: file 'publish_binary/478990217-cmd.bat' is generated by these conflicting actions:
Label: //publish_binary:publish_self_contained, //publish_binary:publish_not_self_contained
RuleClass: publish_binary_wrapper rule
Configuration: 2d025b54d1e798337c54da69c5ab51e6e250f93e5d6a812a4f1f0030d6869a75
Mnemonic: FileWrite
Action key: 596af37dc0561a5711b4554c15126ceef0006a085d8edc0916527b0584c6261d, 56060fef44722e1300d9738701c7d20e85b09abd07340c2b7d9f42b478638ea2
Progress message: Writing script publish_binary/478990217-cmd.bat
PrimaryInput: (null)
PrimaryOutput: File:[[<execution_root>]bazel-out/x64_windows-fastbuild/bin]publish_binary/478990217-cmd.bat
Owner information: ConfiguredTargetKey{label=//publish_binary:publish_self_contained, config=BuildConfigurationValue.Key[2d025b54d1e798337c54da69c5ab51e6e250f93e5d6a812a4f1f0030d6869a75]}, ConfiguredTargetKey{label=//publish_binary:publish_not_self_contained, config=BuildConfigurationValue.Key[2d025b54d1e798337c54da69c5ab51e6e250f93e5d6a812a4f1f0030d6869a75]}       
MandatoryInputs: are equal
Outputs: are equal

I'll test the fix when I get the time but it looks like it should fix it.

from bazel-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.