-
Notifications
You must be signed in to change notification settings - Fork 99
Description
@chrispsommers hey, i have been playing with building dash repo for couple days, and i noticed that there are a lot of chmod -R a+w or o+w in many directories, mainly in SAI directory, which touches each file, and because of that, make file is rebuilding the same stuff over and over again when it don't need to, and it's really annoying at this point since for example during make all, SAI metadata and libsai is rebuild 3 times, which takes a lot of time and is pointless, i tried to fix it but it's all over the place and current build files and thrift makefiles are complex, that im worried that i will break something here
can we start to fix it ? why chmod wad done in the first place ? it's because docker container user is dash and have no permissions to write user host file when dash repo is located and build? maybe it would be easier to add local host user to bmv2 docker and set it as default user when running docker, then it would have permissions to write those files and chmod would not be needed at all
for example i see this:
9715951 4 -rw-rw-r-- 1 kcudnik kcudnik 1914 sie 27 12:59 ./Makefile.3rdpty
9715950 28 -rw-rw-r-- 1 kcudnik kcudnik 25305 sie 27 12:59 ./Makefile
...
9719459 712 -rw-r--r-- 1 4321 4321 725020 sie 27 13:27 ./SAI/SAI/test/saithriftv2/sai_headers.py.bk
9717973 12 -rw-r--r-- 1 4321 4321 11504 sie 27 13:36 ./SAI/SAI/experimental/saiexperimentaldashtag.h
...
9717986 12 -rw-r--r-- 1 4321 4321 12011 sie 27 13:36 ./SAI/lib/utils.h
9717984 4 -rw-r--r-- 1 4321 4321 2901 sie 27 13:36 ./SAI/lib/Makefile
9717969 40 -rw-r--r-- 1 4321 4321 39629 sie 27 13:00 ./bmv2/dash_pipeline.bmv2/dash_pipeline_p4rt.json
9717971 536 -rw-r--r-- 1 4321 4321 548597 sie 27 13:00 ./bmv2/dash_pipeline.bmv2/dash_pipeline.json
9717968 76 -rw-r--r-- 1 4321 4321 75937 sie 27 13:00 ./bmv2/dash_pipeline.bmv2/dash_pipeline.p4i
9717970 36 -rw-r--r-- 1 4321 4321 34680 sie 27 13:00 ./bmv2/dash_pipeline.bmv2/dash_pipeline_p4rt.txt
9719506 256 -rwxr-xr-x 1 4321 4321 258728 sie 27 13:30 ./tests/libsai/vnet_out/vnet_out
9719507 972 -rwxr-xr-x 1 4321 4321 993096 sie 27 13:30 ./tests/libsai/init_switch/init_switch
so suddenly next to my local user, there is dash user 4321 in docker, and there are issues with writings files, that's why chmod
some of the changes for chmod comes from this PR #202