Opened 3 months ago

Closed 2 months ago

#32319 closed defect (implemented)

Macros and definitions for declaring per-module configuration

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.4.3.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords:
Cc: nickm, teor, gaba Actual Points: .2
Parent ID: #30866 Points:
Reviewer: teor Sponsor: Sponsor31-can

Description

Our existing macros work well when we only have a few configuration objects, but they are fiddly to set up, and they involve redundant declarations of a C structure and a configuration table of config_var_t[]. Further, they rely on some questionable tricks (see conftesting.h).

Instead, we should have a better way to generate configuration structures and tables from a single definition.

Child Tickets

Change History (9)

comment:1 Changed 3 months ago by nickm

I have a stub branch here, including a design, a set of macros, and an example declaration for an object and its corresponding table. The new configuration object is not yet "hooked up" to anything in the rest of Tor; it's just there to show how the syntax would look.

The branch is confdecl with a PR in https://github.com/torproject/tor/pull/1478 . I am not sure how much of this we should merge, and whether it should be part of a larger branch that contains the rest of the "plumbing".

comment:2 Changed 3 months ago by nickm

Reviewer: teor
Sponsor: Sponsor31-can
Status: assignedneeds_review

(I think this does not need a changes file, since it is part of the other refactoring work, but I could be wrong.)

comment:3 Changed 3 months ago by teor

Status: needs_reviewneeds_revision

Seems ok as a design, I put a few questions on the PR.

But the new code breaks rust linking, so I think it's higher-risk than our other recent changes. So I'd like to use the new code in tor before we merge it. (It doesn't have to be a big refactor.)

comment:4 Changed 3 months ago by nickm

Thanks for the review!

But the new code breaks rust linking, so I think it's higher-risk than our other recent changes. So I'd like to use the new code in tor before we merge it. (It doesn't have to be a big refactor.)

Is it okay if I do this as a part of the branch that enables subsystem-specific configuration?

comment:5 Changed 3 months ago by nickm

(That is, I'm thinking of moving to the branch that enables subsystem-specific configuration, getting that working, and incorporating the commits from this branch as a part of that.)

comment:6 Changed 3 months ago by teor

Sure, that sounds fine.

comment:7 Changed 2 months ago by teor

This is now in #30866.

comment:8 Changed 2 months ago by nickm

Parent ID: #29211#30866

comment:9 Changed 2 months ago by nickm

Resolution: implemented
Status: needs_revisionclosed

Merged with parent.

Note: See TracTickets for help on using tickets.