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

How to make a package with components that embed components? #742

Open
jrray opened this issue Jun 2, 2023 · 3 comments · May be fixed by #744
Open

How to make a package with components that embed components? #742

jrray opened this issue Jun 2, 2023 · 3 comments · May be fixed by #744
Assignees

Comments

@jrray
Copy link
Collaborator

jrray commented Jun 2, 2023

I'm getting tripped up on trying to make a package that has components where those components are expected to embed specific components of some other package. In the case of boost and boost-python, here's a simplified concrete example of what I'm trying to do:

boost:build contains header.hpp
boost:run contains libwhatever.so.1.2.3, and the "build" component has uses: [run].

The boost-python package is a full build of boost with python stuff enabled at build time, so it's split up into components in a way that mirrors the boost package. But the boost-python "build" component should embed the boost "build" component, likewise the "run" component should embed the boost "run" component.

What I've tried looks like this (boost-python.spk.yaml):

install:
  components:
    - name: build
      files:
        - include/
        - lib/cmake/
        - lib/*.a
        - lib/*.so
      uses:
        - run
      embedded:
        - pkg: boost/1.76.0+r.3
          install:
            components:
              - name: build
                uses:
                  - run
    - name: run
      files:
        - "*"
      file_match_mode: Remaining
      embedded:
        - pkg: boost/1.76.0+r.3
          install:
            components:
              - name: run

I'm not sure about the embedded entries here and I don't believe this is accomplishing what I'm looking for. For example, I made this extra dummy package:

pkg: dummy/1.0.0

sources: []

build:
  script: []

install:
  requirements:
    - pkg: boost:build/1.76.0+r.3

Note that it specifically depends on the "build" component of boost.

Then, I do this contrived thing: spk env -vv dummy boost-python:run. I ask for the dummy package and boost-python:run.

It solves and I get an environment like this:

Installed Packages:
  local/dummy:{build,run}/=1.0.0/3I42H3S6
  local/boost-python:run/=1.76.0+r.3/Q4VLNGUE
  boost/=1.76.0+r.3/embedded

What's wrong here is that boost:build is not satisfied. This environment doesn't actually have any of the boost[-python] build component's files in it. This environment needs to include boost-python:build to actually satisfy dummy's requirements. The presence of boost/=1.76.0+r.3/embedded appears to satisfy the solver but the environment is missing required files.

@rydrman
Copy link
Collaborator

rydrman commented Jun 2, 2023

Maybe get this into a solver test? I would put my money on this just not being supported - I don't think that I fully explored the connection between components and embedded packages when that feature went in

@jrray
Copy link
Collaborator Author

jrray commented Jun 2, 2023

Okay, I'll dive into it some more.

@jrray jrray self-assigned this Jun 2, 2023
@jrray
Copy link
Collaborator Author

jrray commented Jun 2, 2023

Test added in #744, I'll continue the conversation over there.

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 a pull request may close this issue.

2 participants