Skip to content

regression with 1.2.*: rule conflict #1306

@c-cube

Description

@c-cube

I have the following dune file with a self built stubs archive:

(rule
 (targets libbatsat_stubs.a dllbatsat_stubs.so) ;libbatsat_c.so)
 (deps ./lib.rs ../Cargo.toml (source_tree ../batsat))
 (mode fallback)
 (action
  (progn
    (chdir ..
      (progn
       (run cp -r ../../../../src/batsat ..)
       (chdir src (run cargo build --release))))
    ; TODO: strip the libs first
    (run cp ../target/release/libbatsat_stubs.a .)
    (run cp ../target/release/libbatsat_stubs.so dllbatsat_stubs.so)
    )))

(library
  (name batsat)
  (public_name batsat)
  (libraries threads)
  (wrapped false)
  (modules batsat)
  (flags :standard -safe-string -w @8)
  (c_library_flags :standard -ldl -lpthread) ; -lbatsat_c) ; -static)
  ;(modes native)
  (self_build_stubs_archive (libbatsat_stubs)) ; custom!
  (c_names batsat_stubs)
  (c_flags -fPIC -std=c99)
  )

On 1.1, it builds perfectly well. On 1.2 (and 1.2.1):

Multiple rules generated for _build/default/src/batsat-ocaml/src/libbatsat_stubs.a:
- <internal location>
- src/batsat-ocaml/src/dune:2
make: *** [Makefile:22: build-ocaml] Error 1

(to experiment, look at https://github.com/c-cube/batsat/tree/master/src/batsat-ocaml)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions