Skip to content

Prune repository for Haskell only #1

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

Merged
merged 10 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 2 additions & 90 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ on:
release:
types: [published]

env:
CI: "ON" # We can detect this in the build system and other vendors implement it
HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker
HOMEBREW_NO_AUTO_UPDATE: "ON"
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON"
HOMEBREW_NO_GITHUB_API: "ON"
HOMEBREW_NO_INSTALL_CLEANUP: "ON"
RUST_BACKTRACE: "full" # Make Rust print full backtrace on error

jobs:
Build:
runs-on: ${{ matrix.os }}
Expand All @@ -27,39 +18,18 @@ jobs:
- os: ubuntu-latest
STACK_CACHE: "/home/runner/.stack/"
STACK_CACHE_VERSION: ""
TEST_SCRIPT: ci/run_tests.sh
GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2
CHECK_VERSION_CMD: grep $(cat fpm_version)
RELEASE_CMD: "cp -- fpm-$(cat fpm_version)-linux-x86_64"
BOOTSTRAP_RELEASE_CMD: cp /home/runner/.local/bin/fpm fpm-haskell-$(cat fpm_version)-linux-x86_64
HASH_CMD: ls fpm-*|xargs -i{} sh -c 'sha256sum $1 > $1.sha256' -- {}
RELEASE_FLAGS: --flag --static --flag -g --flag -fbacktrace --flag -O3

- os: macos-latest
STACK_CACHE: |
/Users/runner/.stack/snapshots
/Users/runner/.stack/setup-exe-src
STACK_CACHE_VERSION: "v2"
TEST_SCRIPT: ci/run_tests.sh
GET_VERSION_CMD: echo ${{ github.ref }} | cut -dv -f2
CHECK_VERSION_CMD: grep $(cat fpm_version)
RELEASE_CMD: "cp -- fpm-$(cat fpm_version)-macos-x86_64"
BOOTSTRAP_RELEASE_CMD: cp /Users/runner/.local/bin/fpm fpm-haskell-$(cat fpm_version)-macos-x86_64
HASH_CMD: ls fpm-*|xargs -I{} sh -c 'shasum -a 256 $1 > $1.sha256' -- {}
RELEASE_FLAGS: --flag -g --flag -fbacktrace --flag -O3

- os: windows-latest
STACK_CACHE: |
C:\Users\runneradmin\AppData\Roaming\stack
C:\Users\runneradmin\AppData\Local\Programs\stack
STACK_CACHE_VERSION: "v2"
TEST_SCRIPT: ci\run_tests.bat
GET_VERSION_CMD: ("${{ github.ref }}" -Split "v")[1]
CHECK_VERSION_CMD: Select-String -Pattern Version | Where-Object { if ($_ -like -join("*",(Get-Content fpm_version),"*")) {echo $_} else {Throw} }
RELEASE_CMD: copy -- (-join("fpm-",(Get-Content fpm_version),"-windows-x86_64.exe"))
BOOTSTRAP_RELEASE_CMD: copy C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe (-join("fpm-haskell-",(Get-Content fpm_version),"-windows-x86_64.exe"))
HASH_CMD: Get-ChildItem -File -Filter "fpm-*" | Foreach-Object {echo (Get-FileHash -Algorithm SHA256 $PSItem | Select-Object hash | Format-Table -HideTableHeaders | Out-String) > (-join($PSItem,".sha256"))}
RELEASE_FLAGS: --flag --static --flag -g --flag -fbacktrace --flag -O3

env:
FC: gfortran
Expand All @@ -82,12 +52,6 @@ jobs:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}

- name: Get Time
id: time
uses: nanzm/[email protected]
with:
format: 'YYYY-MM'

- name: Setup github actions cache
id: cache
Expand All @@ -96,60 +60,8 @@ jobs:
path: ${{matrix.STACK_CACHE}}
key: ${{ runner.os }}-${{ steps.time.outputs.time }}${{matrix.STACK_CACHE_VERSION}}

- name: Build Haskell fpm
- name: Build and test Haskell fpm
run: |
cd bootstrap
stack build
stack install

- name: put fpm to PATH (macOS)
if: contains(matrix.os, 'macos')
run: |
cp /Users/runner/.local/bin/fpm /usr/local/bin

- name: put fpm to PATH (Windows)
if: contains(matrix.os, 'windows')
run: |
copy "C:\Users\runneradmin\AppData\Roaming\local\bin\fpm.exe" "C:\Program Files\Git\usr\bin"

