Generally speaking, if you are physically able to cross a border, it's your duty either not to do it, or to report to some designated locations. In some places, it may be legal for citizens of one of the bordering countries to cross without reporting if they have no goods to declare to custom, but illegal for citizens of third countries.
In the specific example of landing at a French port in a non-commercial vessel, you don't have to do anything if you're coming from another Schengen country, but you are legally mandated to report to customs if you're coming from a non-Schengen country, even if that country is in the EU and even if you're an EU citizen. The French customs website has instructions. They're only in French unfortunately, so I'll translate some excerpts them here. The form that you need to fill in has instructions in English as well as French.
Who is concerned?
Any person on board a pleasure vessel (…), regardless of nationality, arriving directly at a French harbour from a harbour outside the Schengen area, or leaving France to go to a country outside the Schengen area.
You are subject to border controls and you must enter or leave France at one of the designated border crossing harbours (…) during fixed opening times.
By derogation (…) you may enter France at a non-designated harbour if you strictly follow the following procedure:
- The captain of the vessel (…) asks for authorization to enter the port.
- The captain addresses the form (…) to the harbour office (…) at the latest 24 hours before arriving, or if the crossing lasts less than 24 hours, at the latest when the vessel leaves the harbour located outside of the Schengen Area.
I don't know what the penalties are for not following the procedure, but if you get caught, at a minimum, customs tend to have broad permissions and could decide to do a very thorough and disruptive search of your vessel.