Skip to content

fix(haiku): execve not allowed if other pthreads have already been created#10953

Merged
anmonteiro merged 2 commits intoocaml:mainfrom
Sylvain78:haiku
Dec 26, 2024
Merged

fix(haiku): execve not allowed if other pthreads have already been created#10953
anmonteiro merged 2 commits intoocaml:mainfrom
Sylvain78:haiku

Conversation

@Sylvain78
Copy link
Copy Markdown
Contributor

Compiling for Haiku

@Sylvain78 Sylvain78 force-pushed the haiku branch 2 times, most recently from 390a5bf to a769735 Compare September 24, 2024 11:06
@anmonteiro anmonteiro changed the title Haiku fix(haiku): execve not allowed if other pthreads have already been created Sep 29, 2024
@anmonteiro
Copy link
Copy Markdown
Collaborator

@rgrinberg do you think this needs a changelog entry?

@Alizter
Copy link
Copy Markdown
Collaborator

Alizter commented Sep 30, 2024

I think it would be worth a changelog entry. I'm still unsure about the issue this is resolving since I've never seen it, so I wouldn't mind a link to some Haiku documentation explaining the issue here. I also don't have a Haiku VM avilable at the moment, so if somebody could double check they can build and run dune on Haiku that would be great.

@rgrinberg
Copy link
Copy Markdown
Member

I don't see why not. If this change is useful to anyone using Haiku, the change log entry would also be useful

@Sylvain78
Copy link
Copy Markdown
Contributor Author

Sylvain78 commented Sep 30, 2024

I think it would be worth a changelog entry. I'm still unsure about the issue this is resolving since I've never seen it, so I wouldn't mind a link to some Haiku documentation explaining the issue here. I also don't have a Haiku VM avilable at the moment, so if somebody could double check they can build and run dune on Haiku that would be great.

@Alizter I encounter this when compiling lwt : "dune exec..." leads to "Operation not supported" because of this line kernel/team.cpp#1981.

The fact that haiku can't call execve from other threads than the principal thread of a process (a team in haiku jargon), is a discrepancy to POSIX and hence there is a bug about it : https://dev.haiku-os.org/ticket/18665.

@Alizter
Copy link
Copy Markdown
Collaborator

Alizter commented Oct 4, 2024

@Sylvain78 Thank you for the context. I recall now seeing something similar to do this when I had a look at Haiku support before. What the Haiku designers will do upstream shouldn't be something we rely on obviously, so the fix that you've given here seems sensible and rigid.

Please add a changelog entry together with links to the Haiku issue and this should be good to go.

