Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directory by pac pcf push in codespace and devcontainer #573

Closed
Hjaf opened this issue Jun 30, 2023 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@Hjaf
Copy link

Hjaf commented Jun 30, 2023

Dockerfile (image):

ARG VARIANT=16-bullseye
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:${VARIANT}

(Note that the same happens using a very different alpine based image)

Error:

$ pac pcf push -pp eds
Connected to... Component Dev
Connected as [email protected]
Using full update.
Creating a temporary solution wrapper to push the component.
[ERROR] An error occurred trying to start process '/home/node/.vscode-server/data/User/globalStorage/microsoft-isvexptools.powerplatform-vscode/pac/.store/microsoft.powerapps.cli.tool/1.24.3/microsoft.powerapps.cli.tool/1.24.3/tools/net6.0/any/pac' with working directory '/workspaces/EDSPowerPlatform/components/Button/obj/PowerAppsTools_eds'. No such file or directory
Microsoft PowerPlatform CLI
Version: 1.24.3+g95fc6ea

Error: Creating temporary solution wrapper: failed, see the logs for more details.

pac pcf push appears to be using a different path for its operations:
/home/node/.vscode-server/data/User/globalStorage/microsoft-isvexptools.powerplatform-vscode/pac/.store/microsoft.powerapps.cli.tool/1.24.3/microsoft.powerapps.cli.tool/1.24.3/tools/net6.0/any/pac

The extension-installed pac location:

 $ whereis pac
pac: /home/node/.vscode-server/data/User/globalStorage/microsoft-isvexptools.powerplatform-vscode/pac/pac

.store/microsoft.powerapps.cli.tool/1.24.3/microsoft.powerapps.cli.tool/1.24.3/tools/net6.0/any/pac is added to the path instead of the pac executable installed there. The path it tries to use is a containing all but the pac executable.

My somewhat hacky workaround is to run this script that creates a symbolic link at this location, but not before vscode has installed the extension and pac is ready to be used.

#!/bin/bash 
# Workaround for some issues with pac pcf in devcontainers
# NOTE: wait until vscode signals the successful install of the Power Platform Tools with CLI before running this.
pacversion=$(pac | grep Version | awk -F '[:+]' '{print $2}' | awk '{$1=$1; print}')
pac_pcf_path="/home/node/.vscode-server/data/User/globalStorage/microsoft-isvexptools.powerplatform-vscode/pac/.store/microsoft.powerapps.cli.tool/"$pacversion"/microsoft.powerapps.cli.tool/"$pacversion"/tools/net6.0/any"
pac_extension_path=$(whereis pac | awk '{print $2}')
ln -s $pac_extension_path $pac_pcf_path/pac

Any better way to solve this?

It is possible this is an issue with the pac tool and not the extension, but I figured this would be the best place to start if this is due to some misconfiguration I've made.

@petrochuk
Copy link
Contributor

Thank you for reporting. This issue will be fixed in next version of pac cli.

@petrochuk petrochuk added the bug Something isn't working label Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants