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

Investigate if git submodules can be included #39

Open
asgrim opened this issue Sep 17, 2024 · 1 comment · May be fixed by #160
Open

Investigate if git submodules can be included #39

asgrim opened this issue Sep 17, 2024 · 1 comment · May be fixed by #160
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@asgrim
Copy link
Collaborator

asgrim commented Sep 17, 2024

At the moment, PIE downloads the ZIP archive, which doesn't include git submodules. mongodb does use submodules for the C libs to be included.

The .gitmodules file is present, however, the revision information is kept in .git which isn't included in the Zip archive.

@asgrim asgrim added the enhancement New feature or request label Sep 17, 2024
@asgrim asgrim added bug Something isn't working and removed enhancement New feature or request labels Sep 30, 2024
@asgrim asgrim added the help wanted Extra attention is needed label Nov 21, 2024
@alexandre-daubois alexandre-daubois linked a pull request Dec 23, 2024 that will close this issue
@asgrim
Copy link
Collaborator Author

asgrim commented Dec 24, 2024

I think this may now be possible with the following changes:

  1. we flag some way of forcing this extension to always be from source (i.e. add the ->setPreferSource() call in \Php\Pie\ComposerIntegration\ComposerIntegrationHandler). This could either be a special case we write into PIE itself, or probably better, add a composer.json configuration that Mongo (and other extensions with git modules) can specify. This will ask Composer to download the source with Git instead of the ZIP archive
  2. we add a step into \Php\Pie\Building\UnixBuild before the phpize to run git submodule update --init; this could either be based on the configuration mentioned, or maybe we could detect which git + existence of .gitmodule file + existence of .git path; a warning could be issued if .gitmodule exists but .git does not (indicating we cannot initialise submodules, since .git is missing).

I think add a composer.json config, something like this could work:

{
    "name": "somevendor/ourextension",
    ...
    "php-ext": {
        "has-git-submodules": true,
    }
}

What do you think folks @alcaeus / @GromNaN ?

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

Successfully merging a pull request may close this issue.

1 participant