Sylvain78 and others added 2 commits December 25, 2024 21:23
…eated

Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Anarchos <sylvain_kerjean@hotmail.com>
Signed-off-by: Sylvain78 <sylvain_kerjean@hotmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
@anmonteiro anmonteiro merged commit acb928f into ocaml:main Dec 26, 2024
ElectreAAS pushed a commit to ElectreAAS/dune that referenced this pull request Jan 27, 2025
…eated (ocaml#10953)

* fix(haiku): execve not allowed if other pthreads have already been created

Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Anarchos <sylvain_kerjean@hotmail.com>
Signed-off-by: Sylvain78 <sylvain_kerjean@hotmail.com>

* chore: add changelog entry

Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>

---------

Signed-off-by: Anarchos <sylvain_kerjean@hotmail.com>
Signed-off-by: Sylvain78 <sylvain_kerjean@hotmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
chris-armstrong pushed a commit to chris-armstrong/dune that referenced this pull request Jan 29, 2025
…eated (ocaml#10953)

* fix(haiku): execve not allowed if other pthreads have already been created

Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Anarchos <sylvain_kerjean@hotmail.com>
Signed-off-by: Sylvain78 <sylvain_kerjean@hotmail.com>

* chore: add changelog entry

Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>

---------

Signed-off-by: Anarchos <sylvain_kerjean@hotmail.com>
Signed-off-by: Sylvain78 <sylvain_kerjean@hotmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Chris Armstrong <chris-armstrong@users.noreply.github.com>
maiste added a commit to maiste/opam-repository that referenced this pull request Mar 31, 2025
CHANGES:

### Fixed

- Support HaikuOS: don't call `execve` since it's not allowed if other pthreads
  have been created. The fact that Haiku can't call `execve` from other threads
  than the principal thread of a process (a team in haiku jargon), is a
  discrepancy to POSIX and hence there is a [bug about
  it](https://dev.haiku-os.org/ticket/18665). (@Sylvain78, ocaml/dune#10953)
- Fix flag ordering in generated Merlin configurations (ocaml/dune#11503, @voodoos, fixes
  ocaml/merlin#1900, reported by @vouillon)

### Added

- Add `(format-dune-file <src> <dst>)` action. It provides a replacement to
  `dune format-dune-file` command.  (ocaml/dune#11166, @nojb)
- Allow the `--prefix` flag when configuring dune with `ocaml configure.ml`.
  This allows to set the prefix just like `$ dune install --prefix`. (ocaml/dune#11172,
  @rgrinberg)
- Allow arguments starting with `+` in preprocessing definitions (starting with
  `(lang dune 3.18)`). (@amonteiro, ocaml/dune#11234)
- Support for opam `(maintenance_intent ...)` in dune-project (ocaml/dune#11274, @art-w)
- Validate opam `maintenance_intent` (ocaml/dune#11308, @art-w)
- Support `not` in package dependencies constraints (ocaml/dune#11404, @art-w, reported
  by @hannesm)

### Changed

- Warn when failing to discover root due to reads failing. The previous
  behavior was to abort. (@KoviRobi, ocaml/dune#11173)
- Use shorter path for inline-tests artifacts. (@hhugo, ocaml/dune#11307)
- Allow dash in `dune init` project name (ocaml/dune#11402, @art-w, reported by @saroupille)
- On Windows, under heavy load, file delete operations can sometimes fail due to
  AV programs, etc. Guard against it by retrying the operation up to 30x with a
  1s waiting gap (ocaml/dune#11437, fixes ocaml/dune#11425, @MSoegtropIMC)
- Cache: we now only store the executable permission bit for files (ocaml/dune#11541,
  fixes ocaml/dune#11533, @ElectreAAS)
- Display negative error codes on Windows in hex which is the more customary
  way to display `NTSTATUS` codes (ocaml/dune#11504, @MisterDA)
maiste added a commit to maiste/opam-repository that referenced this pull request Apr 3, 2025
CHANGES:

### Fixed

- Support HaikuOS: don't call `execve` since it's not allowed if other pthreads
  have been created. The fact that Haiku can't call `execve` from other threads
  than the principal thread of a process (a team in haiku jargon), is a
  discrepancy to POSIX and hence there is a [bug about
  it](https://dev.haiku-os.org/ticket/18665). (@Sylvain78, ocaml/dune#10953)
- Fix flag ordering in generated Merlin configurations (ocaml/dune#11503, @voodoos, fixes
  ocaml/merlin#1900, reported by @vouillon)

### Added

- Add `(format-dune-file <src> <dst>)` action. It provides a replacement to
  `dune format-dune-file` command.  (ocaml/dune#11166, @nojb)
- Allow the `--prefix` flag when configuring dune with `ocaml configure.ml`.
  This allows to set the prefix just like `$ dune install --prefix`. (ocaml/dune#11172,
  @rgrinberg)
- Allow arguments starting with `+` in preprocessing definitions (starting with
  `(lang dune 3.18)`). (@amonteiro, ocaml/dune#11234)
- Support for opam `(maintenance_intent ...)` in dune-project (ocaml/dune#11274, @art-w)
- Validate opam `maintenance_intent` (ocaml/dune#11308, @art-w)
- Support `not` in package dependencies constraints (ocaml/dune#11404, @art-w, reported
  by @hannesm)

### Changed

- Warn when failing to discover root due to reads failing. The previous
  behavior was to abort. (@KoviRobi, ocaml/dune#11173)
- Use shorter path for inline-tests artifacts. (@hhugo, ocaml/dune#11307)
- Allow dash in `dune init` project name (ocaml/dune#11402, @art-w, reported by @saroupille)
- On Windows, under heavy load, file delete operations can sometimes fail due to
  AV programs, etc. Guard against it by retrying the operation up to 30x with a
  1s waiting gap (ocaml/dune#11437, fixes ocaml/dune#11425, @MSoegtropIMC)
- Cache: we now only store the executable permission bit for files (ocaml/dune#11541,
  fixes ocaml/dune#11533, @ElectreAAS)
- Display negative error codes on Windows in hex which is the more customary
  way to display `NTSTATUS` codes (ocaml/dune#11504, @MisterDA)
Sudha247 pushed a commit to Sudha247/dune that referenced this pull request Jul 23, 2025
…eated (ocaml#10953)

* fix(haiku): execve not allowed if other pthreads have already been created

Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Signed-off-by: Anarchos <sylvain_kerjean@hotmail.com>
Signed-off-by: Sylvain78 <sylvain_kerjean@hotmail.com>

* chore: add changelog entry

Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>

---------

Signed-off-by: Anarchos <sylvain_kerjean@hotmail.com>
Signed-off-by: Sylvain78 <sylvain_kerjean@hotmail.com>
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
Co-authored-by: Antonio Nuno Monteiro <anmonteiro@gmail.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.

4 participants