jsii icon indicating copy to clipboard operation
jsii copied to clipboard

jsii-pacmak returns error in gitpod

Open pahud opened this issue 3 years ago • 9 comments

:bug: Bug Report

I was running jsii/superchain as the docker image for my gitpod environment and the jsii-pacmak is returning the following error:

圖片

Affected Languages

  • [ ] TypeScript or Javascript
  • [x] Python
  • [ ] Java
  • [ ] .NET (C#, F#, ...)

General Information

  • JSII Version: <!-- Output of jsii --version --> 1.14.0 (build 729554b), typescript 3.9.7
  • Platform: Linux ws-cc4c1a72-e44d-4cf0-92bd-673348e2598f 4.14.174+ #1 SMP Fri Sep 4 17:56:58 PDT 2020 x86_64 x86_64 x86_64 GNU/Linux

What is the problem?

Verbose Log

pahud avatar Nov 01 '20 03:11 pahud

Hi @pahud ,

thanks for opening the issue. What exactly were you trying to achieve here? What was the command that failed?

skinny85 avatar Nov 02 '20 21:11 skinny85

Hi @skinny85

I was trying to open a gitpod workspace with my own Dockerfile which is based on jsii/superchain.

Dockerfile https://github.com/pahud/gitpod-workspace/blob/main/.gitpod.Dockerfile

And the gitpod workspace can be opened with no error. I created my awscdk construct lib project with

npx projen new awscdk-construct

And this synthesizes all the dotfiles as well as package.json, which was working great here.

Then I updated the .projenrc.js as the following

const { AwsCdkConstructLibrary } = require('projen');

const project = new AwsCdkConstructLibrary({
  authorAddress: "[email protected]",
  authorName: "Pahud Hsieh",
  cdkVersion: "1.60.0",
  name: "gitpod-workspace",
  repository: "https://github.com/pahud/gitpod-workspace.git",
  python: {
    distName: 'foo-bar',
    module: 'foo_bar',
  }
});

project.synth();

and run npx projen new awscdk-construct to synthesize the dotfiles and package.json as below

{
  "//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\".",
  "name": "gitpod-workspace",
  "repository": {
    "type": "git",
    "url": "https://github.com/pahud/gitpod-workspace.git"
  },
  "bin": {},
  "scripts": {
    "start": "npx projen start -i",
    "projen": "node .projenrc.js",
    "no-changes": "(git log --oneline -1 | grep -q \"chore(release):\") && echo \"No changes to release.\"",
    "bump": "yarn run --silent no-changes || standard-version",
    "release": "yarn run --silent no-changes || (yarn run bump && git push --follow-tags origin master)",
    "projen:upgrade": "yarn upgrade -L projen && CI=\"\" yarn projen",
    "compile": "jsii --silence-warnings=reserved-word --no-fix-peer-dependencies && jsii-docgen",
    "watch": "jsii -w --silence-warnings=reserved-word --no-fix-peer-dependencies",
    "build": "yarn run test && yarn run compile && yarn run package",
    "package": "jsii-pacmak",
    "test": "rm -fr lib/ && jest --passWithNoTests --updateSnapshot && yarn run eslint",
    "test:watch": "jest --watch",
    "test:update": "jest --updateSnapshot",
    "eslint": "eslint --ext .ts --fix src test",
    "compat": "npx jsii-diff npm:$(node -p \"require('./package.json').name\") -k --ignore-file .compatignore || (echo \"\nUNEXPECTED BREAKING CHANGES: add keys such as 'removed:constructs.Node.of' to .compatignore to skip.\n\" && exit 1)",
    "docgen": "jsii-docgen"
  },
  "author": {
    "name": "Pahud Hsieh",
    "email": "[email protected]",
    "organization": false
  },
  "devDependencies": {
    "@aws-cdk/assert": "^1.60.0",
    "@types/jest": "^26.0.7",
    "@types/node": "^10.17.0",
    "@typescript-eslint/eslint-plugin": "^4.3.0",
    "@typescript-eslint/parser": "^4.3.0",
    "eslint": "^7.12.1",
    "eslint-import-resolver-node": "^0.3.4",
    "eslint-import-resolver-typescript": "^2.3.0",
    "eslint-plugin-import": "^2.22.1",
    "jest": "^26.4.2",
    "jsii": "^1.11.0",
    "jsii-diff": "^1.11.0",
    "jsii-docgen": "^1.3.2",
    "jsii-pacmak": "^1.11.0",
    "jsii-release": "^0.1.6",
    "json-schema": "^0.2.5",
    "projen": "^0.3.141",
    "standard-version": "^9.0.0",
    "ts-jest": "^26.1.0",
    "typescript": "^3.9.5"
  },
  "peerDependencies": {
    "constructs": "^3.0.4"
  },
  "dependencies": {},
  "bundledDependencies": [],
  "keywords": [
    "cdk"
  ],
  "engines": {
    "node": ">= 10.17.0"
  },
  "main": "lib/index.js",
  "license": "Apache-2.0",
  "start": {
    "start": {
      "command": "yarn run start",
      "desc": "Shows this menu"
    },
    "projen": {
      "desc": "Synthesize project configuration from .projenrc.js",
      "command": "yarn run projen",
      "category": 3
    },
    "bump": {
      "desc": "Commits a bump to the package version based on conventional commits",
      "command": "yarn run bump",
      "category": 2
    },
    "release": {
      "desc": "Bumps version & push to master",
      "command": "yarn run release",
      "category": 2
    },
    "projen:upgrade": {
      "desc": "upgrades projen to the latest version",
      "command": "yarn run projen:upgrade",
      "category": 3
    },
    "compile": {
      "desc": "Only compile",
      "command": "yarn run compile",
      "category": 0
    },
    "watch": {
      "desc": "Watch & compile in the background",
      "command": "yarn run watch",
      "category": 0
    },
    "build": {
      "desc": "Full release build (test+compile)",
      "command": "yarn run build",
      "category": 0
    },
    "package": {
      "desc": "Create an npm tarball",
      "command": "yarn run package",
      "category": 2
    },
    "test": {
      "desc": "Run tests",
      "command": "yarn run test",
      "category": 1
    },
    "test:watch": {
      "desc": "Run jest in watch mode",
      "command": "yarn run test:watch",
      "category": 1
    },
    "eslint": {
      "desc": "Runs eslint against the codebase",
      "command": "yarn run eslint",
      "category": 1
    },
    "compat": {
      "desc": "Perform API compatibility check against latest version",
      "command": "yarn run compat",
      "category": 2
    },
    "docgen": {
      "desc": "Generate API.md from .jsii manifest",
      "command": "yarn run docgen",
      "category": 2
    }
  },
  "version": "0.0.0",
  "types": "lib/index.d.ts",
  "jest": {
    "clearMocks": true,
    "collectCoverage": true,
    "coveragePathIgnorePatterns": [
      "/node_modules/"
    ],
    "testPathIgnorePatterns": [
      "/node_modules/"
    ],
    "preset": "ts-jest",
    "testMatch": [
      "**/__tests__/**/*.ts?(x)",
      "**/?(*.)+(spec|test).ts?(x)"
    ],
    "globals": {
      "ts-jest": {
        "tsconfig": "tsconfig.jest.json"
      }
    }
  },
  "stability": "stable",
  "jsii": {
    "outdir": "dist",
    "targets": {},
    "tsc": {
      "outDir": "lib",
      "rootDir": "src"
    }
  }
}

When I run yarn build, the jsii-pacmak returns the following error. Looks like gitpod doesn't allow me to run jsii-pacmak

圖片

I really enjoy developing in the gitpod yet have no idea how to fix this. I hope the details above are useful.

thanks!

pahud avatar Nov 03 '20 03:11 pahud

Damn, that's a weird error 😱.

Does it still happen with the latest version of CDK/JSII @pahud ?

skinny85 avatar Dec 05 '20 02:12 skinny85

Damn, that's a weird error 😱.

Does it still happen with the latest version of CDK/JSII @pahud ?

Hi @skinny85

I will check it out and get back to you tonight :-)

pahud avatar Dec 07 '20 03:12 pahud

@skinny85 Unfortunately it still exists in jsii 1.15.0

圖片

I guess this issue is related to gitpod workspace as it works great in Github codespaces.

圖片

pahud avatar Dec 07 '20 06:12 pahud

Thanks @pahud . I'll look into it.

skinny85 avatar Dec 07 '20 17:12 skinny85

@pahud - do you pip install anything under the --user scope (i.e: neither --system wide nor in a virtualenv)?

From what I gather this error might occur because we create venv while setting --system-site-packages so that we don't unnecessarily re-download/install things already installed system-wide... I'm not entirely clear what eventually causes the error however...

RomainMuller avatar Dec 14 '20 13:12 RomainMuller

@RomainMuller

no actually I didn't pip install anything manually. I was trying to develop my cdk construct with projen so I simply npx projen new awscdk-construct, editing the .projenrc.js and run yarn build in gitpod and it returns this error.

However, everything is working great in Github CodeSpaces and my local VSCode on my mac.

I still love Gitpod but I don't know what was happening under the hood.

pahud avatar Dec 17 '20 07:12 pahud

@pahud is this still happening?

skinny85 avatar Apr 08 '22 20:04 skinny85