Skip to content

Conversation

@jkloetzke
Copy link
Member

@jkloetzke jkloetzke commented May 20, 2025

Implements #645.

jkloetzke added 3 commits May 20, 2025 20:52
So far, dependencies named in the "depends" section are only available
during the build step. Sometimes recipes only need to gather results
from other packages. For this case, it is nice to have the dependencies
available in the package step too.

The "packageDepends" boolean attribute optionally enables access to all
dependencies in the package step.

Fixes BobBuildTool#645.
@codecov
Copy link

codecov bot commented May 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.95%. Comparing base (5c7e356) to head (e222b25).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #647   +/-   ##
=======================================
  Coverage   88.95%   88.95%           
=======================================
  Files          50       50           
  Lines       16051    16058    +7     
=======================================
+ Hits        14278    14285    +7     
  Misses       1773     1773           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jkloetzke
Copy link
Member Author

@icedieler @rhubert @sbixl Any thoughts on this?

Basically, you can now write:

depends:
    - ...

packageDepends: True
packageScript: |
    for i in "{@:2}" ; do
        ...
    done

I figured that my original idea with a fine-grained packageDep property in the depends section does not really fly. The problem are indirect dependencies that would then have to be handled in the fine grained fashion too. Also, I don't see a use case where only selected dependencies should be made available to the package step. But you guys may have a different idea...

@rhubert
Copy link
Contributor

rhubert commented May 20, 2025

I think having all dependencies in the package step set is sufficient. I assume $1 is still the build step? Can we also make the checkout Step available? Is BOB_DEP_PATHS set?

@jkloetzke
Copy link
Member Author

I assume $1 is still the build step?

Indeed, this is the case. Just like in the build step, the dependencies start at $2.

Can we also make the checkout Step available?

You can have that even today. Even in the sandbox, the checkout step is accessible for the package step. The reason is that we used make install in the package step in the past. So the following will work:

checkoutSCM:
    ...

buildScript: |
    ln -sf "$1" src

packageScript: |
    rsync "$1/src/" .

Is BOB_DEP_PATHS set?

Yes, just like for the build step.

@rhubert
Copy link
Contributor

rhubert commented May 20, 2025

I know this make-a-symlink-pointing-to-the-sources way. I just thought it might be easier to read / less to write if we could get rid of this and have a direct access to the checkoutStep.

checkoutSCM:
  ...

packageScript: |
  rsync $CHECKOUT_DIR/ .

@jkloetzke
Copy link
Member Author

Hmm, this is unfortunately not easily possible. The problem is that BOB_DEP_PATHS will be ambiguous then. The package name of the checkout step and the build step will obviously be identical. While we could argue that this is just a minor nuisance, I made the observation that such inconsistencies will bite us in the end. Therefore, I would not like to go this route.

@rhubert
Copy link
Contributor

rhubert commented May 20, 2025

Fine for me - was just an idea.

@sbixl
Copy link

sbixl commented May 21, 2025

The only use case I can think of right now is the one Ralf already mentioned. Fine for me too.

@jkloetzke
Copy link
Member Author

Thanks for the feedback. 👍

@jkloetzke jkloetzke merged commit 02605c9 into BobBuildTool:master May 21, 2025
11 checks passed
@jkloetzke jkloetzke deleted the package-dependencies branch May 21, 2025 18:37
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.

3 participants