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

Undeclared dependency in cc on prelude #595

Open
jberdine opened this issue Dec 12, 2024 · 4 comments
Open

Undeclared dependency in cc on prelude #595

jberdine opened this issue Dec 12, 2024 · 4 comments
Assignees
Labels
bug Something isn't working skiplang

Comments

@jberdine
Copy link
Contributor

I am seeing build failures that appear to be caused by the cc package implementation using the stdlib without declaring a dependency on it, and doing so creates a circular dependency.

  • skiplang/cc/src/utils.sk uses System
  • System is defined in skiplang/prelude/src/stdlib/other/System.sk
  • System needs the skargo dep line: std = { path = "../prelude" }
  • adding that to skiplang/cc/Skargo.toml creates a circular dependency
@jberdine jberdine added bug Something isn't working skiplang labels Dec 12, 2024
jberdine added a commit that referenced this issue Dec 13, 2024
These changes are not good, but allow the ts code to be typechecked and the
docs to be built until #595 is fixed.
@beauby
Copy link
Contributor

beauby commented Dec 13, 2024

System needs the skargo dep line: std = { path = "../prelude" }

This is not exact. The behavior of skc is to imply a dependency on std by default (which in practice will be resolved to the libstd.sklib from the tool chain, which breaks the dependency cycle), and declaring an explicit dependency on std should only be needed when using a different version of std (in practice, declaring an explicit dependency on std will allow using a modified std without rebuilding the whole tool chain).

Do you have a reproducible example/CI trace where the build fails?

@jberdine
Copy link
Contributor Author

Ok thanks for the clarification. Maybe I mis-identified.

The failure is reproducible for me:

  • git clean -Xdf
  • checkout 05f2646 and build docker images using the bin/build_docker_images.sh script
  • checkout 8745e47
  • make -C skipruntime-ts build

This fails with the message:

> @skipruntime/[email protected] build
> tsc && skargo build -r --target wasm32-unknown-unknown --lib --manifest-path=../native/Skargo.toml --out-dir=./dist/src/

    Compiling: cc v0.1.0 [lib] (/Users/josh/skip/skiplang/cc)
error: command exited with non-zero status

Caused by:
  process did not exit successfully: `skc` (exit status: 2)
  --- stdout

  --- stderr
  File "/Users/josh/skip/skiplang/cc/src/utils.sk", line 63, characters 6-11:
  Unbound module: System
  61 |     stdout: (String) -> void = _ -> void,
  62 |     stderr: (String) -> void = _ -> void,
  63 |   ): System.CompletedProcess {
     |      ^^^^^^
  64 |     System.popen{

@beauby beauby self-assigned this Dec 13, 2024
@beauby
Copy link
Contributor

beauby commented Dec 13, 2024

Thanks, looking into it!

@jberdine
Copy link
Contributor Author

Curiously (to me), the same steps do not fail if building from the commit used for the docker images. But nothing jumped out at me in that PR that would change things here. I figured that before we were just getting lucky with build ordering.

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

No branches or pull requests

2 participants