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

external commands (astgen, php-parser etc.): fix and consolidate base dir #4956

Merged
merged 7 commits into from
Oct 7, 2024

Conversation

mpollmeier
Copy link
Contributor

The logic to guess the base dir of the installation is quite fiddly but
works for our use cases for astgen. PhpParser implemented something similar, but
not quite - and it failed for buildbot.

On buildbot the installation path for php2cpg is
/worker/sptestV2-php2cpg/build/x2cpg-internal/php2cpg/target/universal/stage
which (prior to this PR) leads to an invalid derived php-parser name
and the following error:

2024-09-25 09:30:08.623 ERROR Invalid path for PhpParserBin: /worker/sptestV2-/php2cpg/bin/php-parser/php-parser.php

… dir

The logic to guess the base dir of the installation is quite fiddly but
works for our use cases for astgen. PhpParser implemented something similar, but
not quite - and it failed for buildbot.

On buildbot the installation path for php2cpg is
`/worker/sptestV2-php2cpg/build/x2cpg-internal/php2cpg/target/universal/stage`
which (prior to this PR) leads to an invalid derived php-parser name
and the following error:
```
2024-09-25 09:30:08.623 ERROR Invalid path for PhpParserBin: /worker/sptestV2-/php2cpg/bin/php-parser/php-parser.php
```
@mpollmeier mpollmeier force-pushed the michael/external-commands-basedir-fix branch from fde79d2 to a578959 Compare October 4, 2024 10:06
@mpollmeier mpollmeier requested a review from maltek October 4, 2024 10:07
@mpollmeier mpollmeier merged commit 488fd7b into master Oct 7, 2024
5 checks passed
@max-leuthaeuser max-leuthaeuser deleted the michael/external-commands-basedir-fix branch October 7, 2024 10:47
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.

2 participants