Skip to content

Commit

Permalink
temporary logs
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Horodniceanu <[email protected]>
  • Loading branch information
the-horo committed Aug 20, 2024
1 parent 8b67cae commit 4406649
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mesonbuild/dependencies/dub.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ def get_build_command() -> T.List[str]:
helper_build = join_args(get_build_command())
source = DubDescriptionSource.Local
ret, res, err = self._call_dubbin(describe_cmd)
mlog.log("Plain description:")
mlog.log(res)
if ret == 0:
return (json.loads(res), helper_build, source)

Expand All @@ -366,6 +368,8 @@ def get_build_command() -> T.List[str]:
helper_build = join_args(get_build_command() + [pack_spec])
source = DubDescriptionSource.External
ret, res, err = self._call_dubbin(describe_cmd)
mlog.log("Direct description:")
mlog.log(res)
if ret == 0:
return (json.loads(res), helper_build, source)

Expand All @@ -383,6 +387,14 @@ def _find_target_in_cache(self, desc: DubDescription, pkg_desc: DubPackDesc,
tgt_desc: DubTargetDesc, dub_comp_id: str
) -> T.Tuple[T.Optional[str], T.Set[str]]:
mlog.debug('Searching in DUB cache for compatible', pkg_desc['targetFileName'])
mlog.log('Description:')
mlog.log(desc)
mlog.log('pkg_desc:')
mlog.log(pkg_desc)
mlog.log('tgt_desc:')
mlog.log(tgt_desc)
mlog.log('comp_id:')
mlog.log(dub_comp_id)

# recent DUB versions include a direct path to a compatible cached artifact
if self._use_cache_describe:
Expand Down Expand Up @@ -499,6 +511,7 @@ def _get_comp_versions_to_find(self, dub_comp_id: str) -> T.List[str]:

def _call_dubbin(self, args: T.List[str], env: T.Optional[T.Dict[str, str]] = None) -> T.Tuple[int, str, str]:
assert isinstance(self.dubbin, ExternalProgram)
mlog.log("Calling:", self.dubbin.get_command() + args, 'in', self.env.get_source_dir())
p, out, err = Popen_safe(self.dubbin.get_command() + args, env=env, cwd=self.env.get_source_dir())
return p.returncode, out.strip(), err.strip()

Expand Down
4 changes: 4 additions & 0 deletions test cases/d/17 dub and meson project/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ if not dub_ver.version_compare('>=1.35.0')
error('MESON_SKIP_TEST: test requires dub >=1.35.0')
endif

message('Build targets')
run_command('bash', '-c', 'ls -R ~/.dub/cache', check: true)
run_command('bash', '-c', 'find ~/.dub/cache -name db.json -print -execdir cat {} \;', check: true)

# Multiple versions supported
urld = dependency('urld', method: 'dub', version: [ '>=3.0.0', '<3.0.1' ])

Expand Down

0 comments on commit 4406649

Please sign in to comment.