Skip to content

Conversation

@thequux
Copy link

@thequux thequux commented Jun 8, 2025

This is a first step towards making the X.500 series of ASN.1 specs compile as provided by upstream.

After this change, 2 additional modules from the test suite parse successfully:

  • itu-t_x_x509_2016_AlgorithmObjectIdentifiers.asn
  • itu-t_x_x509_2019_AlgorithmObjectIdentifiers.asn

However, this does drastically slow down the parser - my test suite that runs the compiler with a null backend runs in 19s instead of 2s. I've not yet figured out why

@6d7a
Copy link
Member

6d7a commented Jun 11, 2025

Thank you for your contribution! Would you mind sharing some of your test suite if it's not confidential?

@thequux
Copy link
Author

thequux commented Jun 16, 2025

The test suite isn't confidential, but neither is it anything particularly fancy. I just created a new backend that always returns an empty string, and use that to do the same thing that parse_test::parses_modules does. In particular, I don't have any additional ASN.1 modules that I test against. If you'd like I'll submit a second PR that switches parse_test::parses_modules to use the NullBackend so that it can skip the codegen and instead only run the parse and link phases.

Copy link
Member

@6d7a 6d7a left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution and sorry that it took me some time reviewing this. I only have a minor change request.

if let Some(constraints) = value.3.constraints_mut() {
constraints.push(Constraint::SubtypeConstraint(value.4))
} else {
eprintln!("{name}: unable to push constraints to {ty:?}", name=value.1, ty=value.3);
Copy link
Member

Choose a reason for hiding this comment

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

Could you return an error here instead of logging, so that we report errors consistently through the Result type?

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