mirror of
https://github.com/google/nomulus
synced 2026-01-09 15:43:52 +00:00
Use bin_ and genfiles_ directories derived from the ctx, not the configuration
For Bazel (open source Blaze), users can have multiple repositories
and we are moving towards having one bin/genfiles dir per repository.
This means that bin_dir and genfiles_dir need to be rule-specific, not
configuration-specific, since the configuration is not repository-specific.
ctx.configuration.bin_dir and ctx.configuration.genfiles_dir have been
deprecated and now we'd like to remove them entirely.
The new fields are only available in Bazel 0.4.0+.
Tested:
TAP --sample for global presubmit queue
[]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=141791797
This commit is contained in:
@@ -148,7 +148,11 @@ def _zip_file(ctx):
|
||||
'cd "${repo}"',
|
||||
'rm -rf "${tmp}"',
|
||||
]
|
||||
script = ctx.new_file(ctx.configuration.bin_dir, '%s.sh' % ctx.label.name)
|
||||
if hasattr(ctx, 'bin_dir'):
|
||||
script = ctx.new_file(ctx.bin_dir, '%s.sh' % ctx.label.name)
|
||||
else:
|
||||
# TODO(user): remove this once Bazel 4.0+ is required.
|
||||
script = ctx.new_file(ctx.configuration.bin_dir, '%s.sh' % ctx.label.name)
|
||||
ctx.file_action(output=script, content='\n'.join(cmd), executable=True)
|
||||
inputs = [ctx.file._zipper]
|
||||
inputs += [dep.zip_file for dep in ctx.attr.deps]
|
||||
|
||||
Reference in New Issue
Block a user