depot: remove bin/<arch>/<api-version> subdir

Fixes #2459
This commit is contained in:
Norman Feske 2017-07-04 14:08:51 +02:00 committed by Christian Helmuth
parent a4b543bc80
commit 3e95a42fae
5 changed files with 16 additions and 48 deletions

View File

@ -221,7 +221,6 @@ is structured as follows:
! <user>/raw/<name>-<version>/
! <user>/pkg/<name>-<version>/
! <user>/bin/<arch>/<src-name>-<src-version>/
! <user>/bin/<arch>/<api-name>-<api-version>/<src-name>-<src-version>/
The <user> stands for the origin of the contained archives. For example, the
official archives provided by Genode Labs reside in a _genodelabs/_
@ -243,10 +242,7 @@ easily combined.
The actual archives are stored in the subdirectories named after the archive
types ('raw', 'api', 'src', 'bin', 'pkg'). Archives contained in the _bin/_
subdirectories are further subdivided in the various architectures (like
'x86_64', or 'arm_v7'). Note that for binaries created for source archives
that implement an API (libraries), there exists a further nesting level with
API version. Therefore, multiple library implementations (or versions) that
implement the same API are located in the same API subdirectory.
'x86_64', or 'arm_v7').
Depot management
@ -331,12 +327,10 @@ Note that the command expects a specific version of the source archive as
argument. The depot may contain several versions. So the user has to decide,
which one to build.
After the tool is finished, the freshly built binary archive can be found in the
depot within the _genodelabs/bin/_ subdirectory. If the source archive
implements an API (if it is a library), the result is stored at
_bin/<arch>/<api>-<version>/<src>-<version>/_. Otherwise, the result is stored
at _bin/<arch>/<src>-<version>/_. Only the final result of the built process
is preserved. In the example above, that would be the _zlib.lib.so_ library.
After the tool is finished, the freshly built binary archive can be found in
the depot within the _genodelabs/bin/<arch>/<src>-<version>/_ subdirectory.
Only the final result of the built process is preserved. In the example above,
that would be the _zlib.lib.so_ library.
For debugging purposes, it might be interesting to inspect the intermediate
state of the build. This is possible by adding 'KEEP_BUILD_DIR=1' as argument

View File

@ -94,9 +94,8 @@ endif
#
# determine binary-archive path within the depot
_api_subdir = $(addsuffix /,$(call file_content,$(call api_file,$(call src_of_bin,$1))))
_dst_bin_spec_path = $(call archive_user,$1)/bin/$(call bin_archive_spec,$1)/
dst_archive_path = $(call _dst_bin_spec_path,$1)$(call _api_subdir,$1)$(call bin_archive_recipe,$1)
dst_archive_path = $(call _dst_bin_spec_path,$1)$(call bin_archive_recipe,$1)
BUILD_MK_FILE := $(DEPOT_DIR)/var/build.mk

View File

@ -102,20 +102,10 @@ endif
#
# Look for src/api to determine whether to build a library or a target.
# If building a library, concatenate archive dir as <apihash>/<srchash>.
# Otherwise use <srchash> has archive dir.
# Define build-directory location
#
API_FILE := $(wildcard $(addsuffix /api,$(SRC_DIR)))
ifneq ($(API_FILE),)
API := $(call file_content,$(API_FILE))
DEPOT_ARCHIVE_DIR := $(DEPOT_BIN_DIR)/$(SPEC)/$(API)/$(VERSIONED_ARCHIVE)
else
DEPOT_ARCHIVE_DIR := $(DEPOT_BIN_DIR)/$(SPEC)/$(VERSIONED_ARCHIVE)
endif
DEPOT_ARCHIVE_DIR := $(DEPOT_BIN_DIR)/$(SPEC)/$(VERSIONED_ARCHIVE)
DEPOT_ARCHIVE_BUILD_DIR := $(addsuffix .build,$(DEPOT_ARCHIVE_DIR))
@ -128,7 +118,10 @@ DEPOT_ARCHIVE_BUILD_DIR := $(addsuffix .build,$(DEPOT_ARCHIVE_DIR))
#
# if building a library, always incorporate the API implemented by the library
USED_APIS += $(API)
API_FILE := $(wildcard $(addsuffix /api,$(SRC_DIR)))
ifneq ($(API_FILE),)
USED_APIS += $(call file_content,$(API_FILE))
endif
# incorporate all APIs used by the source archive
USED_APIS_FILE := $(SRC_DIR)/used_apis

View File

@ -60,18 +60,13 @@ ARCHIVES(pkg) := $(sort ${ARCHIVES(pkg)} $(foreach P,${ARCHIVES(binpkg)},\
# Extend ARCHIVES(bin) with binary-package dependencies
#
_lib_api = $(call file_content,$(call api_file,$1))
# return binary-archive path for user ($1), architecture ($2), api ($3), and recipe ($4)
_bin_for_src_api = $(if $3,$1/bin/$2/$3/$4,$1/bin/$2/$4)
# return non-empty result if source archive exists
_src_exists = $(wildcard $(dir $(call used_apis_file,$1)))
# return binary-archive path for architecture $1 and source archive $2
_bin_for_src = $(strip \
$(if $(call _src_exists,$2),\
$(call _bin_for_src_api,$(call archive_user,$2),$1,$(call _lib_api,$2),$(call archive_recipe,$2))))
$(call archive_user,$2)/bin/$1/$(call archive_recipe,$2)))
# return list of binary archives contained in a binary package
_binpkg_bin_archives = $(foreach S,$(call _binpkg_src_archives,$1),\
@ -118,6 +113,8 @@ ARCHIVES(api) := $(sort ${ARCHIVES(api)} $(foreach A,${ARCHIVES(src)},\
# Extend ARCHIVES(api) with the APIs implemented by library ARCHIVES(src)
#
_lib_api = $(call file_content,$(call api_file,$1))
_lib_api_archive = $(addprefix $(call archive_user,$1)/api/,$(call _lib_api,$1))
ARCHIVES(api) := $(sort ${ARCHIVES(api)} $(foreach A,${ARCHIVES(src)},\

View File

@ -91,20 +91,6 @@ proc _import_src_archive_from_depot { user name } {
set bin_archive "$user/bin/[depot_spec]/$name"
#
# If the binary archive contains a library, direct 'bin_archive' to the
# correct API sub directory.
#
set api_file_path "[depot_dir]/$user/src/$name/api"
if {[file exists $api_file_path]} {
set fh [open "$api_file_path" "RDONLY"]
set api [read $fh]
close $fh
regsub -all {\s} $api {} api
if {$api != ""} {
set bin_archive "$user/bin/[depot_spec]/$api/$name" }
}
if {[file exists [depot_dir]/$bin_archive]} {
_copy_directory_content_to_run_dir "[depot_dir]/$bin_archive"
} else {
@ -261,8 +247,7 @@ proc check_for_missing_depot_archives { } {
} else {
lappend foreign_archives $archive
}
} elseif {[regexp [_depot_lib_archive_path_pattern] $archive dummy user spec name]
|| [regexp [_depot_bin_archive_path_pattern] $archive dummy user spec name]} {
} elseif {[regexp [_depot_bin_archive_path_pattern] $archive dummy user spec name]} {
# source code is present in the current source tree
set recipe [_locally_available_recipe $user src $name]