Skip to content

Conversation

@algomaster99
Copy link
Contributor

The paths currently logged in the STDOUT are absolute. For example, if you run ./run_macaron.sh find-source -purl pkg:maven/fr.inria.gforge.spoon/[email protected], it logs the paths where the results are written to:

2025-03-26 14:22:07,335 [INFO] Setting the output directory to /home/macaron/output
2025-03-26 14:22:07,336 [INFO] The logs will be stored in debug.log
2025-03-26 14:22:07,877 [INFO] Found repository for PURL: https://github.com/INRIA/spoon
2025-03-26 14:22:07,877 [INFO] Found commit for PURL: 48659c68e53e742c562380281b90bdb76239691e
2025-03-26 14:22:07,878 [INFO] Writing report to: /home/macaron/output/reports/maven/fr_inria_gforge_spoon/spoon-core/spoon-core.source.json
2025-03-26 14:22:07,878 [INFO] Report written to: /home/macaron/output/reports/maven/fr_inria_gforge_spoon/spoon-core/spoon-core.source.json

However, these absolute paths exist only inside the docker container that run_macaron spawns and not on the host machine. To get valid paths for container and host machine, it is better to output relative paths which means stripping /home/macaron from it. Thus, I wrap paths in some places with os.path.relpath(path, os.getcwd()). I assume that WORKDIR inside docker is set to MACARON_WORKSPACE. I have only tested my changes against the local build only.

Note that this is not much of an issue if someone runs macaron without using the container.

@oracle-contributor-agreement
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Mar 26, 2025
@algomaster99
Copy link
Contributor Author

I will come back to this when my OCA is approved.

@algomaster99
Copy link
Contributor Author

image

It is still under review 😅

@tromai
Copy link
Contributor

tromai commented Mar 28, 2025

@algomaster99 Thanks for the update. Please feel free to take your time.

As for this PR, there are multiples places where we log absolute paths apart from the places you have fixed, I wonder if you are going to address them too in this PR ? For example:

If our plan is to address all location of this issue, I would recommend searching /home/macaron in the output log of our Docker integration tests. For example:

@oracle-contributor-agreement
Copy link

Thank you for signing the OCA.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Mar 28, 2025
@algomaster99
Copy link
Contributor Author

If our plan is to address all location of this issue, I would recommend searching /home/macaron in the output log of our Docker integration tests. For example

I was planning to remove harcoded paths everywhere, but I didn't exactly know how to proceed. Ctrl + F over VSCode was the best option. But I will give your idea a spin. Seems better :) Thanks!

@algomaster99
Copy link
Contributor Author

Closing this PR as @behnazh-w says that the CI run button has disappeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants