diff --git a/CHANGELOG.md b/CHANGELOG.md index 533bfa5ff9..1705ff38f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.94.0](https://github.com/aws/jsii/compare/v1.93.0...v1.94.0) (2024-01-09) + + +### Features + +* **go-runtime:** include error message when wrapping a @jsii/kernel.Fault ([#4275](https://github.com/aws/jsii/issues/4275)) ([c6eb62a](https://github.com/aws/jsii/commit/c6eb62a290b9a1897fe0aee6cb1a89581b0cd78b)) + + +### Bug Fixes + +* **pacmak:** invokeBinScript fails when using symlinked cache ([#4389](https://github.com/aws/jsii/issues/4389)) ([37d9dc7](https://github.com/aws/jsii/commit/37d9dc7565a6a84c6274d5ebab9e72d0de993aa1)) + ## [1.93.0](https://github.com/aws/jsii/compare/v1.92.0...v1.93.0) (2023-12-08) diff --git a/gh-pages/content/overview/runtime-architecture.md b/gh-pages/content/overview/runtime-architecture.md index b625de6dc2..3cbbec0f14 100644 --- a/gh-pages/content/overview/runtime-architecture.md +++ b/gh-pages/content/overview/runtime-architecture.md @@ -1,4 +1,5 @@ # Runtime Architecture + ## Generated Libraries When using `jsii-pacmak` to generate libraries in different programming @@ -149,7 +150,7 @@ The initialization workflow can be described as: the child's `STDERR` stream, and forwards the decoded data to it's host process' `STDERR` and `STDOUT` as needed. 4. The *runtime client library* automatically loads the **Javascript** modules - bundled within the *generated bindings* (and their depedencies, bundled in + bundled within the *generated bindings* (and their dependencies, bundled in other *generated bindings*) into the `node` process when needed. 5. Calls into the *Generated bindings* are encoded into JSON requests and sent to the child `node` process, which will execute the corresponding diff --git a/gh-pages/requirements-dev.txt b/gh-pages/requirements-dev.txt index 1e38c5b606..fe3e50b9f7 100644 --- a/gh-pages/requirements-dev.txt +++ b/gh-pages/requirements-dev.txt @@ -1,4 +1,4 @@ mkdocs~=1.5.3 mkdocs-awesome-pages-plugin~=2.9.2 -mkdocs-material~=9.4.14 +mkdocs-material~=9.5.3 mkdocs-git-revision-date-plugin~=0.3.2 diff --git a/lerna.json b/lerna.json index 649bd2352f..e6283aa150 100644 --- a/lerna.json +++ b/lerna.json @@ -12,6 +12,6 @@ "rejectCycles": true } }, - "version": "1.93.0", + "version": "1.94.0", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/packages/@jsii/Directory.Build.targets b/packages/@jsii/Directory.Build.targets index a750280a90..5ce14c1457 100644 --- a/packages/@jsii/Directory.Build.targets +++ b/packages/@jsii/Directory.Build.targets @@ -13,7 +13,7 @@ - + diff --git a/packages/@jsii/go-runtime-test/project/go.mod b/packages/@jsii/go-runtime-test/project/go.mod index a3a895128c..27dc7ec850 100644 --- a/packages/@jsii/go-runtime-test/project/go.mod +++ b/packages/@jsii/go-runtime-test/project/go.mod @@ -9,7 +9,7 @@ require ( github.com/aws/jsii/jsii-calc/go/scopejsiicalclib v0.0.0-devpreview github.com/stretchr/testify v1.8.4 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/tools v0.16.0 + golang.org/x/tools v0.16.1 ) require ( diff --git a/packages/@jsii/go-runtime-test/project/go.sum b/packages/@jsii/go-runtime-test/project/go.sum index 0e54aacb05..d15d097bff 100644 --- a/packages/@jsii/go-runtime-test/project/go.sum +++ b/packages/@jsii/go-runtime-test/project/go.sum @@ -34,8 +34,8 @@ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index e44221d5dc..5a6e2e9dd6 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -8,7 +8,7 @@ require ( github.com/mattn/go-isatty v0.0.20 github.com/stretchr/testify v1.8.4 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 - golang.org/x/tools v0.16.0 + golang.org/x/tools v0.16.1 ) require ( diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum index 0e54aacb05..d15d097bff 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum @@ -34,8 +34,8 @@ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= -golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go index f437648f5c..4541c2a8e1 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/kernel/process/process.go @@ -227,7 +227,7 @@ func (p *Process) readResponse(into interface{}) error { json.Unmarshal(raw, &errResp) if errResp.Name != nil && *errResp.Name == "@jsii/kernel.Fault" { - return fmt.Errorf("JsiiError: %s", *errResp.Name) + return fmt.Errorf("JsiiError: %s %s", *errResp.Name, errResp.Error) } return errors.New(errResp.Error) diff --git a/packages/@jsii/kernel/src/kernel.ts b/packages/@jsii/kernel/src/kernel.ts index caab41c6d0..c1c00127dc 100644 --- a/packages/@jsii/kernel/src/kernel.ts +++ b/packages/@jsii/kernel/src/kernel.ts @@ -1372,11 +1372,6 @@ export class Kernel { // Make sure the current NODE_OPTIONS are honored if we shell out to node const nodeOptions = [...process.execArgv]; - // When we are using the symlinked version of the cache, we need to preserve both symlink settings for binaries - if (nodeOptions.includes('--preserve-symlinks')) { - nodeOptions.push('--preserve-symlinks-main'); - } - return { command: path.join(packageDir, scriptPath), args: req.args ?? [], diff --git a/packages/@jsii/python-runtime/requirements.txt b/packages/@jsii/python-runtime/requirements.txt index 63853ed2f3..b95f3495da 100644 --- a/packages/@jsii/python-runtime/requirements.txt +++ b/packages/@jsii/python-runtime/requirements.txt @@ -1,9 +1,9 @@ -black~=23.11 -mypy==1.7.1 +black~=23.12 +mypy==1.8.0 pip~=23.3 pytest~=7.4 pytest-mypy~=0.10 -setuptools~=69.0.2 +setuptools~=69.0.3 types-python-dateutil~=2.8 wheel~=0.42 diff --git a/packages/@jsii/python-runtime/tests/test_invoke_bin.py b/packages/@jsii/python-runtime/tests/test_invoke_bin.py index f4e91fbee5..00e21ef91d 100644 --- a/packages/@jsii/python-runtime/tests/test_invoke_bin.py +++ b/packages/@jsii/python-runtime/tests/test_invoke_bin.py @@ -35,12 +35,21 @@ def silence_node_deprecation_warnings(): environ[var] = store[var] +@pytest.fixture() +def disable_jsii_runtime_package_cache(): + """Disable the jsii runtime cache because it is problematic with InvokeBinScript.""" + + environ["JSII_RUNTIME_PACKAGE_CACHE"] = "disabled" + + class TestInvokeBinScript: @pytest.mark.skipif( platform.system() == "Windows", reason="jsii-pacmak does not generate windows scripts", ) - def test_invoke_script(self, silence_node_deprecation_warnings) -> None: + def test_invoke_script( + self, silence_node_deprecation_warnings, disable_jsii_runtime_package_cache + ) -> None: script_path = f".env/bin/calc" result = subprocess.run([script_path], capture_output=True) @@ -51,7 +60,9 @@ def test_invoke_script(self, silence_node_deprecation_warnings) -> None: platform.system() == "Windows", reason="jsii-pacmak does not generate windows scripts", ) - def test_invoke_script_with_args(self, silence_node_deprecation_warnings) -> None: + def test_invoke_script_with_args( + self, silence_node_deprecation_warnings, disable_jsii_runtime_package_cache + ) -> None: script_path = f".env/bin/calc" result = subprocess.run([script_path, "arg1", "arg2"], capture_output=True) @@ -63,7 +74,7 @@ def test_invoke_script_with_args(self, silence_node_deprecation_warnings) -> Non reason="jsii-pacmak does not generate windows scripts", ) def test_invoke_script_with_failure( - self, silence_node_deprecation_warnings + self, silence_node_deprecation_warnings, disable_jsii_runtime_package_cache ) -> None: script_path = f".env/bin/calc" result = subprocess.run([script_path, "arg1", "fail"], capture_output=True) @@ -77,7 +88,7 @@ def test_invoke_script_with_failure( reason="jsii-pacmak does not generate windows scripts", ) def test_invoke_script_with_line_flush( - self, silence_node_deprecation_warnings + self, silence_node_deprecation_warnings, disable_jsii_runtime_package_cache ) -> None: """Make sure lines are flushed immediately as they are generated, rather than buffered to the end diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index c0ab22271e..63b245d0fd 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -1833,6 +1833,11 @@ class PythonModule implements PythonType { code.line(); code.line('import jsii'); code.line('import sys'); + code.line('import os'); + code.line(); + code.openBlock('if "JSII_RUNTIME_PACKAGE_CACHE" not in os.environ'); + code.line('os.environ["JSII_RUNTIME_PACKAGE_CACHE"] = "disabled"'); + code.closeBlock(); code.line(); emitList( code, diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap index dac58bf1dd..34a2c1428f 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap @@ -11757,6 +11757,10 @@ exports[`Generated code for "jsii-calc": /python/src/jsii_calc/_jsii/bin import jsii import sys +import os + +if "JSII_RUNTIME_PACKAGE_CACHE" not in os.environ: + os.environ["JSII_RUNTIME_PACKAGE_CACHE"] = "disabled" __jsii_assembly__ = jsii.JSIIAssembly.load( "jsii-calc", "3.20.120", "jsii_calc", "jsii-calc@3.20.120.jsii.tgz" diff --git a/packages/jsii-pacmak/test/generated-code/requirements-dev.txt b/packages/jsii-pacmak/test/generated-code/requirements-dev.txt index 55c36a61a3..46075eae3a 100644 --- a/packages/jsii-pacmak/test/generated-code/requirements-dev.txt +++ b/packages/jsii-pacmak/test/generated-code/requirements-dev.txt @@ -1,2 +1,2 @@ -mypy==1.7.1 -pip==23.3.1 # required to use --config-settings +mypy==1.8.0 +pip==23.3.2 # required to use --config-settings diff --git a/superchain/Dockerfile b/superchain/Dockerfile index d995dc8458..281e498606 100644 --- a/superchain/Dockerfile +++ b/superchain/Dockerfile @@ -51,14 +51,14 @@ SHELL ["/bin/zsh", "-c"] # Prepare maven binary distribution ARG M2_VERSION="3.9.4" -ENV M2_DISTRO="https://www.apache.org/dist/maven/maven-3" +ENV M2_DISTRO="https://downloads.apache.org/maven/maven-3" RUN set -eo pipefail \ && curl -fSsL "${M2_DISTRO}/${M2_VERSION}/binaries/apache-maven-${M2_VERSION}-bin.tar.gz" \ -o /tmp/apache-maven.tar.gz \ && curl -fSsL "${M2_DISTRO}/${M2_VERSION}/binaries/apache-maven-${M2_VERSION}-bin.tar.gz.asc" \ -o /tmp/apache-maven.tar.gz.asc \ && mkdir -p /tmp/gpg-maven && chmod go-rwx /tmp/gpg-maven \ - && curl -fSsL "https://www.apache.org/dist/maven/KEYS" | gpg --homedir /tmp/gpg-maven --import \ + && curl -fSsL "https://downloads.apache.org/maven/KEYS" | gpg --homedir /tmp/gpg-maven --import \ && gpg --homedir /tmp/gpg-maven --verify /tmp/apache-maven.tar.gz.asc /tmp/apache-maven.tar.gz \ && mkdir -p /opt/apache/maven \ && tar xzf /tmp/apache-maven.tar.gz -C /opt/apache/maven --strip-components=1