diff --git a/src/west/main.py b/src/west/main.py index 33445ca..9a23e6e 100755 --- a/src/west/main.py +++ b/src/west/main.py @@ -402,8 +402,14 @@ def set_zephyr_base(args): elif zb_env is not None: zb = zb_env zb_origin = 'env' - if zb_config is not None and \ - os.path.abspath(zb_config) != os.path.abspath(zb_env): + try: + different = (zb_config is not None and + not os.path.samefile(zb_config, zb_env)) + except FileNotFoundError: + different = (zb_config is not None and + (os.path.normpath(os.path.abspath(zb_config)) != + os.path.normpath(os.path.abspath(zb_env)))) + if different: # The environment ZEPHYR_BASE takes precedence over the config # setting, but in normal multi-repo operation we shouldn't # expect to need to set ZEPHYR_BASE.