Skip to content

Generate ocaml_compiler_internal_params from ./configure arguments#865

Closed
stedolan wants to merge 1 commit intoocaml:trunkfrom
stedolan:configure-params
Closed

Generate ocaml_compiler_internal_params from ./configure arguments#865
stedolan wants to merge 1 commit intoocaml:trunkfrom
stedolan:configure-params

Conversation

@stedolan
Copy link
Copy Markdown
Contributor

Allows setting default options by passing arguments to ./configure, without modifying ./configure for every option. Default options are entered into ocaml_compiler_internal_params. Example:

./configure -default-param g=1 -default-param rectypes=1

@mshinwell
Copy link
Copy Markdown
Contributor

I think this would fit in well with what I was envisaging for multilib support (where all the options would be available at runtime, at least for configured variants of the system, but defaults would still be settable via configure).

The one thing I think we should be careful of is to ensure that the names are obviously consistent with "something else" (e.g. the names of compiler flags).

@stedolan
Copy link
Copy Markdown
Contributor Author

stedolan commented Dec 6, 2016

@shindere
Copy link
Copy Markdown
Contributor

shindere commented Dec 8, 2016 via email

@stedolan
Copy link
Copy Markdown
Contributor Author

Beyond that, I am unclear about where this file is supposed to come from
when it is not generated from configure.

By default, this file does not exist. Compenv.apply_config_file treats a non-existent ocaml_compiler_internal_params the same as an empty one.

The Changes file says its existence has been documented but I can't find where.

Some documentation was added in #879, now living in the manual (cmds/comp.etex).

Finally, rather than specifying the parameters themselves, wouldn't it
be simpler to specify the path to a file that should be copied to stdlib
and then used?

Since many interesting uses of this file specify only one or two options, it's quite handy to be able to write them directly in the ./configure line. I'm particularly interested in having a good way to specify default options from an OPAM .comp file, which amounts to a shell script: in that context, adding a parameter to ./configure is much less messy than creating a temporary file and passing its name to ./configure.. See this example for the sort of thing that is done today to achieve this.

@stedolan
Copy link
Copy Markdown
Contributor Author

stedolan commented Mar 2, 2017

Is anyone interested in this?

(I'm happy to rebase it to trunk, if there's some demand for this feature. Otherwise I'll just close the PR)

@shindere
Copy link
Copy Markdown
Contributor

shindere commented Mar 2, 2017 via email

@dra27
Copy link
Copy Markdown
Member

dra27 commented Mar 2, 2017

I agree that getting rid of those horrible lines in .comp (or for OPAM 2.0, in the ocaml package) is a good objective, but I'm not convinced that un-validated parameters to configure is the way to do it (isn't ocaml_compiler_internal_params kind of a hack in the first place?)

Might it be cleaner (from the point of view of being able to remove it in the future) if:

  • The installation of ocaml_compiler_internal_params (if present) from the build tree stdlib is kept
  • A small helper script is added to tools/ (e.g. tools/generate-internal-params) which generates the file in stdlib/ - so the .comp lines could be replaced with ./tool/generate-internal-params g=1 rectypes=1

I'm thinking along the lines of tools/msvs-promote-path which is an external helper script for using MSVC inside Cygwin, rather than a structured part of either the compiler or the build system.

@stedolan
Copy link
Copy Markdown
Contributor Author

stedolan commented Mar 6, 2017

@dra27 That is a better idea. I've changed it to work like that.

install::
cp stdlib.cma std_exit.cmo *.cmi *.cmt *.cmti *.mli *.ml \
camlheader_ur \
camlheader_ur ocaml_compiler_internal_params \
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't the case that this file only gets created if you run the set-default-params script? In which case, won't this error if you don't run it? $(wildcard ocaml_compiler_internal_params) should fix it, I think.

@xavierleroy
Copy link
Copy Markdown
Contributor

@damiendoligez : do you really want a 4.06 milestone on this GPR? It doesn't feel ready to me.

@damiendoligez
Copy link
Copy Markdown
Member

Right. This doesn't look urgent, and this time we are aiming for a very fast release cycle.

@damiendoligez damiendoligez modified the milestones: 4.06.0, 4.07-or-later Oct 10, 2017
@stedolan
Copy link
Copy Markdown
Contributor Author

The initial reasons for wanting this have gone away (OPAM no longer uses the hack to enable -g, and configure now has an explicit argument for afl instrumentation), so I'm closing this.

@stedolan stedolan closed this Apr 17, 2018
stedolan pushed a commit to stedolan/ocaml that referenced this pull request Oct 25, 2022
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
* Frontend: Icon sharing, preparation

* Add id to svg elements

* Sort icons alphabetically

* Move icon aliases into Icons class

* Identify some SVG paths

* Replace inlined svg by icon definitions

* Uniform api

* Inline more icons

* Inline more icons, cont'd

* more factoring out of icons, only a few left

* icons are decorative, so should not be cause noise for screen readers

* sidebar icon, homepage icons

* Sort attributes

* Fix badly copied class attributes

* Fix tutorial icons

---------

Co-authored-by: Cuihtlauac ALVARADO <cuihtmlauac@tarides.com>
Co-authored-by: Sabine Schmaltz <sabine@tarides.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants