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

Cosmetic updates #110

Merged
merged 5 commits into from
Nov 17, 2022
Merged

Cosmetic updates #110

merged 5 commits into from
Nov 17, 2022

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Nov 17, 2022

  • Eliminate spurious error messages when ocamlopt isn't available in the environment
  • Missing .gitignore patterns for release tarballs and zips
  • Tidy up LICENSE file
  • Add additional fields to the version information block in flexlink.exe
  • Add a -vnum and -version command line argument (finally)

@nojb
Copy link
Collaborator

nojb commented Nov 17, 2022

Hello @dra27! I just saw this PR fly past and thought I would take advantage of it to pose an unrelated question. We maintain the following diff for one of our clients (who builds OCaml from source, with the "boostrapped" FlexDLL):

diff --git a/mlfi/ocaml/flexdll/Makefile b/mlfi/ocaml/flexdll/Makefile
--- a/mlfi/ocaml/flexdll/Makefile
+++ b/mlfi/ocaml/flexdll/Makefile
@@ -161,7 +161,7 @@ Compat.ml: COMPILER-$(COMPAT_VERSION) $(addsuffix .ml, $(COMPAT_MODULES))
 flexlink.exe: $(OBJS) $(RES)
        @echo Building flexlink.exe with TOOLCHAIN=$(TOOLCHAIN) for OCaml $(OCAML_VERSION)
        rm -f flexlink.exe
-       $(RES_PREFIX) $(OCAMLOPT) -o flexlink.exe $(LINKFLAGS) $(OBJS)
+       FLEXLINKFLAGS="" $(RES_PREFIX) $(OCAMLOPT) -o flexlink.exe $(LINKFLAGS) $(OBJS)

 version.res: version.rc
        $(RES_PREFIX) rc version.rc

The point is that they set FLEXLINKFLAGS to pass some flags to flexlink when building the compiler (if memory serves, it is -link <resource file> to add icons and copyright information to the built objects), but this variable should be unset when building flexlink itself. As far as I can see there is no way to do this from "outside" the build system. Does it make sense? Do you see how to achieve this, or a better way to go about it?

@dra27
Copy link
Member Author

dra27 commented Nov 17, 2022

🙂 I agree that can't easily be done from outside. The patch could be done in the compiler's build system, which I'm guessing might simplify things, as I presume the compiler is patched, but flexdll is otherwise unpatched? In the compiler's root Makefile, there's FLEXLINK_BUILD_ENV and I think that adding FLEXLINKFLAGS= to that should have the desired effect. That might not work with without an export in there somewhere - in which case the alternative would be to change the recipes for boot/flexlink.byte$(EXE) and flexlink.opt$(EXE) directly so that FLEXLINKFLAGS= appears before recursive make invocation (i.e. the difference between a shell variable set in a command vs a make variable being exported to commands).

@dra27 dra27 merged commit f5ccd97 into ocaml:master Nov 17, 2022
@dra27 dra27 deleted the misc branch November 17, 2022 12:56
@nojb
Copy link
Collaborator

nojb commented Nov 17, 2022

🙂 I agree that can't easily be done from outside.

Thanks for the explanation!

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