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

The build process is painful and broken #126

Closed
wwoods opened this issue Nov 24, 2020 · 8 comments
Closed

The build process is painful and broken #126

wwoods opened this issue Nov 24, 2020 · 8 comments

Comments

@wwoods
Copy link

wwoods commented Nov 24, 2020

Basically, this boils down to an argument against git submodules. Currently, the user must issue multiple git submodule update --init calls, and cd to several obscure (to the user) directories. It seems that git subtree would be a far, far better solution, and would allow all of the complicated cabal/git-related bits in the README to disappear. That is, a user would only need to install argo with the pip install -e line, and then the system/cabal would take care of the rest with subtrees when argo first tries to launch exe:saw-remote-api.

With the current setup, the line in the README with pushd and popd is particularly nefarious, because it's easy to skim over the second cd command, and then the user gets very unintuitive errors relating to abcBridge when they go to build saw-remote-api.

Also: the root cabal.project for argo should have deps/saw-script added to it, and deps/saw-script needs to be added to this repository. It currently is not linked at all, despite what's indicated in the master branch's README.

@wwoods
Copy link
Author

wwoods commented Nov 24, 2020

To elaborate on the deps/saw-script dependency, the user must currently figure out to run git clone https://github.com/GaloisInc/saw-script deps/saw-script when building the project. Also, once argo is built, it fails to run any of the examples because cabal cannot find exe:saw-remote-api.

@wwoods
Copy link
Author

wwoods commented Nov 24, 2020

Furthermore, running e.g. examples/swap.py even after building argo fails on cabal v2-run exe:saw-remote-api, seemingly because cabal cannot find the saw-remote-api target from the root argo cabal.project file.

@robdockins
Copy link

This repository is very much in flux right now, as we migrate code from here to various other places where it makes more sense. I believe the correct way to build saw-remote-api right now is from the saw-script repository, but I'm not entirely sure what state that is in.

CF GaloisInc/cryptol#917

@wwoods wwoods changed the title The build process is painful and complicated The build process is painful and broken Nov 24, 2020
@wwoods
Copy link
Author

wwoods commented Nov 25, 2020

That's fair, and I'm sure that my lack of Cabal/Haskell know-how is tainting my experience a bit. However, this issue comes from trying to get started with Argo based on the README, so it's a bit confusing that I can't even get any of the example scripts running, even after fixing a few commands.

@kquick
Copy link
Member

kquick commented Nov 25, 2020

Two possible suggestions:

  1. Using git submodule update --init --recursive (or git clone --recurse-submodules ...) may alleviate some of this pain.
  2. I recommend the pattern (cd somedir; run-something) over pushd somedir; run-something; popd. The first pattern runs the cd and subsequent commands in a subprocess (requested via the ( ... ) syntax) and helps ensure that the final popd isn't missed.

@wwoods
Copy link
Author

wwoods commented Nov 25, 2020

Two possible suggestions:

1. Using `git submodule update --init --recursive` (or `git clone --recurse-submodules ...`) may alleviate some of this pain.

With this repo, a recursive submodule clone is a bit like a zip bomb. Even without that consideration, some part of one of the 40 cloned abcBridge repos fails when running cabal v2-install exe:saw-remote-api with:

[1 of 1] Compiling Main             ( /run/user/1000/cabal-install.-3220/dist-newstyle/tmp/src-3220/abcBridge-0.17.1/dist/setup/setup.hs, /run/user/1000/cabal-install.-3220/dist-newstyle/tmp/src-3220/abcBridge-0.17.1/dist/setup/Main.o )
Linking /run/user/1000/cabal-install.-3220/dist-newstyle/tmp/src-3220/abcBridge-0.17.1/dist/setup/setup ...
Cabal library version: 2.4.0.1
ABC library must be checked out as a submodule or installed in the system (incl).
CallStack (from HasCallStack):
  error, called at /run/user/1000/cabal-install.-3220/dist-newstyle/tmp/src-3220/abcBridge-0.17.1/dist/setup/setup.hs:141:22 in main:Main

Even after a recursive submodule update.

2. I recommend the pattern `(cd somedir; run-something)` over `pushd somedir; run-something; popd`.  The first pattern runs the `cd` and subsequent commands in a subprocess (requested via the `( ... )` syntax) and helps ensure that the final `popd` isn't missed.

The paren syntax is better.

However, the real issues here are A) all of this could be done with just one cabal command if the repo used subtrees instead of submodules, B) the current cabal specification is broken relative to what's actually needed by argo/python, and C) the README doesn't correctly specify the steps required to build argo and run any of the examples.

Bear in mind, since the deps/saw-script repo wasn't properly pinned as a submodule/tree, it could also be that the README was written for a different version of the saw-script repo than the current master. We'll never know. Because it wasn't pinned.

@kquick
Copy link
Member

kquick commented Nov 25, 2020

My bad on the recursive submodule suggestion: I wasn't paying enough attention to what the submodule target was, sorry about that! I wish there was a way to target/constrain the recursion, and/or specify a depth.

@david-christiansen
Copy link
Contributor

This is not actually the right repository to be building things in. I've just submitted a PR that should at least remove the blatant inaccuracies from the README. (see also GaloisInc/cryptol#988 for a related update)

@wwoods wwoods closed this as completed Dec 1, 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

4 participants