Giter VIP home page Giter VIP logo

Comments (12)

NOBLES5E avatar NOBLES5E commented on May 18, 2024 1

Just created a PR, please take a look @stepchowfun. Thanks!

from toast.

stepchowfun avatar stepchowfun commented on May 18, 2024

Hi @NOBLES5E, thanks for filing this feature request. I agree that it seems like a useful feature.

However, I personally have never needed this, since generally I use input_paths to copy the files from a project into the container with the same directory structure. So I'd be curious to learn more about your use case—perhaps you are using Toast in a different way than I do (which would be interesting to learn about!).

Also, I just wanted to confirm: do you know about the location field which allows you to change the base path for all files copied into the container? I rarely use this as well (since the default location is usually as good as any), but it can be useful if some program expects the files to be in a particular location for some reason (e.g., nginx likes to serve files from /usr/share/nginx/html/ by default).

I can't promise any particular timeline or guarantee about this feature being implemented. For now I will leave the issue open for discussion.

from toast.

NOBLES5E avatar NOBLES5E commented on May 18, 2024

Thanks! In my case I need to mount a different host directory to target/ directory in the container to do incremental build. Are there any better solutions?

from toast.

stepchowfun avatar stepchowfun commented on May 18, 2024

Oh my mistake—I seem to have misread and thought it was about input_paths rather than mount_paths.

Just checking: Did you know mount_paths can be relative? On the host they are relative to the directory containing the toastfile, and in the container they are relative to the location of the task. Does that address your use case, or do they need to be totally distinct paths?

from toast.

NOBLES5E avatar NOBLES5E commented on May 18, 2024

Yes, but I have multiple build tasks, and they use different directories like this:

task    host              container
task1   target-task1/     target/
task2   target-taks2/     target/
task3   target-task3/     target/

Currently I can create a symlink in the container manually like

task    host              container
task1   target-task1/     target/ -> target-task1/
task2   target-taks2/     target/ -> target-taks2/
task3   target-task3/     target/ -> target-taks3/

But it feels awkward 😢

from toast.

stepchowfun avatar stepchowfun commented on May 18, 2024

I see—thanks for explaining. If I may ask, why do the 3 target-taskN directories need to be distinct on the host? Or why do they need to map to the same directory in the container? I'd be curious learning about what build system/language/toolchain you're using that calls for this arrangement.

from toast.

NOBLES5E avatar NOBLES5E commented on May 18, 2024

Yes they need to be distinct. They are used to compile the program under different system environments (different rustc, and system libraries like libc). If we use only one directory, compiler will raise error when doing incremental compilation.

from toast.

NOBLES5E avatar NOBLES5E commented on May 18, 2024

@stepchowfun Do you think we should add this feature? I can help create a pull request implementing this if needed.

from toast.

stepchowfun avatar stepchowfun commented on May 18, 2024

The only thing I'm unsure about is: which of the following fields would support this feature?

  • input_paths
  • mount_paths
  • mount_readonly
  • output_paths
  • output_paths_on_failure

Functionality wise, I think it would make sense for all of them to support this feature for consistency. But I expect it will be much easier to implement this for the mount_ fields than the others, and then the output_ fields would be the next easiest to implement, and input_paths would probably be the most difficult.

I am grateful for your willingness to contribute (thank you!). To avoid any potential confusion down the road, maybe we can align on the plan first? Which of those would you plan to implement?

from toast.

NOBLES5E avatar NOBLES5E commented on May 18, 2024

I was thinking about mount_ fields since that is what I need now and seems easy to do. Not sure about how to implement other fields yet.

from toast.

stepchowfun avatar stepchowfun commented on May 18, 2024

Ok, that sounds reasonable to me.

from toast.

stepchowfun avatar stepchowfun commented on May 18, 2024

Fixed by #361 and #365.

from toast.

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.