Skip to content

mbedtls: Re-prepare when configuration changes - #19358

Merged
openwrt-bot merged 1 commit into
openwrt:mainfrom
ksperling-apple:mbedtls-reprepare
Jul 19, 2025
Merged

openwrt-bot merged 1 commit into
openwrt:mainfrom
ksperling-apple:mbedtls-reprepare

Conversation

@ksperling-apple

Copy link
Copy Markdown
Contributor

Configuration options are applied to mbedtls_config.h in the Prepare step (not in Configure), so Prepare needs to depend on those options to ensure the build tree gets re-prepared when they change.

@github-actions github-actions Bot added the core packages pull request/issue for core (in-tree) packages label Jul 9, 2025
@hauke

hauke commented Jul 10, 2025

Copy link
Copy Markdown
Member

I would prefer if you apply the configuration in the configure step instead. Does this cause any additional problems?

@ksperling-apple

Copy link
Copy Markdown
Contributor Author

I would prefer if you apply the configuration in the configure step instead. Does this cause any additional problems?

@hauke I can do that. I think I would have to get rid of the behavior from 0d43c22 to ensure the defaults from Config.in are applied consistently. (I'm not sure what the intent was behind that behavior; it seems a little strange since the only way I can see to have no CONFIG_MBEDTLS_ options set is to manually disable the ones that are defaulted to Y in Config.in.)

@hauke

hauke commented Jul 15, 2025

Copy link
Copy Markdown
Member

I would prefer if you apply the configuration in the configure step instead. Does this cause any additional problems?

@hauke I can do that. I think I would have to get rid of the behavior from 0d43c22 to ensure the defaults from Config.in are applied consistently. (I'm not sure what the intent was behind that behavior; it seems a little strange since the only way I can see to have no CONFIG_MBEDTLS_ options set is to manually disable the ones that are defaulted to Y in Config.in.)

You can get into this situation when you have an older configuration and do not run make oldconfig before starting the build. I do not think we have to support this case.

Is this bigger change only needed when you move it from the prepare to the configuration step?

@ksperling-apple

Copy link
Copy Markdown
Contributor Author

I would prefer if you apply the configuration in the configure step instead. Does this cause any additional problems?

@hauke I can do that. I think I would have to get rid of the behavior from 0d43c22 to ensure the defaults from Config.in are applied consistently. (I'm not sure what the intent was behind that behavior; it seems a little strange since the only way I can see to have no CONFIG_MBEDTLS_ options set is to manually disable the ones that are defaulted to Y in Config.in.)

You can get into this situation when you have an older configuration and do not run make oldconfig before starting the build. I do not think we have to support this case.

Is this bigger change only needed when you move it from the prepare to the configuration step?

It's not a bigger change as such, I was just planning on removing the special casing of "no config options are set" and instead just always apply all options to the header file. (Unlike Prepare, Configure won't necessarily run on a clean freshly unpacked header, but by always applying all the options the resulting state will always be correct.)

I'll update the PR in the next couple of days.

@ksperling-apple
ksperling-apple force-pushed the mbedtls-reprepare branch 2 times, most recently from f9dee27 to 5514bd0 Compare July 16, 2025 22:43
This ensures mbedtls_config.h is correctly updated and the package rebuilt
accordingly when configuration options are changed after the source is first
prepared.

Signed-off-by: Karsten Sperling <[email protected]>
Link: openwrt#19358
Signed-off-by: Hauke Mehrtens <[email protected]>
@hauke
hauke force-pushed the mbedtls-reprepare branch from 5514bd0 to 5359639 Compare July 19, 2025 15:54
@openwrt-bot
openwrt-bot merged commit 5359639 into openwrt:main Jul 19, 2025
@ksperling-apple
ksperling-apple deleted the mbedtls-reprepare branch July 20, 2025 21:10
gebruno pushed a commit to LAND-UFRJ/openwrt that referenced this pull request Jul 21, 2025
This ensures mbedtls_config.h is correctly updated and the package rebuilt
accordingly when configuration options are changed after the source is first
prepared.

Signed-off-by: Karsten Sperling <[email protected]>
Link: openwrt#19358
Signed-off-by: Hauke Mehrtens <[email protected]>
gebruno pushed a commit to LAND-UFRJ/openwrt that referenced this pull request Jul 21, 2025
This ensures mbedtls_config.h is correctly updated and the package rebuilt
accordingly when configuration options are changed after the source is first
prepared.

Signed-off-by: Karsten Sperling <[email protected]>
Link: openwrt#19358
Signed-off-by: Hauke Mehrtens <[email protected]>
@1715173329

1715173329 commented Jul 22, 2025 •

Copy link
Copy Markdown
Member

This ensures mbedtls_config.h is correctly updated and the package rebuilt
accordingly when configuration options are changed after the source is first
prepared.

I don't understand. We have PKG_CONFIG_DEPENDS set for this package, so if you have changed mbedtls related configurations the build system will automatically trigger a full rebuild (include prepare stage) for it.
So it doesn't really make any difference to put this in Prepare or Configure stage.

I don't know what situation 0d43c22 was prepared for, but it does workaround a build system bug, i.e. the package get built for some reason that it's even unselected.

EDIT: oh PKG_CONFIG_DEPENDS doesn't apply for prepare stage, sorry for that.

AlbrechtL pushed a commit to AlbrechtL/openwrt that referenced this pull request Aug 1, 2025
This ensures mbedtls_config.h is correctly updated and the package rebuilt
accordingly when configuration options are changed after the source is first
prepared.

Signed-off-by: Karsten Sperling <[email protected]>
Link: openwrt#19358
Signed-off-by: Hauke Mehrtens <[email protected]>
KGeri201 pushed a commit to KGeri201/openwrt that referenced this pull request Aug 17, 2025
This ensures mbedtls_config.h is correctly updated and the package rebuilt
accordingly when configuration options are changed after the source is first
prepared.

Signed-off-by: Karsten Sperling <[email protected]>
Link: openwrt#19358
Signed-off-by: Hauke Mehrtens <[email protected]>
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Aug 27, 2025
This ensures mbedtls_config.h is correctly updated and the package rebuilt
accordingly when configuration options are changed after the source is first
prepared.

Signed-off-by: Karsten Sperling <[email protected]>
Link: openwrt#19358
Signed-off-by: Hauke Mehrtens <[email protected]>
HateTM pushed a commit to HateTM/tpl_ax80_ubi that referenced this pull request Oct 26, 2025
This ensures mbedtls_config.h is correctly updated and the package rebuilt
accordingly when configuration options are changed after the source is first
prepared.

Signed-off-by: Karsten Sperling <[email protected]>
Link: openwrt#19358
Signed-off-by: Hauke Mehrtens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core packages pull request/issue for core (in-tree) packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.