Easy to forget checking FIPS_IMPORT in a "dual use" project (import vs top-level)

Aperta
#230 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cmake, cpp, python
Ambito
build-system

Direzione di ricerca

The failure comes from fips_project being run twice for the same project, so the add_library call in cmake/fips.cmake (around line 299) collides with an existing glew target. Start by reading the FIPS_IMPORT guard logic in cmake/fips.cmake and how .fips-imports.cmake is loaded, then reproduce with the attached dual-use project layout. Done means a second import of fips-glew no longer errors, with the reproduction generating cleanly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When an imported project already contains a .fips-imports.cmake it will cause the libraries referenced by that project to be added twice, causing cmake to fail

Proof of concept:
fips-import.zip

  • fips-import-broken imports fips-import which imports fips-glew.
  • running fips gen in fips-import-broken with a clean fips-import project succeeds
  • running fips gen in the fips-import and then again in fips-import-broken fails with
CMake Error at D:/devel/fipstest/fips/cmake/fips.cmake:299 (add_library):
  add_library cannot create target "glew" because another target with the
  same name already exists.  The existing target is a static library created
  in source directory "D:/devel/fipstest/fips-glew".  See documentation for
  policy CMP0002 for more details.
Call Stack (most recent call first):
  D:/devel/fipstest/fips-glew/CMakeLists.txt:17 (fips_end_lib)

Note: the urls in the fips-imports projects are obviously wrong, but it doesnt matter as they are already present in the folder structure.

CMake version 3.14.1, python 3.6 and 3.7

Lingua principale
Python
Stelle
506
Fork
84
Merge medio
13h 14m
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di floooh/fips

Tutte le issue di floooh/fips

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.