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

Dependencies inconsistency #26

Open
straight-shoota opened this issue Jun 28, 2023 · 6 comments
Open

Dependencies inconsistency #26

straight-shoota opened this issue Jun 28, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@straight-shoota
Copy link
Member

The actions explicitly installs some dependencies such as libssl-dev on Linux, but not on macOS (on Windows, the libraries are already included in the Crystal package).
This causes some inconsistency because after installing with this action, a program linking against libssl compiles fine on Linux, but not on macOS.

Example for such a failure: https://github.com/crystal-lang/test-ecosystem/actions/runs/5400167770/jobs/9808241746 (the workflow succeeds on Linux and Windows, but not on macOS).

Should this action install some dependencies on macOs as well?

@straight-shoota straight-shoota added the bug Something isn't working label Jun 28, 2023
@oprypin
Copy link
Member

oprypin commented Jun 28, 2023

There is a test that require "openssl" passes on macos-latest.

https://github.com/crystal-lang/install-crystal/actions/runs/5397768652/jobs/9802797905#step:10:1

@straight-shoota
Copy link
Member Author

After further experimenting, it seems like pkg-config might be missing?
/Users/runner/work/_temp/aab7155d-6082-4491-80ef-a413a4c35af6.sh: line 3: pkg-config: command not found.

After installing it with brew install pkg-config the build works.

@oprypin
Copy link
Member

oprypin commented Jun 30, 2023

FWIW the two runs that we are comparing are macos versions 13.4 versus 12.6.6. It may very well be that this action is broken on "macos-13" and we should add something to install. Or alternatively the test for require "openssl" does not catch the problem.

@straight-shoota
Copy link
Member Author

straight-shoota commented Jun 30, 2023

I don't think 'require "openssl"' is sufficient to verify the library is available and builds succesfully. There is no top level code that calls into libssl, so there will never be any code generated that would link any functions in the library.

@oprypin
Copy link
Member

oprypin commented Jun 30, 2023

I would really welcome a contribution that addresses all of this.

Expand the example so it actually exercises the libraries in some way, and confirm that it fails

Add a background depsTask for mac similarly to this

Maybe this is simple enough that you don't even need to try it out locally, just push it to a branch and see if it runs as expected 😅

@straight-shoota straight-shoota self-assigned this Jun 30, 2023
@straight-shoota
Copy link
Member Author

straight-shoota commented Jul 2, 2023

So it seems the issue is specific to macos-13, the new version of the macos runner; macos-latest is still macos-12.
Dependencies are found on macos-12, but not macos-13. This now properly reproduces the error I have experienced:
https://github.com/crystal-lang/install-crystal/actions/runs/5436842140/jobs/9886971657

UPDATE:
Apparently pkg-config is missing from macos-13 on purpose until the image is stable: actions/runner-images#7632 Seems a bit weird to me 🤷

That should confirm that we only need to fix the test to properly fail when dependencies are missing / cannot be found.
But I suppose we probably should not need to install pkg-config explicitly because it would be expected to be available in stable runner image environments. On the other hand, it might not hurt to be explicit about it...?

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

No branches or pull requests

2 participants