Skip to content

Add feature ocaml-opam#111

Merged
koralowiec merged 4 commits intodevcontainers-extra:mainfrom
mrBen:ocaml-opam
Mar 12, 2025
Merged

Add feature ocaml-opam#111
koralowiec merged 4 commits intodevcontainers-extra:mainfrom
mrBen:ocaml-opam

Conversation

@mrBen
Copy link
Copy Markdown
Contributor

@mrBen mrBen commented Mar 5, 2025

I know that ocaml-asdf and opam-asdf already exist, but:

  • I don't want to use OCaml without opam
  • opam-asdf only installs opam, then I have to initialize it, then install OCaml
  • they don't include convenient things like the build system, an LSP, the VS Code extension, etc.
  • I don't know what asdf is, so I don't really want to use it 😅

Both seem auto-generated, with no real intention of providing a usable development environment out of the box.

I started from scratch, following the installation process given on the OCaml site.


I still have a few details to work out:

  • gh-release doesn't download the latest version of opam
  • platform tools are systematically installed; this should be disableable
  • if the project uses opam as a dependency manager (which is likely), have an option to pre-install the project's dependencies

I don't know if I should publish it and improve it later, or keep it as a draft until I've solved these details?

@koralowiec
Copy link
Copy Markdown
Member

Heyo!

I don't know if I should publish it and improve it later, or keep it as a draft until I've solved these details?

I think it should be fine to release the feature with the current scope (so you can mark it as ready for review).

You can create separate issues for the todos which you listed, and I'll assign you to them.

gh-release doesn't download the latest version of opam

This one seems strange, so I may lend a hand (maybe something is wrong with gh-release feature)

@mrBen mrBen marked this pull request as ready for review March 6, 2025 08:56
@mrBen
Copy link
Copy Markdown
Contributor Author

mrBen commented Mar 6, 2025

I'll create the issues.

For gh-release, instead of getting opam 2.3.0, it gets 2.3.0~rc1, which is the latest pre-release. I wanted to look a bit further to open a proper issue, but I haven't had the time yet.

@koralowiec
Copy link
Copy Markdown
Member

Oh, this one is a know issue on nanolayer side (devcontainers-extra/nanolayer#1). I have to finally fix it...

As a workaround you can use regex for releases (like I did for helmfile feature):

--option releaseTagRegex='^(?!.*(alpha|beta|rc)).*$'

This should filter out the releases that contain alpha, beta, or rc in their names

@koralowiec koralowiec self-requested a review March 6, 2025 10:28
@koralowiec koralowiec added the new feature This PR or issue is about adding a new Dev Container feature label Mar 6, 2025
Copy link
Copy Markdown
Member

@koralowiec koralowiec left a comment

Choose a reason for hiding this comment

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

Looks fine, I only have a small change request

Comment thread src/ocaml-opam/install.sh Outdated
Co-authored-by: Arek Kalandyk <36413794+koralowiec@users.noreply.github.com>
Signed-off-by: Benjamin Collet <benjamin.collet@protonmail.ch>
@koralowiec koralowiec merged commit 1810305 into devcontainers-extra:main Mar 12, 2025
@koralowiec
Copy link
Copy Markdown
Member

The feature will be available after this job is run

@mrBen mrBen deleted the ocaml-opam branch March 12, 2025 19:48
@koralowiec
Copy link
Copy Markdown
Member

Feature is available: https://github.com/devcontainers-extra/features/pkgs/container/features%2Focaml-opam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature This PR or issue is about adding a new Dev Container feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants