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

Symlinks don't install correctly when Composer falls back on the PHP zip library #28

Open
kwessel opened this issue Dec 6, 2024 · 5 comments

Comments

@kwessel
Copy link
Contributor

kwessel commented Dec 6, 2024

I couldn't figure out why the Discopower module wasn't installing correctly inside my Docker image of SSP. The symlinks under modules/discopower/public/assets/components were being installed as text files containing the path where they would have pointed had they been symlinks. This obviously didn't work so great when my browser tried to load the Jquery Javascript for Discopower.

After further investigation, I tried installing unzip into my Docker image before running composer, and that fixed it. I now have symlinks instead of text files. Clearly, the PHP zip library doesn't understand symlinks.

If possible, installation of this module should require that the unzip or 7z binary be installed on the system and not just the PHP zip library.

If that's not possible, the documentation should at least include this requirement for proper installation.

Ideally, these symlinks wouldn't be necessary, and the disco.twig code that loads these components would point to the files directly instead of the symlinks inside of the module.

@tvdijen
Copy link
Member

tvdijen commented Dec 7, 2024

Thanks for figuring this out!
I see this is already documented by Composer: https://github.com/composer/composer/blob/main/doc/articles/troubleshooting.md?plain=1#L414-L418

Unfortunately there is no way to enforce the installation of system packages..
I can see one way out here and that is to create a special repository for jquery assets. Our module installer will automatically deploy the assets in the public/ directory of the SimpleSAMLphp base install. This repo can then be re-used by the 1 or 2 other modules that require jQuery.

@thijskh
Copy link
Member

thijskh commented Dec 7, 2024

That is annoying that such a simple limitation causes all this extra work. But indeed there's probably no way around it.

@tvdijen
Copy link
Member

tvdijen commented Dec 8, 2024

@kwessel You think you can run a test with dev-master to see if this solves the issue?
If everything checks out, I'll tag a new release.

@thijskh
Copy link
Member

thijskh commented Dec 8, 2024

Tested it and it works well for me.

@tvdijen
Copy link
Member

tvdijen commented Dec 8, 2024

Great! This means we now have an easy to reuse repo to add jQuery to any module. I have identifier 4 other modules: metaedit, metarefresh, statistics and oidc.

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

No branches or pull requests

3 participants