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

presence of dynamic packages leads to linking error during leeway exec #100

Open
geropl opened this issue Sep 26, 2022 · 3 comments
Open
Labels
bug Something isn't working

Comments

@geropl
Copy link
Member

geropl commented Sep 26, 2022

Bug description

leeway exec cannot find the dynamic package install/preview:docker (when it is building the dependency tree?) and fails with:

gitpod /workspace/gitpod/components/server (gpl/12758-list-plans) $ yarn watch
yarn run v1.22.19
$ leeway exec --package .:app --transitive-dependencies --filter-type yarn --components --parallel -- yarn build -w --preserveWatchOutput
FATA[0000] cannot load workspace                         error="linking error in package components:all: package \"install/preview:docker\" is unknown"
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to reproduce

Expected behavior

It should execute yarn builds instead

Example repository

No response

Anything else?

No response

@csweichel
Copy link
Collaborator

This is actually caused by the "dynamic existence" of installer/preview:docker. It only exists when the right arguments are passed at linking stage.

Options:

Make components:all dynamic.

Doesn't require a leeway change, but significantly increases the complexity of our build set up because we have to duplicate conditions.

Add optional dependencies which are ignored if they're not present

For example (notice the ?) at the end:

deps:
  - installer/preview:docker?

@mads-hartmann
Copy link
Contributor

mads-hartmann commented Sep 29, 2022

This is actually caused by the "dynamic existence" of installer/preview:docker. It only exists when the right arguments are passed at linking stage

In the dynamic component (here) I had ensured that I created a package with the same name in either case as an attempt to avoid this situation. So I thought that there might be a bug in Leeway where dynamic components weren't evaluated in all conditions. I tried to make a minimal example here but I haven't been able to reproduce the bug yet.

@csweichel
Copy link
Collaborator

This is actually caused by the "dynamic existence" of installer/preview:docker. It only exists when the right arguments are passed at linking stage

In the dynamic component (here) I had ensured that I created a package with the same name in either case as an attempt to avoid this situation.

That's smart!
Actually in that case I'd prefer not to merge #103, just to not add this complexity needlessly.

So I thought that there might be a bug in Leeway where dynamic components weren't evaluated in all conditions. I tried to make a minimal example here but I haven't been able to reproduce the bug yet.

I just tried to reproduce using the steps described by Gero. I have not been able to reproduce this either.

Random thought: this might be some odd dependency on the order of a map. Just thinking that because that's the only thing introducing non-determinism in the linking process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants