Skip to content

Instantly share code, notes, and snippets.

View cosmicexplorer's full-sized avatar
🎨
building some software right now you will probably end up using at some point

Danny McClanahan cosmicexplorer

🎨
building some software right now you will probably end up using at some point
View GitHub Profile
@cosmicexplorer
cosmicexplorer / licenses-as-partial-orders.md
Last active August 18, 2022 16:14
A formalization of real-life license compatibility as a directed graph.

An elaboration of concepts proposed in this issue.

Discussion: Licenses as partial orders

Many(/most?) licenses do not adhere to a strict total compatibility ordering; for example, one license may be more strict than another in one regard but less strict in another. This imposes some design constraints on our mechanism for checking compatibility between a package checkout and its dependency:

  1. There is a shared, static set of licenses corresponding to valid SPDX identifiers.
  2. There will be a shared set of requirements that all licenses impose.
  3. Each license declares a set of or "compatibility" relationships to other licenses along the relevant "requirement" axes.
    • This is to say: each or corresponds to exactly one requirement.
  4. Each package checkout declares at most one license.
  5. Each package checkout consumes each of its dependencies in a particular manner, which activates some subset of the license
@cosmicexplorer
cosmicexplorer / pip-install-report.diff
Created January 7, 2022 13:36
attempt to make pip install --report work the same as pip download --report
diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py
index eedb1ff5d..804bc11ff 100644
--- a/src/pip/_internal/commands/install.py
+++ b/src/pip/_internal/commands/install.py
@@ -17,6 +17,7 @@ from pip._internal.cli.req_command import (
with_cleanup,
)
from pip._internal.cli.status_codes import ERROR, SUCCESS
+from pip._internal.commands.download import ResolutionResult, ResolvedCandidate
from pip._internal.exceptions import CommandError, InstallationError
@cosmicexplorer
cosmicexplorer / deploying-a-text-file.md
Last active May 30, 2021 18:22
cross-cultural resolution

Preface

This document refers to at least three projects:

  1. the pex packaging tool
  2. the spack package manager
  3. the pants build tool

This document was originally intended as a response to this pex issue, which describes one way to directly integrate dependency graphs into a package manager or build tool.

Vision: Deploying a Text File

@cosmicexplorer
cosmicexplorer / uuid.data.json
Created September 27, 2020 22:46
'uuid' module entries for .mypy_cache in pex
{
".class": "MypyFile",
"_fullname": "uuid",
"is_partial_stub_package": false,
"is_stub": true,
"names": {
".class": "SymbolTable",
"Any": {
".class": "SymbolTableNode",
"cross_ref": "typing.Any",

Keybase proof

I hereby claim:

  • I am cosmicexplorer on github.
  • I am turingtarpit (https://keybase.io/turingtarpit) on keybase.
  • I have a public key ASAtpc3YkMi3LvmdB8c7__vT5ehF_fLiyjrwp_utOczB8go

To claim this, I am signing this object:

@cosmicexplorer
cosmicexplorer / posix-memalign-removal.diff
Created December 22, 2019 01:05
applying this patch should unbreak emacs master on osx!
diff --git a/configure.ac b/configure.ac
index 3b6a2a6d16..90060e4f48 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4184,7 +4184,7 @@ AC_DEFUN
LIBS=$OLD_LIBS
dnl No need to check for posix_memalign if aligned_alloc works.
-AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
+AC_CHECK_FUNCS([aligned_alloc], [break])
@cosmicexplorer
cosmicexplorer / bsp-interaction-debug-log.txt
Last active June 22, 2019 21:52
pants bsp interaction hanging on compile
[bloop-compile]
21:35:30 [DEBUG] pants.java.executor:pid=26932: Executing: /Users/dmcclanahan/Downloads/openjdk1.8.0_202-jvmci-0.59/Contents/Home/bin/java -cp /Users/dmcclanahan/workspace/s3/.pants.d/ng/BloopCompile_bloop_bloop_compile/tmpkGwduV.jar pants.contrib.bloop.compile.PantsCompileMain debug -- macaw.macaw-test.macaw-test macaw.macaw-test.tests macaw.macaw-test.src.test.scala.scala macaw.macaw-test.src.test.thrift.thrift-scala macaw.macaw-test.src.main.scala.scala .pants.d.gen.scrooge.55f6998c5e42.macaw.m.837d4a355d20a4bb.w.macaw-test.src.test.thrift.thrift-scala args={} at cwd=/Users/dmcclanahan/workspace/s3
Starting the bsp launcher for bloop...
A bloop installation has been detected either in the PATH or $HOME/.bloop
Opening a bsp server connection with 'bloop bsp --protocol local --socket /var/folders/_r/gknsp2dd6bs3k1y9s6btxbyc0000gn/T/bsp-launcher8059555547206668069/bsp.socket'...
Waiting 200ms until the bsp conn
@cosmicexplorer
cosmicexplorer / repro-bigquery.diff
Last active May 11, 2019 01:48
checking out https://github.com/pantsbuild/pants at 4dafc870ece338be7bbba4e44ee1e416e27e9afb, then running test-bisect.zsh, should show that pex==1.5.3 suceeds, and pex==1.6.0 errors out at import time for the google-cloud-bigquery package.
diff --git a/3rdparty/python/requirements.txt b/3rdparty/python/requirements.txt
index 9c0e693..0b93f20 100644
--- a/3rdparty/python/requirements.txt
+++ b/3rdparty/python/requirements.txt
@@ -17,7 +17,7 @@ more-itertools<6.0.0 ; python_version<'3'
packaging==16.8
parameterized==0.6.1
pathspec==0.5.9
-pex==1.6.6
+pex==1.5.3
@cosmicexplorer
cosmicexplorer / gist:18628b9e58d7c7ab02ccab3cba570675
Created May 10, 2019 03:49
example failing ouput fixed by https://github.com/pantsbuild/pants/pull/7695 (reproducible if 3rdparty/python/BUILD is edited to have prepend_to_pythonpath=False).
> ./pants test examples/tests/python/example_test/pkg_resources_access -- -vs
20:45:00 00:00 [main]
(To run a reporting server: ./pants server)
20:45:02 00:02 [setup]
20:45:22 00:22 [parse]
Executing tasks in goals: bootstrap -> imports -> unpack-wheels -> unpack-jars -> deferred-sources -> native-compile -> link -> jvm-platform-validate -> gen -> resolve -> resources -> compile -> pyprep -> test
20:45:23 00:23 [bootstrap]
20:45:23 00:23 [substitute-aliased-targets]
20:45:23 00:23 [jar-dependency-management]
20:45:23 00:23 [bootstrap-jvm-tools]