p4lang / p4c

P4_16 reference compiler
https://p4.org/
Apache License 2.0
679 stars 444 forks source link

Each back end should list its dependencies separately. The top-level dependencies should only list the dependencies necessary for p4test. #4536

Open fruffy opened 7 months ago

fruffy commented 7 months ago

Do not force users to install more than necessary if they only want to use one particular part of the compiler.

vlstill commented 7 months ago

Why is the p4test assumed to be always present? Or is it just that p4test does not have any dependencies that are also not dependencies of the "core" used by all backends?

fruffy commented 7 months ago

Why is the p4test assumed to be always present? Or is it just that p4test does not have any dependencies that are also not dependencies of the "core" used by all backends?

Yes, p4test does not have any non-core dependencies (except the control-plane maybe). We could make it optional too but then we only have gtest.

vlstill commented 7 months ago

We could make it optional too but then we only have gtest.

There is already a ENABLE_P4TEST option. So presumably it can be disabled already.

Of course, building without p4test makes the test suite much less useful, but I could see a downstream backend disabling it just to make the builds a bit faster.

asl commented 7 months ago

Yes, p4test does not have any non-core dependencies (except the control-plane maybe). We could make it optional too but then we only have gtest.

I would probably vote to have control-plane dependency optional, if possible. As control-plane currently requires protobuf and it's ok for a downstream project to have completely separate controlplane

Sanket-0510 commented 7 months ago

From the conversation it seems we are heading to disable the control plane dependencies which we install for p4test which is a non-core dependency. And also if we could disable other dependencies which are backend specific am I correct?

fruffy commented 7 months ago

The relevant issue for this problem is https://github.com/p4lang/p4c/issues/4420. This requires adding checks for every back end and code that depends on the control plane.