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

Error: no postscript file: rerun with the vcpkg shell function rather than executable when running vcpkg activate #40609

Open
Vitorbnc opened this issue Aug 23, 2024 · 10 comments
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@Vitorbnc
Copy link

Vitorbnc commented Aug 23, 2024

Describe the bug
After installing vcpkg and adding its folder to Path, I tried to run vcpkg activate inside a folder containing the vcpkg-configuraration.json shown below, but it fails to complete with the following message:

error: no postscript file: rerun with the vcpkg shell function rather than executable

Environment

  • OS: Windows 10 x64
  • Compiler: -

To Reproduce
Steps to reproduce the behavior:

  1. Install vcpkg
  2. Go to folder with vcpkg-configuraration.json
  3. Run vcpkg activate
  4. See error

Expected behavior
Expected activation to succeed.

Failure logs

warning: vcpkg-artifacts is experimental and may change at any time.
Artifact                            Version Status    Dependency Summary
arm:tools/kitware/cmake 3.28.4  installed            Kitware's cmake tool
arm:tools/ninja-build/ninja 1.12.0  installed            Ninja Build
arm:compilers/arm/armclang 6.22.0  installed            Arm Compiler for Embedded
arm:compilers/arm/arm-none-eabi-gcc 13.3.1  installed            GCC compiler for ARM CPUs
arm:compilers/arm/llvm-embedded 17.0.1  installed            LLVM Embedded Toolchain for Arm CPUs

arm:compilers/arm/arm-none-eabi-gcc - EULA: https://developer.arm.com/GetEula?Id=d023c29f-8e81-49b0-979f-a5610ea2ccbb
error: no postscript file: rerun with the vcpkg shell function rather than executable

Additional context

vcpkg-configuration.json:

{
  "registries": [
    {
      "name": "arm",
      "kind": "artifact",
      "location": "https://artifacts.tools.arm.com/vcpkg-registry"
    }
  ],
  "requires": {
    "arm:tools/kitware/cmake": "^3.25.2",
    "arm:tools/ninja-build/ninja": "^1.10.2",
    "arm:compilers/arm/armclang":"^6.20.0",
    "arm:compilers/arm/arm-none-eabi-gcc": "^13.2.1",
    "arm:compilers/arm/llvm-embedded": "^17.0.1-0"
  }
}
@FrankXie05
Copy link
Contributor

Repo on x64-windows:
image

@Vitorbnc cc @BillyONeal Could you plase help look into this issue?

@FrankXie05 FrankXie05 added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Aug 26, 2024
@moritzstoetter
Copy link

I just ran into the same issue on Linux arm64.

Interestingly also while trying to fetch the artifact arm:compilers/arm/arm-none-eabi-gcc 13.3.1

@BillyONeal
Copy link
Member

BillyONeal commented Aug 26, 2024

vcpkg.exe / vcpkg (the binary) can't touch environment variables in the enclosing console, only the shell function can do that. People got very very confused about "vcpkg the shell function" not being the same thing as vcpkg.exe or ./vcpkg, so we recently renamed it to vcpkg-shell: microsoft/vcpkg-tool#1442

We also changed the error message to explain that better.

@Vitorbnc
Copy link
Author

Vitorbnc commented Aug 27, 2024

@BillyONeal I couldn't find any vcpkg-shell in the vcpkg install dir and calling vcpkg-shell does not seem to work. How do you use it?
image

@moritzstoetter
Copy link

moritzstoetter commented Aug 27, 2024

@BillyONeal Are you saying that following the official installation instructions here puts you into a position, where a subsequent call to vcpkg activate fails?

If so I am not surprised that "people got very confused".

@Vitorbnc
Copy link
Author

Vitorbnc commented Aug 27, 2024

@moritzstoetter I just double checked.

  • Ran Steps [1-3] from the official instructions,
  • Copy/pasted the vcpkg-configuration.json shown above.
  • Called vcpkg activate, got the following output:

image

@Vitorbnc
Copy link
Author

@FrankXie05 @BillyONeal any updates on this?

@BillyONeal
Copy link
Member

@BillyONeal I couldn't find any vcpkg-shell in the vcpkg install dir and calling vcpkg-shell does not seem to work. How do you use it?

It only works using one of the 'installed' copies of vcpkg, like the one that comes with Visual Studio or the 'one liner' installer.

@rebolloluis
Copy link

rebolloluis commented Sep 23, 2024

Hello, I have the same problem. Is there a plan to fix this on the latest version of vcpkg on Github? or should we resignate to use the one-liner iex (iwr -useb https://aka.ms/vcpkg-init.ps1) still even though it's "not recommended for CI systems"? this on Windows 10 x64 host.

My use case is trying the below command so that it works on both local or CI build systems:

vcpkg activate

With this in a vcpkg-configuration.json on the same path:

{
 "registries": [
  {
   "name": "arm",
   "kind": "artifact",
   "location": "https://artifacts.tools.arm.com/vcpkg-registry"
  }
 ],
 "requires": {
  "arm:tools/open-cmsis-pack/cmsis-toolbox": "2.4.0",
  "arm:tools/kitware/cmake": "3.28.4",
  "arm:tools/ninja-build/ninja": "1.12.0",
  "arm:compilers/arm/armclang": "6.22.0",
  "arm:compilers/arm/arm-none-eabi-gcc": "^13.2.1",
  "arm:models/arm/avh-fvp": "^11.26.11",
  "arm:debuggers/arm/armdbg": "6.1.2"
 }
}

Thanks!

@BillyONeal
Copy link
Member

BillyONeal commented Sep 24, 2024

@BillyONeal Are you saying that following the official installation instructions here puts you into a position, where a subsequent call to vcpkg activate fails?

If so I am not surprised that "people got very confused".

One of the reasons the entire artifacts feature remains experimental is that it is not practically usable from the "git clone" distribution of vcpkg. The official instructions are written for people not using artifacts because that remains 99.99% of vcpkg's user base, and the 'installed' copies don't work with classic mode.

Is there a plan to fix this on the latest version of vcpkg on Github?

I'm confirming an answer with our PM folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

No branches or pull requests

5 participants