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

Installation Issues #6

Closed
ArquintL opened this issue Sep 14, 2020 · 7 comments
Closed

Installation Issues #6

ArquintL opened this issue Sep 14, 2020 · 7 comments

Comments

@ArquintL
Copy link
Member

Having "vs-verification-toolbox": "github:viperproject/vs-verification-toolbox#master" as a devDependency works on my local machine (macOS; node v14.10.1; npm 6.14.8). This means, that vs-verification-toolbox is compiled as part of npm install resp. npm ci (i.e. the prepare step is triggered).

However, I observed a (consistently) different behavior in my docker container (gobraverifier/gobra-ide-base:v1) running Ubuntu 20.04 (node v10.19.0; npm 6.14.4). This repo's content is downloaded but compilation is not triggered. In particular, the out folder is missing. As a quick fix, I perform now cd node_modules/vs-verification-toolbox; npm install; npm run compile; to manually compile this library after downloading it.
I first thought it might be related to the missing files property in package.json, but adding the out folder seemed to make things worse.

@fpoli
Copy link
Member

fpoli commented Sep 15, 2020

The problem seems to be this one: https://stackoverflow.com/questions/51078974/how-to-have-npm-install-a-typescript-dependency-from-a-github-url

Some solutions:
a) Make the user automatically compile the toolbox using this suggestion. This requires all users to have typescript installed.
b) Always compile and push the generated .js files to Github.
c) Manually compile the dependency, as you are doing.

If it works, I would prefer solution (a).

@ArquintL
Copy link
Member Author

I think solution a) is already implemented in the repo (there's a prepare step compiling vs-verification-toolbox. The strange thing however is that it works on my local machine but not in the docker image

@fpoli
Copy link
Member

fpoli commented Sep 15, 2020

Could you try if the prepack works, in place of the prepare? The latter might be available only from npm v5.0.0.

@fpoli
Copy link
Member

fpoli commented Sep 15, 2020

Also, could you check if npm's ignore-scripts configuration flag is set to true in your docker image?

@ArquintL
Copy link
Member Author

I've now created a non-root user for my docker image and let it run the commands. The same issue occurs when using npm ci but npm install will correctly compile vs-verification-toolbox as specified in prepare. This is possibly related to this issue: npm/cli#1287

I'll try the suggestions later this week and correspondingly update this issue

@ArquintL ArquintL self-assigned this Sep 15, 2020
@juliand665
Copy link
Contributor

I'd also be curious if "vs-verification-toolbox": "https://github.com/viperproject/vs-verification-toolbox.git" works; that's the form I've been using in Prusti Assistant since none of the others seemed to work.

@ArquintL
Copy link
Member Author

Docker using non-root user

"vs-verification-toolbox": "https://github.com/viperproject/vs-verification-toolbox.git" fixes the issue for npm install as well as npm ci.
another try with "vs-verification-toolbox": "github:viperproject/vs-verification-toolbox#master" seemed to work in both cases as well.

Docker using root user

prepare does not seem to be executed neither with npm install nor npm ci, neither with "vs-verification-toolbox": "github:viperproject/vs-verification-toolbox#master" nor "vs-verification-toolbox": "https://github.com/viperproject/vs-verification-toolbox.git"

Conclusions

It seems to only depend on the root / non-root docker user. @juliand665 I did not observe any problems using different URL schemes, even "vs-verification-toolbox": "git://github.com/viperproject/vs-verification-toolbox.git" works on my end.

I've found out that vscode needs root access to install an extension for testing. Therefore, I run npm test as root but npm ci as a non-root user. In addition, I'm using now "vs-verification-toolbox": "git://github.com/viperproject/vs-verification-toolbox" (as this URL schema is one of the specified ones in the documentation)

@ArquintL ArquintL removed their assignment Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants