Skip to content

Commit

Permalink
makefile fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-aws committed Oct 8, 2024
1 parent a70f30c commit 850d211
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion SmithyDafnyMakefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ _mv_implementation_rust:

patch_after_transpile_rust:
export service_deps_var=SERVICE_DEPS_$(MAIN_SERVICE_FOR_RUST) ; \
export namespace_var=SERVICE_NAMESPACE_$(MAIN_SERVICE_FOR_RUST) ; \
export namespace_var=SERVICE_NAMESPACE_$(MAIN_SERVICE_FOR_RUST) ; \
export SERVICE=$(MAIN_SERVICE_FOR_RUST) ; \
$(MAKE) _patch_after_transpile_rust ; \

Expand Down
16 changes: 9 additions & 7 deletions TestModels/dafny-dependencies/StandardLibrary/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,16 @@ polymorph_dafny :
--dependent-model $(PROJECT_ROOT)/$(STD_LIBRARY)/../Model \
";

polymorph_dotnet :
polymorph_dotnet:
echo "Skipping polymorph_dotnet for StandardLibrary"

polymorph_java :
polymorph_java:
echo "Skipping polymorph_java for StandardLibrary"

polymorph_python :
polymorph_python:
echo "Skipping polymorph_python for StandardLibrary"

# Using this target for the side-effect of maintaining patches,
# Since Dafny Rust code generation is incomplete and also needs to be patched.
# That only works if you run transpile_rust first.
polymorph_rust :
polymorph_rust:
echo "Skipping polymorph_rust for StandardLibrary"

_polymorph_dependencies:
Expand All @@ -71,6 +68,11 @@ transpile_rust: | transpile_implementation_rust

RUST_OTHER_FILES=runtimes/rust/src/conversion.rs runtimes/rust/src/UTF8_externs.rs

# These are necessary just for the patch_after_transpile_rust target
MAIN_SERVICE_FOR_RUST := StandardLibrary
SERVICE_NAMESPACE_StandardLibrary=aws.polymorph
SERVICE_DEPS_StandardLibrary :=

# Override this target to not insert a dependency on the standard library.
_mv_implementation_rust:
mv implementation_from_dafny-rust/src/implementation_from_dafny.rs runtimes/rust/src/implementation_from_dafny.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,18 @@ public static void main(String[] args) {
.withTargetLangOutputDirs(outputDirs)
.withTargetLangTestOutputDirs(testOutputDirs)
.withAwsSdkStyle(cliArguments.awsSdkStyle)
.withLocalServiceTest(cliArguments.localServiceTest)
.withDafnyVersion(cliArguments.dafnyVersion)
.withUpdatePatchFiles(cliArguments.updatePatchFiles)
.withGenerationAspects(cliArguments.generationAspects);
// Rust currently generates all code for all dependencies at once,
// and the makefile structure makes it very difficult to avoid passing --local-service-test
// when we don't actually want it for --aws-sdk style projects.
// For now just ignoring it with a warning.
if (outputDirs.containsKey(TargetLanguage.RUST) && cliArguments.awsSdkStyle && cliArguments.localServiceTest) {
LOGGER.warn("Ignoring --local-service-test because --output-rust and --aws-sdk are also present");
} else {
engineBuilder.withLocalServiceTest(cliArguments.localServiceTest);
}
cliArguments.propertiesFile.ifPresent(engineBuilder::withPropertiesFile);
cliArguments.javaAwsSdkVersion.ifPresent(
engineBuilder::withJavaAwsSdkVersion
Expand Down

0 comments on commit 850d211

Please sign in to comment.