Add log files into the cache tar for improved debugging (#18026)
### Why I did it Cache currently does not save the log of the deb. But it's useful to have the log to understand any cache related problems. ### How I did it #### How to verify it ``` vkarri@s-build-sonic-01:/sonic-buildimage$ tar -tvf /sonic/sonic_caches/libnl-3-200_3.5.0-1_amd64.deb-adc83b19e793491b1c6ea0f-0ea77d65c49ae3a11dffbca.tgz -rw-r--r-- vkarri/dip 496230 2024-01-12 19:49 target/debs/bookworm/libnl-3-200_3.5.0-1_amd64.deb.log ```
This commit is contained in:
parent
1d57472eb0
commit
6324fe15b6
@ -295,10 +295,12 @@ define SAVE_INTO_CACHE
|
||||
echo "Target $(1) dependencies are modifed - global save cache skipped" >> $($(1)_DST_PATH)/$(1).log
|
||||
$(eval $(1)_CACHE_DIR := $(SONIC_DPKG_LOCAL_CACHE_DIR))
|
||||
)
|
||||
$($(1)_CACHE_USER) tar -C $($(1)_BASE_PATH) -mczvf $($(1)_CACHE_DIR)/$(MOD_CACHE_FILE) $(2) $(addprefix $($(1)_DST_PATH)/,$($(1)_DERIVED_DEBS) $($(1)_EXTRA_DEBS) ) \
|
||||
cp $($(1)_DST_PATH)/$(1).log $($(1)_DST_PATH)/$(1).cached.log
|
||||
$($(1)_CACHE_USER) tar -C $($(1)_BASE_PATH) -mczvf $($(1)_CACHE_DIR)/$(MOD_CACHE_FILE) $(2) $(addprefix $($(1)_DST_PATH)/,$($(1)_DERIVED_DEBS) $($(1)_EXTRA_DEBS) $(1).cached.log) \
|
||||
1>>$($(1)_DST_PATH)/$(1).log
|
||||
sudo chmod 777 $($(1)_CACHE_DIR)/$(MOD_CACHE_FILE)
|
||||
|
||||
rm -f $($(1)_DST_PATH)/$(1).cached.log
|
||||
|
||||
echo "File $($(1)_CACHE_DIR)/$(MOD_CACHE_FILE) saved in cache " >> $($(1)_DST_PATH)/$(1).log
|
||||
echo "[ CACHE::SAVED ] $($(1)_CACHE_DIR)/$(MOD_CACHE_FILE)" >> $($(1)_DST_PATH)/$(1).log
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user