Depending on the requirement for the circle which size is determined by the height/depth of `a long node` and the width `10pt`, here are some alternative approaches.
---
The closest would be `cerchioB` where the text is actually a label on top of the circle, though you need to change your syntax a bit (also doesn't allow verbatim text anymore):
```
\node[cerchioB=a long node];
```
You can now use that parameter for the label itself but also for the parent node and with `\vphantom` the circle has the same size as in your `\makebox` example
---
`cerchioA` places the circle as a label, getting the same size as in your example isn't trivial. (But maybe the size of the circle shouldn't be in relation to the text in the first place?)
I'm not a friend of `behind path` but if it's just a `\node` (and its label), it should be fine.
---
Lastly, `cerchioC` simply does basically the same as `\makebox[#1][c]` but with styles.
This will create a textbox of width `text width=10pt` with a box of width `#1` centered inside of it – just like `\makebox`.
Though, just like `\makebox` TikZ won't be able to adjust the bounding box of the picture to the text. (That's why I put those `\RULE`s around the pictures.)
---
Of course, you can do both as a `pic` which is what `cerchioD` does, the `pic` key helps so that the user can still use `\node`, unfortunately, the text needs to be given as part of the options again. (Though something like `pic {cerchio=a long node}` is possible, too.)
```
\documentclass{article}
\usepackage{tikz}
\tikzset{
makebox/.style={
execute at begin node=\hbox to#1\bgroup\hss,
execute at end node=\hss\egroup},
cerchio/.style = {
draw=red, fill=yellow, circle, text=black,
text width=10pt, text centered},
cerchioA/.style = {
path only, text=black, shape=rectangle,
label={[draw=red, fill=yellow, behind path,
shape=circle, text width=10pt, anchor=center]center:}},
cerchioB/.style={
draw=red, fill=yellow, shape=circle, text width=10pt,
node contents=\vphantom{#1},
label={[path only, text=black, shape=rectangle, anchor=center]center:{#1}}},
cerchioC/.style={
draw=red, fill=yellow, shape=circle, text width=10pt, text centered,
makebox=0pt}, % or makebox=10pt
pic/.is if=tikz@node@is@pic, % allows turning a node into a pic
cerchioD/.style={pic, pic text={#1}, pic type=cerchio},
cerchio/.pic={
\path[draw=red, fill=yellow] circle[radius=10pt+.3333em]; % roughly
\node[path only, shape=rectangle] {\tikzpictext};}}
\newcommand*\RULE{\rule[-.3\baselineskip]{.4pt}{2.5\baselineskip}}
\begin{document}
\RULE
\tikz
\node[cerchio]{\makebox[0pt]{a long node}};%
\RULE
\RULE
\tikz % node is circle, label is rectangle (text)
\node[cerchioA]{a long node};%
\RULE
\RULE
\tikz % node is rectangle (text), label is circle
\node[cerchioB=a long node];%
\RULE
\RULE
\tikz % node is circle, text box contains makebox
\node[cerchioC]{a long node};%
\RULE
\RULE
\tikz % it's actually a pic
\node[cerchioD=a long node];%
\RULE
\end{document}
```
![xyz1949.png](/image?hash=0c7897322601e813447624adf88f66a3a3ae5989c028db479b014e51c290a144)