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

Generate shebang header at make world stage. #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

const-rs
Copy link
Contributor

@const-rs const-rs commented Sep 8, 2016

Ken,

while making mosml RPM package for my distribution I met a problem with incorrect shebang line in binaries, that were created with installed MosML.

Packages are built under regular user, so, one can not write to system directories. The packaging process involves 2 stages - build and install. On build stage you can use any directory as PREFIX, while on install stage PREFIX is provided by RPM build system, so it is a fake root, smth like
/home/const/tmp/mosml-buildroot

Therefore shebang header should be generated at build stage, but not at install stage. And overall, no path variable should be defined at install stage.

This header does not affect bootstrap compilers, because these binaries do not include shebang header and should be run with direct call to camlrunm. You can check it by (as I did):

  1. make world
  2. go to src/compiler directory, make clean, make, make promote
  3. look at bootstrap binaries in src directory - they do not contain shebang and header is already generated.

Shebang header points at camlrunm and in bytecode binaries.
Most RPM/DEB build platforms use fake-root, while executing
make install, but can use real root when executing make
world. Thus, all paths should be defined before make
install stage, i.e. at make world stage.
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.

1 participant