Git Product home page Git Product logo

Comments (6)

peterebden avatar peterebden commented on May 20, 2024

If I understand correctly, I think you could handle this by selecting tool-C differently based on the architecture:

if CONFIG.OS == 'darwin':
    filegroup(
        name = "tool-C",
        srcs = ["tool-C-bin"],
    )
else:
    go_binary(  # or whatever
        name = "tool-C",
        ....
    )

from please.

matglas avatar matglas commented on May 20, 2024

This does mean that tool-C-bin has to be put inside the tool-C folder as a file output. And it can not be consumed by transferring the plz-out/gen/tool-C folder to Phase B. Correct?

from please.

matglas avatar matglas commented on May 20, 2024

If it would be possible to use the cached results on the MacOS machine in Phase B that would be even better in our setup. But when I try to run tool-D on MacOS with the build using tool-C dependencies it would have different hash key because of different build config like the OS variable. So it become unusable.

I would rather keep it as one chain. Because actually we have Phase C too where results are combined again with dependencies from Phase A and B.

from please.

Tatskaari avatar Tatskaari commented on May 20, 2024

I'm a little confused so forgive me if I've misunderstood. If you need to build a tool on linux and then use it on a macos box, then if you're using something like github actions you could do the following:

Set up a config option for the tool. This can be done in your .plzconfig like so:

    [buildconfig]
    my-tool = //tools:linux_tool

and then use this in your build rules like so:

genrule(
    ...,
    tools = [CONFIG.MY_TOOL],
)

Then you can:

  1. build the tool on linux
  2. save this as an artefact to your ci build e.g. to /tmp/workspace/my-tool
  3. set a .plzconfig.macos_ci (or use -o buildenv.mytool:/tmp/workspace/my-tool) that configures the tool path
  4. do your macos build

.plzconfig.macos_ci might look like:

    [buildconfig]
    my-tool = /tmp/workspace/my-tool

from please.

matglas avatar matglas commented on May 20, 2024

That is a great way indeed. I had not thought of that. Currently I use rules that uses the link label to output it to the folder of the package. Something like this will be found in tool-A and tool-B on the build rule.

labels = ["link:" + package_name() ]

Then I use an additional rule in tool-A and tool-B that uses that output path as a source.
And tool-C can use those rules as its source on the other machine.

But one thing that I was not able to do is to use the data that is already in cache. I need to copy it over in the workspace either way.

from please.

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.