Skip to content

Conversation

tinvaan
Copy link

@tinvaan tinvaan commented Aug 21, 2024

  • do not fail with other virtual envs (eg pyenv)
  • warn if Java version for Gradle is incompatible
  • provide optional flags to skip souffle installation (souffle builds for OSX are broken: https://github.com/souffle-lang/homebrew-souffle/issues)
  • provide optional flags to skip pre-commit hook installations

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 Aug 21, 2024
@tinvaan tinvaan changed the title chore: support other virtual envs and check JDK version for Gradle chore: Makefile tweaks Aug 21, 2024
@behnazh-w behnazh-w changed the base branch from main to staging August 22, 2024 02:16
# install SLSA verifier binary, download mvnw, and gradlew.
.PHONY: setup
setup: force-upgrade setup-go setup-binaries setup-schemastore
ifeq ($(PRE_COMMIT_HOOKS),false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason to make pre-commit optional? Our development environment requires pre-commit hooks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is purely for dev convenience & is also related to the 3rd party(Souffle) build break.

make setup triggers the pre-commit hooks and because tests fail (as expected), build/setup step is blocked as a result.

souffle:
if ! command -v souffle; then \
ifeq ($(INSTALL_SOUFFLE),false)
$(warning "Skipping Souffle installation. Set INSTALL_SOUFFLE=true to install.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you are trying to optionally disable the Souffle installation, but the implementation below should have handled that. Did you get this error on your macOS?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the brew command failed for me instead. AFAIK, command -v <tool> only checks if <tool> exists in the system path. My issue is that Souffle's homebrew package's M* OSX build is broken.

@if [ -f .venv/upgraded-on ]; then \
rm -f .venv/upgraded-on; \
else \
rm -f ${VIRTUAL_ENV}/upgraded-on; \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide more details? What was the original issue?

Copy link
Author

@tinvaan tinvaan Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add more details in the PR description but TL;DR - if a user is using a Python version manager such as pyenv to manage virtual envs, the make script fails because it's looking for a hardcoded file that's probably specific to venv.

pyenv for instance sets the VIRTUAL_ENV variable so appending the upgraded-on file to it's path fixes the breakage.

$ echo $VIRTUAL_ENV
   ... <nothing here> ...

$ pyenv activate oracle@macaron
   ... <nothing here> ...

(oracle@macaron) $ echo $VIRTUAL_ENV
/Users/harish/.pyenv/versions/3.11.9/envs/oracle@macaron

@tinvaan
Copy link
Author

tinvaan commented Aug 23, 2024

@behnazh-w I triggered a CI build on my fork which looks green. Let me know if there are any failures here.

@tinvaan
Copy link
Author

tinvaan commented Aug 24, 2024

Weirdly, I needed to explicitly set-up Go & JDK in the workflow yaml to get the CodeQL runs green on my fork, but same wasn't required for the _build.yaml workflow run.

@behnazh-w
Copy link
Member

Closing this PR as the development checks can be skipped using git commit --no-verify and git push --no-verify, and the Souffle installation is not mandatory for the development setup.

@behnazh-w behnazh-w closed this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants