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

+ocaml.org #5755

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

+ocaml.org #5755

wants to merge 12 commits into from

Conversation

rustdevbtw
Copy link
Contributor

Adds a recipe for OCaml WITHOUT the Compiler Libraries, which are often unnecessary for everything but Opam. For Opam, we need that, btw.

Signed-off-by: Rajdeep Malakar <[email protected]>

Adds a recipe for OCaml WITHOUT the Compiler Libraries, which are often
unnecessary for everything but Opam. For Opam, we need that, btw.
Signed-off-by: Rajdeep Malakar <[email protected]>
@rustdevbtw
Copy link
Contributor Author

@jhheider @mxcl Any idea what's wrong? It builds and tests just fine locally. And seems like the bug isn't related to the recipe itself. So, I'm clueless.

@jhheider
Copy link
Contributor

It can't find ocaml. Are you sure there's a bin/ocaml at the end, and it's not a broken symlink? Adding an ls should show it.

@rustdevbtw
Copy link
Contributor Author

It can't find ocaml. Are you sure there's a bin/ocaml at the end, and it's not a broken symlink? Adding an ls should show it.

Yep, that's the problem. OCaml has so many binaries, that I just copy-pasted all the bin names, and added a - at the beginning. But I forgot to add the bin/ part. bk test worked because I already had OCaml built before with PKGX (I just added bin/ocaml and bin/ocamlc as provides back then).

rustdevbtw and others added 2 commits March 31, 2024 20:46
`/opt/ocaml.org/v5.1.1+brewing/opt/ocaml.org/v5.1.1+brewing/lib/ocaml/compiler-libs`

prefix was getting applied twice
@jhheider
Copy link
Contributor

Problem was prefix in the build twice:
/opt/ocaml.org/v5.1.1+brewing/opt/ocaml.org/v5.1.1+brewing/lib/ocaml/compiler-libs

@jhheider
Copy link
Contributor

jhheider commented Apr 1, 2024

it looks like some of the bins are probably shellscripts that need surgery for relocatability.

@jhheider
Copy link
Contributor

jhheider commented Apr 1, 2024

this fixes the file-not-found issue:

    - run: |
        LENGTH=$[$(head -n1 ocaml | wc -c)-1]
        NEW_SHEBANG=$(printf "%-${LENGTH}s" "#!/usr/bin/env ocamlrun")
        for BIN in $SHEBANGD; do
          sed -i "1s|.*|$NEW_SHEBANG|" $BIN
        done
      working-directory: '{{prefix}}/bin'
  env:
    SHEBANGD:
      - ocaml
      - ocamlc.byte
      - ocamlcmt
      - ocamlcp
      - ocamldebug
      - ocamldep.byte
      - ocamldoc
      - ocamllex.byte
      - ocamlmklib
      - ocamlmktop
      - ocamlobjinfo.byte
      - ocamlopt.byte
      - ocamloptp
      - ocamlprof

but it still has relocatability issues. Homebrew's recipe suggests build paths are baked into the output, and https://ocaml.org/docs/arm64-fix suggests the only fix is to match install path to build path. if that's true, then this isn't going to work without potentially massive changes to the underlying binaries.

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.

None yet

2 participants