Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression test for compile data in alternate packages #3193

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

UebelAndre
Copy link
Collaborator

No description provided.

@martingms
Copy link
Contributor

Ah, right. The relativize in utils.bzl actually does the "right thing", so if we s/paths.relativize/relativize/ on utils.bzl:870 you get the "right" path, but then we get Error in declare_file: the output artifact 'test/unit/compile_data/data/data.txt' is not under package directory 'test/unit/compile_data/src' for target '//test/unit/compile_data/src:lib' so I guess symlinking in those cases is not the right approach anyway. I'll look some more.

@martingms
Copy link
Contributor

martingms commented Jan 22, 2025

#3196 at least makes this build, but it's not enough I guess since the data.txt-file must also be symlinked (to the correct place) to actually be able to use it, which can't be done from that ctx without moving the symlink within the .../src package I guess? Or hm, I might be missing something since #3176 only extended the symlinking to include the compile_data, so how can this have worked before, when generated sources were still symlinked and built in the out tree?

@UebelAndre UebelAndre force-pushed the compile_data branch 2 times, most recently from 5b2ccd5 to 259c07e Compare January 22, 2025 18:39
@UebelAndre UebelAndre mentioned this pull request Jan 22, 2025
@UebelAndre UebelAndre marked this pull request as ready for review January 22, 2025 18:47
@UebelAndre
Copy link
Collaborator Author

how can this have worked before, when generated sources were still symlinked and built in the out tree?

I updated the regression test to show how the data is consumed. This is exactly what how one of my targets was setup. I tend to not rely on relative paths for include_str.

@UebelAndre UebelAndre enabled auto-merge January 22, 2025 18:48
@martingms
Copy link
Contributor

Cool, glad the patch worked 👍

@UebelAndre UebelAndre added this pull request to the merge queue Jan 22, 2025
Merged via the queue into bazelbuild:main with commit db23970 Jan 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants