-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
fix(write_source_files): fix nested directories #65
Changes from 10 commits
ae9843a
2bb9fd6
09821fa
6cd2590
e1ff6c4
4ff4eb9
c9e80dc
c1276e2
d3ad08b
97aabaf
e6fc9d0
057a7ca
d10b838
ed302dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
bazel run //lib/tests/write_source_files:write_subdir | ||
[ -e lib/tests/write_source_files/subdir_test/a/b/c/test.txt ] | ||
|
||
bazel run //lib/tests/write_source_files:write_subdir | ||
[ -e lib/tests/write_source_files/subdir_test/a/b/c/test.txt ] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,11 +164,12 @@ echo "Copying $in to $out in $PWD" | |
|
||
if [[ -f "$in" ]]; then | ||
cp -f "$in" "$out" | ||
chmod 664 "$out" | ||
chmod +w "$out" | ||
else | ||
rm -Rf "$out"/* | ||
mkdir -p "$out" | ||
cp -fR "$in"/* "$out" | ||
chmod 664 "$out"/* | ||
cp -fRL "$in"/* "$out" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think capital There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If bazel creates a directory with symlinks to other locations we don't want to just copy the links but copy the content they point to. Otherwise we end up with symlinks into the sandbox copied into the source dir... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rules_nodejs When writing that package into the source dir we want to copy the real files and not the symlinks... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -R is the correct one with consistent meaning on both platforms. It is the lowercase |
||
chmod -R +w "$out"/* | ||
fi | ||
""".format(in_path = in_path, out_path = out_path)) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dist.js | ||
dist.js | ||
subdir_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these only add write permission for the current user. Should it be for all? Seems like bazel normally does
-r-xr-xr-x
(makes all 3 the same). Should we do similar and addw
for all?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User and group is probably safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done