Skip to content

Commit

Permalink
Remove sirius port (#896)
Browse files Browse the repository at this point in the history
Sirius is not a direct dependency, we should not manage it as such. At
best/worst we can download it but not manage it
  • Loading branch information
JasonMarechal25 authored Sep 4, 2024
1 parent ca0ce46 commit 313881e
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 46 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,6 @@ if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()

find_package(sirius_solver REQUIRED)
install(FILES
$<TARGET_FILE:sirius_solver>
DESTINATION bin
)
if (SOLVER)
if (SOLVER STREQUAL "xpress")
add_definitions (-DXPRESS_SOLVER -DUSE_XPRESS)
Expand Down Expand Up @@ -296,6 +291,13 @@ FILE(COPY ${ANTARES_SOLVER_DIR}/
USE_SOURCE_PERMISSIONS
FILES_MATCHING PATTERN "*.so")

#Glob *.so files in antares_solver_dir
file(GLOB_RECURSE ANTARES_SOLVER_LIBS ${ANTARES_SOLVER_DIR}/*.so)
INSTALL(FILES ${ANTARES_SOLVER_LIBS} DESTINATION bin)
file(GLOB_RECURSE ANTARES_SOLVER_LIBS ${ANTARES_SOLVER_DIR}/*.dll)
INSTALL(FILES ${ANTARES_SOLVER_LIBS} DESTINATION bin)


FILE(COPY ${ANTARES_SOLVER_DIR}/../lib/
DESTINATION ${CURRENT_RUNTIME_OUTPUT_DIRECTORY}
USE_SOURCE_PERMISSIONS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Status: Accepted [06/2024]

Superseded by [[011] Don't build second degree dependencies](./%5B011%5DDon%27t%20build%20or%20port%20second%20degree%20dependency.md)


## Context

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Don't build second degree dependencies

## Accepted [08/2024]

Supersede [Create custom vcpkg ports for deps](./%5B009%5D%20Create_custom_vcpkg_ports_for_deps.md)

## Context

Let's define direct dependencies as the dependencies that are directly used by the application.
Let's define second degree dependencies as the dependencies that are used by the direct dependencies but not the application itself.

Second degree dependencies management is not the responsibility of the application but of the direct dependencies.
The application should not try to get or build second degree dependencies. Requirements may change inside direct dependencies but should not impact
the application or in the least possible way.
The least possible way is nothing. Realistically, it may be a version number while retrieving a second degree dependency.

Describing ports for second degree dependencies can be confusing because it promotes them as direct dependencies.
We should stick to best practices:
* Fetch_content a direct dependency and let it manage its own dependencies
* Use a dependency manager for direct dependencies and let it manage its own dependencies
* Download pre-built binaries for direct dependencies and matching second degree dependencies as a worst case scenario.

## Decision

* Remove Sirius port. Not a direct dependency, use prebuild binaries or lean on fetch_content
* Download all second degree dependencies if possible (ortools, sirius, etc.)
* When it is easier to manage, use vcpkg ports instead of system package or prebuild binaries for second degree dependencies. Like boost.
It avoids polluting user environment.

## Consequences

Limit the number of ways we're managing dependencies
21 changes: 0 additions & 21 deletions ports/sirius-solver/portfile.cmake

This file was deleted.

16 changes: 0 additions & 16 deletions ports/sirius-solver/vcpkg.json

This file was deleted.

4 changes: 0 additions & 4 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
"features": [
"zlib"
]
},
{
"name": "sirius-solver",
"version>=": "1.5"
}
]
}

0 comments on commit 313881e

Please sign in to comment.