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

Allow building from release archive #1131

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rolisv
Copy link

@rolisv rolisv commented Dec 2, 2020

Add support for RELEASE_ARCHIVE_VERSION environment variable to build.sc.
If RELEASE_ARCHIVE_VERSION is set, it assumes, that build is performed from the
release source archive and does not invoke git command, which otherwise would result
in fatal: not a git repository error.
RELEASE_ARCHIVE_VERSION should be set to the source archive version, e.g:

$ RELEASE_ARCHIVE_VERSION=2.3.8 mill -i amm[2.13.3].assembly

Addresses issue #1130

Rolandas Valteris added 2 commits December 2, 2020 02:31
Add support for `RELEASE_ARCHIVE_VERSION` environment variable to `build.sc`.
If `RELEASE_ARCHIVE_VERSION` is set, it assumes, that build is performed from the
release source archive and does not invoke `git` command, which otherwise would result
in `fatal: not a git repository` error.
`RELEASE_ARCHIVE_VERSION` should be set to the source archive version, e.g:
```
$ RELEASE_ARCHIVE_VERSION=2.3.8 mill -i amm[2.13.3].assembly
```
…ertion

In some Linux distros (e.g., Arch Linux), `/bin` is just a symlink to `/usr/bin` and
`PATH` does not contain `/bin`. In this case `which echo` returns `/usr/bin/echo` and
not `/bin/echo`.
@alexarchambault
Copy link
Collaborator

@rolisv Would it work for you if the version would default to a literal X.Y.Z instead of requiring users to set RELEASE_ARCHIVE_VERSION? This shouldn't be much of a problem, unless you're actually packaging Ammonite for your own needs from the source archive?

@rolisv
Copy link
Author

rolisv commented Jul 27, 2021

@alexarchambault It would work, if that literal is set only in release archive tarball. We need some kind of marker in build.sc to know that we are building from release archive and not invoke git commands.

Arch Linux builds Ammonite from release archive sources and runs a bunch of sed scripts to "butcher" build.sc into not running any git commands. But if build.sc changes, those sed scripts need to be updated. The goal here is to be able to build Ammonite from a release archive without needing to patch it first.

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

Successfully merging this pull request may close these issues.

2 participants