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

Package can't import a component from a different package that shares a dependency #3448

Closed
daniel-palmer-gu opened this issue Jan 29, 2025 · 0 comments · Fixed by #3449
Closed

Comments

@daniel-palmer-gu
Copy link
Contributor

Environment

Zarf version: v0.47.0

Steps to reproduce

  1. setup the following files/folder structsure:
├── child-component
│   └── zarf.yaml
├── jq
│   └── zarf.yaml
└── zarf.yaml

zarf.yaml:

---
kind: ZarfPackageConfig
metadata:
  name: example-package

components:
  # JQ
  - name: jq-amd64
    required: true
    import:
      path: jq

  - name: jq-darwin
    required: true
    import:
      path: jq

  - name: child-jq-command
    required: true
    import:
      path: child-component

  - name: jq-command    
    actions:
      onDeploy:
        defaults:
          mute: true
        before:
          - cmd: |
              echo "I'm doing something cool with JQ too!"
              echo "{}" | ./bin/jq

./jq/zarf.yaml:

---
kind: ZarfPackageConfig
metadata:
  name: jq
  description: Deploys the jq bin to the ./bin directory for use with other packages.

components:
  - name: jq-amd64
    only:
      localOS: linux
    required: true
    description: Deploy ./bin/jq bin for use in other components
    files:
      - source: https://github.com/stedolan/jq/releases/latest/download/jq-linux64
        target: ./bin/jq
        executable: true
  - name: jq-darwin
    only:
      localOS: darwin
    required: true
    description: Deploy ./bin/jq bin for use in other components
    files:
      - source: https://github.com/stedolan/jq/releases/latest/download/jq-osx-amd64
        target: ./bin/jq
        executable: true

./child-component/zarf.yaml

---
kind: ZarfPackageConfig
metadata:
  name: child-component

components:
  # JQ
  - name: jq-amd64
    required: true
    import:
      path: ../jq

  - name: jq-darwin
    required: true
    import:
      path: ../jq

  - name: child-jq-command
    actions:
      onDeploy:
        defaults:
          mute: true
        before:
          - cmd: |
              echo "I'm doing something cool with JQ"
              echo "{}" | ./bin/jq
  1. run zarf package create

Expected result

Package successfully creates as the package does not import the any component twice.

Actual Result

Package fails to create with the following error:

ERR failed to create package: package jq imported in cycle by child-component in component jq-amd64

Visual Proof (screenshots, videos, text, etc)

Severity/Priority

High

I can't build packages anymore

Additional Context

Add any other context or screenshots about the technical debt here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant