Skip to content

Conversation

@crazywhalecc
Copy link
Owner

What does this PR do?

Fix #881

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php or *.json, run them locally to ensure your changes are valid:
    • composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:sort-config
  • If it's an extension or dependency update, please ensure the following:
    • Add your test combination to src/globals/test-extensions.php.
    • If adding new or fixing bugs, add commit message containing extension test or test extensions to trigger full test suite.

@henderkes
Copy link
Collaborator

Why does it not work with a mount? Why mount the directory at all then?

@crazywhalecc
Copy link
Owner Author

crazywhalecc commented Sep 4, 2025

Why does it not work with a mount?

If someone running bin/spc-alpine-docker install-pkg XXX, it will install to /path/to/spc/pkgroot/ (for docker inside, it's /app/pkgroot/). This because of the mount -v $(pwd)/pkgroot:/app/pkgroot.

But the image build procedure RUN bin/spc install-pkg or RUN bin/spc doctor don't have mount point and it will install in /app/pkgroot only. After mounting from host, it will disappear.

This PR will fix the required packages to be installed inside image to avoid mounting overwrite. Although we can solve it by not mounting pkgroot, I think this is inconsistent with the buildroot and other directories.

Why mount the directory at all then?

pkgroot is not part of docker, it is the same as buildroot and should be visible and modifiable in the host. pkg-config and upx are exceptions.

@henderkes
Copy link
Collaborator

I understand the problem now, but I think the right way to combat it is to have the mount available for bin/spc doctor. The current solution is very confusing.

@crazywhalecc
Copy link
Owner Author

Indeed. I just noticed that the go-xcaddy will also have this issue. Mounting when building seems to be appropriate.

@crazywhalecc
Copy link
Owner Author

Seems docker build command does not accept mounting volume yet. How about installing to pkgroot-private during docker build and copying to pkgroot when docker run?

@crazywhalecc
Copy link
Owner Author

I think splitting different OS and arch for pkgroot dir is necessary when using docker on different arch and OS.

@henderkes
Copy link
Collaborator

That's a good idea because it would also mean that packages themselves would no longer need arch and os in their folder.

@crazywhalecc
Copy link
Owner Author

Looks good to me now.

@crazywhalecc crazywhalecc merged commit d82c86c into main Sep 5, 2025
10 checks passed
@crazywhalecc crazywhalecc deleted the feat/cgi branch September 5, 2025 09:13
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

Successfully merging this pull request may close these issues.

actions to linux-x86_64-glibc

2 participants