Skip to content

feat: add extra_objects field to foreign_library stanza - #11683

Merged
rgrinberg merged 7 commits into
ocaml:mainfrom
Alizter:foreign_objects
Apr 30, 2025
Merged

rgrinberg merged 7 commits into
ocaml:mainfrom
Alizter:foreign_objects

Conversation

@Alizter

@Alizter Alizter commented Apr 27, 2025 •

Copy link
Copy Markdown
Collaborator

We add support for the extra_objects field in the foreign_library stanza. This allows extra object files to be linked to foreign libraries.

  • Update docs
  • Changelog
  • Dune lang bump (we should be 3.19 not 3.18)?

@rgrinberg

Copy link
Copy Markdown
Member

Could you see if it's hard to add (:include ...) as well? It would allow us to get rid of the ugly dynamic_include stuff.

@Alizter

Alizter commented Apr 28, 2025

Copy link
Copy Markdown
Collaborator Author

@rgrinberg I added (:include) for extra_objects in the foreign_library stanza. I suppose we should also do the same for executable.

@rgrinberg

Copy link
Copy Markdown
Member

I suppose we should also do the same for executable.

Yes, but that will require versioning.

@Alizter
Alizter marked this pull request as ready for review April 29, 2025 23:32
@Alizter
Alizter requested a review from rgrinberg April 30, 2025 08:36
@rgrinberg
rgrinberg merged commit c9ba2f7 into ocaml:main Apr 30, 2025
maxim092001 pushed a commit to maxim092001/dune that referenced this pull request May 3, 2025
maiste added a commit to maiste/opam-repository that referenced this pull request May 20, 2025
CHANGES:

### Fixed

- Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple
  times. (ocaml/dune#11547, @Alizter)

- Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality
  flag would result in pkgconf not finding libraries in some contexts. (ocaml/dune#11619, @MisterDA)

- Fix: Evaluate `enabled_if` when computing the stubs for stanzas such as
  `foreign_library` (ocaml/dune#11707, @Alizter, @rgrinberg)

- Fix $ dune describe pp for libraries in the presence of `(include_subdirs
  unqualified)` (ocaml/dune#11729, fixes ocaml/dune#10999, @rgrinberg)

- Fix `$ dune subst` in sub directories of a git repository (ocaml/dune#11760, fixes
  ocaml/dune#11045, @Richard-Degenne)

- Fix a crash involving `Path.drop_prefix` when using Melange on Windows
  (ocaml/dune#11767, @nojb)

### Added

- Added detection and warning for common typos in package dependency
  constraints (ocaml/dune#11600, fixes ocaml/dune#11575, @kemsguy7)

- Added `(extra_objects)` field to `(foreign_library)` stanza with `(:include)` support.
  (ocaml/dune#11683, @Alizter)

### Changed

- Allow build RPC messages to be handled by dune's RPC server in eager watch
  mode (ocaml/dune#11622, @gridbugs)

- Allow concurrent build with RPC server (ocaml/dune#11712, @gridbugs)
maiste added a commit to maiste/opam-repository that referenced this pull request May 21, 2025
CHANGES:

### Fixed

- Fixed a bug that was causing cram tests attached to multiple aliases to be run multiple
  times. (ocaml/dune#11547, @Alizter)

- Fix: pass pkg-config (extra) args in all pkgconfig invocations. A missing --personality
  flag would result in pkgconf not finding libraries in some contexts. (ocaml/dune#11619, @MisterDA)

- Fix: Evaluate `enabled_if` when computing the stubs for stanzas such as
  `foreign_library` (ocaml/dune#11707, @Alizter, @rgrinberg)

- Fix $ dune describe pp for libraries in the presence of `(include_subdirs
  unqualified)` (ocaml/dune#11729, fixes ocaml/dune#10999, @rgrinberg)

- Fix `$ dune subst` in sub directories of a git repository (ocaml/dune#11760, fixes
  ocaml/dune#11045, @Richard-Degenne)

- Fix a crash involving `Path.drop_prefix` when using Melange on Windows
  (ocaml/dune#11767, @nojb)

### Added

- Added detection and warning for common typos in package dependency
  constraints (ocaml/dune#11600, fixes ocaml/dune#11575, @kemsguy7)

- Added `(extra_objects)` field to `(foreign_library)` stanza with `(:include)` support.
  (ocaml/dune#11683, @Alizter)

### Changed

- Allow build RPC messages to be handled by dune's RPC server in eager watch
  mode (ocaml/dune#11622, @gridbugs)

- Allow concurrent build with RPC server (ocaml/dune#11712, @gridbugs)
Sudha247 pushed a commit to Sudha247/dune that referenced this pull request Jul 23, 2025
@Alizter Alizter added this to the 3.19.0 milestone Jun 10, 2026
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