spack/share/spack
Peter Scheibel 02cc3ea005
Add new redistribute() directive (#20185)
Some packages can't be redistributed in source or binary form. We need an explicit way to say that in a package.

This adds a `redistribute()` directive so that package authors can write, e.g.:

```python
    redistribute(source=False, binary=False)
```

You can also do this conditionally with `when=`, as with other directives, e.g.:

```python
    # 12.0 and higher are proprietary
    redistribute(source=False, binary=False, when="@12.0:")

    # can't redistribute when we depend on some proprietary dependency
    redistribute(source=False, binary=False, when="^proprietary-dependency")
```


To prevent Spack from adding either their sources or binaries to public mirrors and build caches. You can still unconditionally add things *if* you run either:
* `spack mirror create --private`
* `spack buildcache push --private`

But the default behavior for build caches is not to include non-redistributable packages in either mirrors or build caches.  We have previously done this manually for our public buildcache, but with this we can start maintaining redistributability directly in packages.

Caveats: currently the default for `redistribute()` is `True` for both `source` and `binary`, and you can only set either of them to `False` via this directive.

- [x] add `redistribute()` directive
- [x] add `redistribute_source` and `redistribute_binary` class methods to `PackageBase`
- [x] add `--private` option to `spack mirror`
- [x] add `--private` option to `spack buildcache push`
- [x] test exclusion of packages from source mirror (both as a root and as a dependency)
- [x] test exclusion of packages from binary mirror (both as a root and as a dependency)
2024-04-24 09:41:03 -07:00
..
bash Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
bootstrap Update bootstrap buildcache to support Python 3.12 (#40404) 2023-10-11 19:03:17 +02:00
csh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
docker Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
docs/docker/module-file-tutorial Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
fish Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
gitlab CI: remove MXNet (#43704) 2024-04-18 10:04:03 -07:00
keys update tutorial command for v0.18.0 and new gpg key (#30904) 2022-05-28 02:36:20 +00:00
logo add artisanal handcrafted SVG Spack logo. (#6165) 2017-11-06 22:42:16 -08:00
qa Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
templates modules: Truncate configure options comment in tcl modules to 8192 ch… (#42054) 2024-01-11 22:05:56 -07:00
setup-env.csh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-env.fish Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-env.ps1 Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
setup-env.sh Fix setup-env when going back and forth between instances (#40924) 2024-01-05 11:31:32 -06:00
setup-tutorial-env.sh Update copyright year to 2024 (#41919) 2024-01-02 09:21:30 +01:00
spack-completion.bash Add new redistribute() directive (#20185) 2024-04-24 09:41:03 -07:00
spack-completion.fish Add new redistribute() directive (#20185) 2024-04-24 09:41:03 -07:00