Skip to content

Re-enable warnings about unknown flags in OCAMLPARAM except flambda-backend flags #391

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

Closed
wants to merge 10 commits into from

Conversation

gretay-js
Copy link
Contributor

@gretay-js gretay-js commented Nov 17, 2021

This PR is a followup on #382, as discussed in #382 (comment).

  • re-enable warnings of the form illegal environment variable OCAMLPARAM : Warning: discarding value of variable for all tools build from flambda-backend repo.
  • suppress warnings about flambda-backend specific flags using ocaml_compiler_internal_params .
  • address all other comments related to it, except automating generation of ocaml_compiler_internal_params file (that would probably involve refactoring flambda_backend_args).

The hack in Makefile.in for stage0 is only needed to build the compiler itself with OCAMLPARAM that include flambda-backend specific flags (which is currently used in the CI for cfg testing, for example).

@gretay-js gretay-js requested a review from mshinwell as a code owner November 17, 2021 18:23
(cd _build0 && \
mkdir -p $(stage0_prefix)/lib/ocaml && \
cp ../ocaml_compiler_internal_params $(stage0_prefix)/lib/ocaml/ && \
export OCAMLLIB=$(stage0_prefix)/lib/ocaml/ && \
Copy link
Contributor

@xclerc xclerc Nov 18, 2021

Choose a reason for hiding this comment

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

I am out of my depth here, but doesn't it mean that
when triggering a rebuild, the installed files (e.g. of
the stdlib) will take precedence over their working-tree
counterparts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I don't know, but one way to address it would be to remove @stage0_prefix@/lib and rebuild it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering whether it would make sense
to use a completely different directory, for the
ocaml_compiler_internal_params file alone.
Deleting the whole installed lib/ directory is
likely to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The location of ocaml_compiler_internal_param is hardcoded in Compenv. Rather than changing it, we can save and restore OCAMLPARAM around stage0 build. I don't like the hack with OCAMLLIB.

Copy link
Contributor

Choose a reason for hiding this comment

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

(When I wrote "a different directory", I meant set
OCAMLLIB to something that is not $PREFIX/lib.)

Co-authored-by: Xavier Clerc <[email protected]>
@gretay-js
Copy link
Contributor Author

We have BUILD_OCAMLPARAM for it now I think.

@gretay-js gretay-js closed this May 24, 2023
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