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

Copy over runfiles library from Bazel #263

Closed
wants to merge 5 commits into from
Closed

Conversation

fmeum
Copy link
Contributor

@fmeum fmeum commented Oct 31, 2024

The runfiles library can be maintained independently of Bazel releases and bazel_tools can refer to it via an alias.

@fmeum
Copy link
Contributor Author

fmeum commented Oct 31, 2024

@comius We could do this in time for Bazel 8, sorry for noticing so late.

The runfiles library can be maintained independently of Bazel releases and bazel_tools can refer to it via an alias.
@fmeum
Copy link
Contributor Author

fmeum commented Oct 31, 2024

CI failure looks unrelated.

actual = "@bazel_tools//tools/cpp/runfiles",
srcs = ["runfiles.cc"],
hdrs = ["runfiles.h"],
# Ensure that this header can be included from the same directory as the
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we could force users to use a new include path for the header when switching to this target and reexport it under the old path in bazel_tools.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be a bit better. Single migration instead of 2 and it's hard to motivate the second migration.

Also setup is much simpler without include_prefixes, C++ rules don't need to create any symlinks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The natural prefix would be cc/runfiles, which I think may be too short. Making it rules_cc/cc/runfiles would require a symlink. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I also change the namespace to something like rules_cc::runfiles?

actual = "@bazel_tools//tools/cpp/runfiles",
srcs = ["runfiles.cc"],
hdrs = ["runfiles.h"],
# Ensure that this header can be included from the same directory as the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that would be a bit better. Single migration instead of 2 and it's hard to motivate the second migration.

Also setup is much simpler without include_prefixes, C++ rules don't need to create any symlinks.

@fmeum fmeum force-pushed the runfiles branch 2 times, most recently from 51ce5f4 to babc8cf Compare November 5, 2024 14:06
@fmeum
Copy link
Contributor Author

fmeum commented Nov 5, 2024

@comius CI is green

comius
comius previously approved these changes Nov 5, 2024
.bazelrc Show resolved Hide resolved
@fmeum fmeum requested a review from comius November 5, 2024 15:47
@comius
Copy link
Collaborator

comius commented Nov 6, 2024

Hey, this PR needs a very sophisticated import. It will take some time. I'll do a 0.0.14 release before importing it.

copybara-service bot pushed a commit that referenced this pull request Nov 19, 2024
BEGIN_PUBLIC
Copybara import of the project:

--
82e44f3 by Fabian Meumertzheim <fabian@meumertzhe.im>:

Copy over runfiles library from Bazel

The runfiles library can be maintained independently of Bazel releases and bazel_tools can refer to it via an alias.

--
885d333 by Fabian Meumertzheim <fabian@meumertzhe.im>:

Switch to new include path and namespace

--
b8cd815 by Fabian Meumertzheim <fabian@meumertzhe.im>:

Fix CI

--
41b7d48 by Fabian Meumertzheim <fabian@meumertzhe.im>:

Silence warnings

--
b97a30e by Fabian Meumertzheim <fabian@meumertzhe.im>:

Remove per_file_copt

END_PUBLIC

PiperOrigin-RevId: 697942902
Change-Id: I10a6c9baf0464722fca026db99cf572acfd159f1
@comius
Copy link
Collaborator

comius commented Nov 19, 2024

Merged

@comius comius closed this Nov 19, 2024
@fmeum fmeum deleted the runfiles branch November 19, 2024 11:33
@fmeum
Copy link
Contributor Author

fmeum commented Nov 19, 2024

@comius Thanks for making the import work!

Could you cut a release? Then I can finalize the removal of runfiles libraries from Bazel.

@comius
Copy link
Collaborator

comius commented Nov 19, 2024

@comius Thanks for making the import work!

Could you cut a release? Then I can finalize the removal of runfiles libraries from Bazel.

Done. 0.0.17

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.

2 participants