Skip to content

CI: test that opam install works#253

Open
hhugo wants to merge 11 commits into
masterfrom
more-ci
Open

CI: test that opam install works#253
hhugo wants to merge 11 commits into
masterfrom
more-ci

Conversation

@hhugo

@hhugo hhugo commented Mar 5, 2025

Copy link
Copy Markdown
Member

No description provided.

@hhugo

hhugo commented Mar 5, 2025

Copy link
Copy Markdown
Member Author

@smorimoto, you've added Windows to the CI but the ocsigenserver package doesn't install successfully with opam. Do you plan to work on this ?

@smorimoto

Copy link
Copy Markdown
Member

I have been so busy with work lately so I don't think I can work on it "for now".

@vouillon vouillon changed the title Make sure opam install works CI: test that opam install works Apr 8, 2025
hhugo and others added 10 commits June 27, 2026 18:10
On Windows, opam passes empty arguments (e.g. `--temproot ""`) through the
Cygwin shell as a literal double-quote character. That stray quote ended up
in Makefile.config as `TEMPROOT := "` and broke the install.files recipe
(/bin/sh: unexpected EOF while looking for matching `"').

Strip double quotes from the path variables that get prepended to install
paths so Makefile.config stays well-formed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cygwin/NTFS does not support Unix permission bits, so `install` aborts with
"cannot change permissions ... Permission denied" when it chmods the file or
directory it just created (this happens even without an explicit -m, since
install applies mode 755 by default).

Detect Windows (OS=Windows_NT or a CYGWIN uname) and fall back to plain
`mkdir -p` / `cp`, dropping the mode and ownership flags. Behavior on
Linux/macOS is unchanged: the mode flags are now carried inside the
INSTALL_MOD_* variables (`-m <mode>`) so they can be emptied on Windows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On Windows, opam passes paths with backslash separators (the expansion of
%{lib}%, %{prefix}%, etc.). The Cygwin shell that runs the install recipes
eats those backslashes as escape characters, corrupting the paths (e.g.
'D:\a\...' became 'D:a...' and cp failed with 'No such file or directory').

Convert backslashes to forward slashes for all path variables before writing
Makefile.config; Cygwin accepts forward-slash drive paths (D:/a/...) and the
conversion is a no-op on Unix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Consolidate the Windows handling into a single detection point. cygpath only
exists on Cygwin, so its presence identifies the platform and also normalizes
opam's Windows-style paths (backslashes / drive letters / stray quotes) via
`cygpath -m`, replacing the manual tr-based conversion and quote stripping.

configure writes OCSIGEN_WINDOWS into Makefile.config; the Makefile now reads
that flag for the install.files mkdir/cp fallback instead of re-detecting the
platform with OS/uname.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On Windows OCSIGENGROUP is empty, so the `groups | grep -q $OCSIGENGROUP`
check ran grep with no pattern and printed a usage error into the build log.
The whole permission/ownership detection is meaningless on Windows (the
OCSIGEN_WINDOWS branch drops modes and ownership regardless), so guard it out.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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