- name: put fpm to PATH (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo cp /home/runner/.local/bin/fpm /usr/local/bin

- name: Run tests on Haskell fpm
run: |
cd bootstrap
stack test

- name: Build and test Fortran fpm
run: ${{ matrix.TEST_SCRIPT }}

- name: Build and test Fortran fpm (release version)
run: ${{ matrix.TEST_SCRIPT }} ${{ matrix.RELEASE_FLAGS }}

# ----- Upload binaries if creating a release -----
- name: Check that fpm --version matches release tag
if: github.event_name == 'release'
run: |
cd fpm
${{ matrix.GET_VERSION_CMD }} > fpm_version
fpm run -- "--version" | ${{ matrix.CHECK_VERSION_CMD }}

- name: Stage release files for upload
if: github.event_name == 'release'
run: |
cd fpm
fpm run ${{ matrix.RELEASE_FLAGS }} --runner ${{ matrix.RELEASE_CMD }}
${{ matrix.BOOTSTRAP_RELEASE_CMD }}
${{ matrix.HASH_CMD }}

- name: Upload assets
if: github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: fpm/fpm-*
file_glob: true
tag: ${{ github.ref }}
overwrite: true
stack test
24 changes: 0 additions & 24 deletions .github/workflows/docs.yml

This file was deleted.

8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ requests.

By contributing to *fpm*, you certify that you own or are allowed to share the
content of your contribution under the
[fpm license](https://github.com/fortran-lang/fpm/blob/master/LICENSE).
[fpm license](LICENSE).

* [Style](#style)
* [Reporting a bug](#reporting-a-bug)
Expand All @@ -33,7 +33,7 @@ Good bug reports are extremely valuable to us—thank you!
Before opening a bug report:

1. Check if the issue has already been reported
([issues](https://github.com/fortran-lang/fpm/issues)).
([issues](https://github.com/fortran-lang/fpm-haskell/issues)).
2. Check if it is still an issue or it has been fixed?
Try to reproduce it with the latest version from the master branch.
3. Isolate the problem and create a minimal test case.
Expand Down Expand Up @@ -64,7 +64,7 @@ It’s quite possible that we are not considering an unusually creative solution
*fpm* is a community project. There is no one single person making final
decisions. This is the workflow that we follow:

1. Open a [new issue](https://github.com/fortran-lang/fpm/issues/new) to
1. Open a [new issue](https://github.com/fortran-lang/fpm-haskell/issues/new) to
describe a bug or propose a new feature.
Refer to the earlier sections on how to write a good bug report or feature
request.
Expand Down Expand Up @@ -119,4 +119,4 @@ You can learn how from

Don’t know where to start?
You can start by looking through the list of
[open issues](https://github.com/fortran-lang/fpm/issues).
[open issues](https://github.com/fortran-lang/fpm-haskell/issues).
3 changes: 0 additions & 3 deletions ChangeLog.md

This file was deleted.

138 changes: 43 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Fortran Package Manager
__This repository archives the legacy Haskell implementation of fpm and is not under active development.__

__See [fortran-lang/fpm](https://github.com/fortran-lang/fpm) for the active fpm implementation__

# Fortran Package Manager - Haskell

Fortran Package Manager (fpm) is a package manager and build system for Fortran.
Its key goal is to improve the user experience of Fortran programmers.
Expand All @@ -10,120 +14,64 @@ so if you're familiar with that tool, you will feel at home with fpm.
Fpm's long term vision is to nurture and grow the ecosystem of modern Fortran
applications and libraries.

Fpm is an early prototype and is evolving rapidly.
You can use it to build and package your Fortran projects, as well as to use
[existing fpm packages](https://github.com/fortran-lang/fpm-registry) as dependencies.
Fpm's behavior and user interface may change as it evolves, however as fpm
matures and we enter production, we will aim to stay backwards compatible.
Please follow the [issues](https://github.com/fortran-lang/fpm/issues) to
contribute and/or stay up to date with the development.
Before opening a bug report or a feature suggestion, please read our
[Contributor Guide](CONTRIBUTING.md). You can also discuss your ideas and queries with the community in [fpm discussions](https://github.com/fortran-lang/fpm/discussions), or more broadly on [Fortran-Lang Discourse](https://fortran-lang.discourse.group/)

Fortran Package Manager is not to be confused with
[Jordan Sissel's fpm](https://github.com/jordansissel/fpm), a more general,
non-Fortran related package manager.

## Getting started

### Setting up fpm

#### Binary download
`x86-64` binaries are available [to download](https://github.com/fortran-lang/fpm/releases) for Windows, MacOS and Linux.
## Building fpm-haskell

__Note:__ On Linux and MacOS, you will need to enable executable permission before you can use the binary.
### Install Haskell

_e.g._ `$ chmod u+x fpm-v0.1.0-linux-x86_64`
To install **Haskell Stack**, follow these [instructions](https://docs.haskellstack.org/en/stable/install_and_upgrade/),
users without superuser (admin) permissions should follow the [manual installation](https://docs.haskellstack.org/en/stable/install_and_upgrade/#manual-download_2) procedure.

#### Conda
### Download this repository

Fpm is available on conda-forge, to add conda-forge to your channels use:

```
conda config --add channels conda-forge
```bash
git clone https://github.com/fortran-lang/fpm-haskell
cd fpm
```

Fpm can be installed with:
### Build and Test fpm

Build fpm using:
```bash
stack build
```
conda create -n fpm fpm
conda activate fpm
To test:
```bash
stack test
```
To install:
```bash
stack install
```

The conda package manager can be installed from [miniforge](https://github.com/conda-forge/miniforge/releases)
or from [miniconda](https://docs.conda.io/en/latest/miniconda.html).

#### Github Actions

To setup *fpm* within Github actions for automated testing, you can use the [fortran-lang/setup-fpm](https://github.com/marketplace/actions/setup-fpm) action.

#### Bootstraping on other platforms
On Linux, the above command installs `fpm` to `${HOME}/.local/bin`.

For other platforms and architectures have a look at the [bootstrapping instructions](#bootstrapping-instructions).
## Usage

### Creating a new project

Creating a new *fpm* project is as simple as running the command
`fpm new project_name`. This will create a new folder in your current directory
with the following contents and initialized as a git repository.
Creating a new fpm project is as simple as running the command `fpm new project_name`.
This will create a new folder in your current directory with the following contents
and initialized as a git repository.

* `fpm.toml` with your projects name and some default standard meta-data
* `README.md` with your projects name
* `.gitignore`
* `src/project_name.f90` with a simple hello world subroutine
* `app/main.f90` (if `--with-executable` flag used) a program that calls the subroutine
* `test/main.f90` (if `--with-test` flag used) an empty test program
* `fpm.toml` with your project's name and some default standard meta-data
* `README.md` with your project's name
* `.gitgnore`
* `src/project_name.f90` with a simple hello world subroutine
* `app/main.f90` (if `--with-executable` flag used) a program that calls the subroutine
* `test/main.f90` (if `--with-test` flag used) an empty test program

### Building your Fortran project with fpm
## Building your Fortran project with fpm

*fpm* understands the basic commands:
fpm understands the basic commands:

* `fpm build` build your library, executables and tests
* `fpm run` run executables
* `fpm test` run tests
* `fpm build` - build your library, executables and tests
* `fpm run` - run executables
* `fpm test`- run tests

The command `fpm run` can optionally accept the name of the specific executable
to run, as can `fpm test`; like `fpm run specific_executable`. Command line
to run, as can `fpm test`; like `fpm run specifc_executable`. Command line
arguments can also be passed to the executable(s) or test(s) with the option
`-- some arguments`.

See additional instructions in the [Packaging guide](PACKAGING.md) or
the [manifest reference](manifest-reference.md).


### Bootstrapping instructions
`--args "some arguments"`.

This guide explains the process of building *fpm* on a platform for the first time.
If your platform and architecture are already supported, download the binary from the [release page](https://github.com/fortran-lang/fpm/releases) instead.

#### Download this repository

```bash
$ git clone https://github.com/fortran-lang/fpm
$ cd fpm/
```

#### Build a bootstrap version of fpm

You can use the install script to bootstrap and install *fpm*:

```bash
$ ./install.sh
```

By default, the above command installs `fpm` to `${HOME}/.local/bin/`.
To specify an alternative destination use the `--prefix=` flag, for example:

```bash
$ ./install.sh --prefix=/usr/local
```

which will install *fpm* to `/usr/local/bin`.

To test that everything is working as expected you can now build *fpm*
with itself and run the tests with:

```bash
$ cd fpm
$ fpm test
```
See additional instructions in the [Packaging guide](PACKAGING.md).
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion bootstrap/test/example_packages

This file was deleted.

Loading