Skip to content

Do not (ab)use blocks for top level trees #4909

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 1 commit into from
Oct 15, 2023
Merged

Conversation

gzm0
Copy link
Contributor

@gzm0 gzm0 commented Oct 7, 2023

No description provided.

@gzm0
Copy link
Contributor Author

gzm0 commented Oct 7, 2023

CI only for now.

While working on #4906, I have realized that we hold on to a lot of Javascript trees in the back end for the mere purpose of using their identity to find the already printed tree in the downstream cache.

I want to attempt to print the trees eagerly so we can release that memory. However, for this I need to clean up the block stuff first.

My plan is to make Emitter type parametric on the resulting tree so the BasicLinkerBackend can request a PrintedTree (while providing a lambda to convert pre-cache). But of course, blocks will not accept PrintedTrees.

@gzm0
Copy link
Contributor Author

gzm0 commented Oct 7, 2023

Is our CLA check broken? https://www.lightbend.com/contribute/cla/scala/check/gzm0 returns:

{"user":"gzm0","signed":true,"version":"1.0","currentVersion":"1.0"}

@gzm0
Copy link
Contributor Author

gzm0 commented Oct 7, 2023

Well:

 curl  "https://www.lightbend.com/contribute/cla/scala/check/gzm0"
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

@gzm0
Copy link
Contributor Author

gzm0 commented Oct 7, 2023

Looks like certificates might be missing in the chain sent from the sever:

openssl s_client -connect www.lightbend.com:443
CONNECTED(00000003)
depth=0 CN = www.lightbend.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 CN = www.lightbend.com
verify error:num=21:unable to verify the first certificate
verify return:1
depth=0 CN = www.lightbend.com
verify return:1
---
Certificate chain
 0 s:CN = www.lightbend.com
   i:C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA
   a:PKEY: rsa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0D1zvvVuEUkOmSIlCDIcF5TT93NFEc4bPgsEni7qEmx5531o32
vtI4IlL7UykgGMFmkYi8tsVAKbCFZMw0LgASqZLVVtTqzi5tfpbCrvhn+xYqLYVF
q97v7DWHQo5+ptTYvfE=
-----END CERTIFICATE-----
subject=CN = www.lightbend.com
issuer=C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA
---
No client certificate CA names sent
Peer signing digest: SHA256
Peer signature type: RSA-PSS
Server Temp Key: X25519, 253 bits
---
SSL handshake has read 2088 bytes and written 399 bytes
Verification error: unable to verify the first certificate
---
New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384
Server public key is 2048 bit
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 21 (unable to verify the first certificate)

@gzm0
Copy link
Contributor Author

gzm0 commented Oct 7, 2023

I have the USERTrust RSA CA in my cert store (/etc/ssl) but not the Sectigo RSA Domain Validation Secure Server CA. Probably Chrome has that one built in 🤷

@sjrd
Copy link
Member

sjrd commented Oct 7, 2023

It's on Lightbend's side apparently: scala/scala-dev#855

@gzm0 gzm0 force-pushed the no-block-abuse branch 3 times, most recently from 0d49e7d to 83b69fb Compare October 14, 2023 13:07
@gzm0 gzm0 changed the title WIP: Do not abuse blocks for top level trees Do not (ab)use blocks for top level trees Oct 15, 2023
@gzm0 gzm0 requested a review from sjrd October 15, 2023 12:44
@gzm0 gzm0 marked this pull request as ready for review October 15, 2023 12:44
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I have two coding style nits, but otherwise LGTM.

Comment on lines 214 to 216
} yield (
// Real constructor
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum this goes a bit outside the style guide. If the body of a yield spans multiple lines, it should have {}:

Suggested change
} yield (
// Real constructor
} yield {
// Real constructor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just that by itself will not compile because of the blank line before // Inheritable Constructor. The :: before the blank line is then interpreted as postfix operator.

Options I see:

  • Leave it like this.
  • Curly braces without the blank line
  • Parens inside the curly braces (either with nesting or on the same line).

I have gone with the last option for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum I see. In that case ideally it should be:

} yield {
  (
    ...

    ...
  )
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@gzm0 gzm0 requested a review from sjrd October 15, 2023 14:11
@sjrd sjrd merged commit 168d343 into scala-js:main Oct 15, 2023
@gzm0 gzm0 deleted the no-block-abuse branch October 16, 2023 07:02
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