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

Offline builds #359

Closed
davidsiefert opened this issue Jun 19, 2015 · 11 comments
Closed

Offline builds #359

davidsiefert opened this issue Jun 19, 2015 · 11 comments

Comments

@davidsiefert
Copy link

Would it be possible to support offline builds where stack commands just rely on cached downloads? I cannot do any builds while I'm traveling to/from work. 😭 🐼

@bitemyapp
Copy link
Contributor

Think we had a ticket before to this effect.

#316 and
#297

--dry-run and --prefetch I think.

Let us know if this solves your problem for you.

@snoyberg snoyberg added this to the 0.2.0.0 milestone Jun 21, 2015
@gregwebs
Copy link
Contributor

I am trying to cache my dependencies for a continuous integration build. So I tried using --dry-run and --prefetch, but that is not quite what I wanted: I would like to install the dependencies. So the behavior I really want is the same as cabal install --only-dep --enable-tests.

Would it make sense to have a stack test --dry-run --install-deps command?

A somewhat related note is that --prefetch does not seem useful without --dry-run, but this is not enforced.
So one option would be for the behavior of --prefetch to be download and install, but when --dry-run is given it only downloads.

Another option would be to dedicate a separate top-level command: stack install-deps. By default, I usually want to install test dependencies, so it would need a flag to indicate that test dependencies should not be installed.

@snoyberg
Copy link
Contributor

Did you see the --only-snapshot flag?

@gregwebs
Copy link
Contributor

yes, that is what I was looking for! I can confirm that --dry-run --prefetch builds from cached downloads

@davidsiefert
Copy link
Author

The --dry-run --prefetch also worked for me. However, I'm wondering would it be possible to create a new project offline as well?

@snoyberg
Copy link
Contributor

How would stack be able to know which build plan and packages to download in advance in that case?

@davidsiefert
Copy link
Author

I'm wondering if things could be cached from other prior builds at a higher level. For example, my prior project build has a certain set of dependencies that were downloaded, so if my new project has a subset of those dependencies then what would prevent me from using those artifacts? If stack is running 'offline', look in the local project cache, if nothing there, goto the next level cache (a user-level cache?), and if missing information then fail.

Doing some experimenting, if I create an empty cabal file (contents of: "") it already goes to the internet to get snapshots.json.... Let me try to prototype what I'm talking about and see what points it fails miserably. 😄

@snoyberg
Copy link
Contributor

It's only snapshots.json that gets downloaded each time, since that information is temporal. Packages and indices are cached and shared among projects already.

@borsboom
Copy link
Contributor

Potential approach: #3813

@neerajb1
Copy link

Hi All,

I am very new on ducling using stack. I had installed duckling on windows but don't know to run . Anyone knows how to run it. I am very new to it. Could you please let me know how to run ducling as local host

Thanks in advance

@bitemyapp
Copy link
Contributor

@neerajb1 this is the repository for Stack the build tool, not the Duckling project. We can't tell you how to run Duckling, you'll need to ask them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants