ocaml / ocaml/dune

Sanitized paths for CRAM tests in Windows mix `/` and `\`

Open
#4,017 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cram
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Expected Behaviour

Path sanitization, such as the root of the test directory should work seamlessly while using CRAM tests on Unixes and Windows.

Actual Behaviour

Sanitization of paths such as the root of the test directory does not work on Windows due to a mix of / and \.
For example, if the following line is added to the only test in Dune that runs on Windows:

   $ echo $BUILD_PATH_PREFIX_MAP

The result will be:

   $ echo $BUILD_PATH_PREFIX_MAP
+ $TESTCASE_ROOT=C%.\OCaml64\home\u\dune\_build/.sandbox/b3ef.../default/test/blackbox-tests/test-cases/windows-diff.t:...
  

Starting with the _build directory path separators are slashes instead of backslashes.

Reproduction

  1. Install an OCaml Cygwyn environement using fdopen's opam repository
  2. Clone dune master and edit the test file as shown above.
  3. Run the tests.

Specifications

  • Version of dune (output of dune --version): 2.7.0-380-g08d27d547
  • Version of ocaml (output of ocamlc --version)
  • Operating system (distribution and version): 4.1..1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the CRAM test harness and the path-sanitization code that produces BUILD_PATH_PREFIX_MAP, then reproduce the issue with the Windows test and inspect the generated $TESTCASE_ROOT. Done means sanitized paths use consistent separators on Windows and Unix, with the relevant CRAM test passing on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system, operating-systems, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.