Skip to content

Commit

Permalink
Check the size of build_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Karetnikov authored and nkaretnikov committed Nov 5, 2023
1 parent 90f22ee commit 98e78c8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions conda-store-server/conda_store_server/orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,22 @@ def build_path(self, conda_store):
"""
store_directory = os.path.abspath(conda_store.store_directory)
namespace = self.environment.namespace.name
name = self.specification.name
return (
res = (
pathlib.Path(
conda_store.build_directory.format(
store_directory=store_directory, namespace=namespace, name=name
store_directory=store_directory,
namespace=namespace,
)
)
/ self.build_key
)
# conda prefix must be less or equal to 255 chars
# https://github.com/conda-incubator/conda-store/issues/649
if len(res) > 255:
raise ValueError(
f"build_path too long: {res} must be <= 255 chars, got {len(res)}"
)
return res

def environment_path(self, conda_store):
"""Environment path is the path for the symlink to the build
Expand Down

0 comments on commit 98e78c8

Please sign in to comment.