-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Replace cli flag --prebuilt-platform
with --build-host
#6859
Open
lukewilliamboswell
wants to merge
57
commits into
main
Choose a base branch
from
rebuild-platform
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
57 commits
Select commit
Hold shift click to select a range
dc0902b
WIP
lukewilliamboswell 753cfb4
fix: building valgrind surgical host
lukewilliamboswell 85447ec
replace stray strings with impl on Target
lukewilliamboswell 96c559e
minor fixes
lukewilliamboswell 4ccbc41
replace gen-stub-lib in nix CI tests
lukewilliamboswell 287d00d
remove gen_stub_lib
lukewilliamboswell f515311
clippy fix
lukewilliamboswell bd68787
add --build-host for benchmark tests
lukewilliamboswell 61a5a0a
checkpoint: refactor prebuilt host artifacts
r-bar d747cc9
Merge remote-tracking branch 'remotes/luke/rebuild-platform' into reb…
r-bar dfa3254
checkpoint: it compiles
r-bar bc29782
checkpoint: Run struct refactor for helpers
r-bar 89d63f2
Fix ownership issues with runners
smores56 3662c90
WIP get things compiling... hacks everywhere beware
lukewilliamboswell 4ec213a
Get tests working
smores56 550bade
Merge branch 'main' into rebuild-platform
smores56 49f5ea8
Merge branch 'main' into rebuild-platform
smores56 28ceb0e
Fix formatting and clippy issues
smores56 2928969
restore one test
lukewilliamboswell 6276cc7
WIP more cli_run tests passing
lukewilliamboswell 4863234
Merge branch 'rebuild-platform' of github.com:roc-lang/roc into rebui…
lukewilliamboswell 014514a
WIP more passing roc_cli tests
lukewilliamboswell 64cc816
WIP all the roc_cli tests passing, woo
lukewilliamboswell 9ecb209
add suppress warning flag, remove test test_roc_app_slim
lukewilliamboswell 0767115
WIP refactor to build test platform once per test run
lukewilliamboswell 804cb6e
WIP upgrade cli test packages fixture tests
lukewilliamboswell c8522c2
WIP upgrade cli tests transitive-deps
lukewilliamboswell d2fbf86
format test files, upgrade some tests
lukewilliamboswell 7ce9ecd
WIP improve cli tests
lukewilliamboswell 894e4d1
make clippy happy again
lukewilliamboswell 5c8eb4f
rename cli to basic-cli
lukewilliamboswell 6ab0de1
fix benchmark tests
lukewilliamboswell 0256c4e
move false interpreter into cli tests
lukewilliamboswell 8ad8198
move effects cli test
lukewilliamboswell fa40166
move tui example into cli tests
lukewilliamboswell c3785a2
fix more tests
lukewilliamboswell 767ec7a
cli run tests passing on macos
lukewilliamboswell ac78d39
Merge remote-tracking branch 'remote/main' into rebuild-platform
lukewilliamboswell 8612220
fix plumbing for roc_glue
lukewilliamboswell b0c1d88
Merge remote-tracking branch 'remote/main' into rebuild-platform
lukewilliamboswell e7a90f1
fix clippy
lukewilliamboswell cd955fd
remove check_compile_error, fix cli tests
lukewilliamboswell 93a4c58
fix cli tests - mainly wasm and i386
lukewilliamboswell 0e917be
add LEGACY LINKER conditional for test runs
lukewilliamboswell 4e6178c
move valgrind configuration into Run builder
lukewilliamboswell f92974c
use legacy linker in tests
lukewilliamboswell 012a2fc
Merge remote-tracking branch 'remote/main' into rebuild-platform
lukewilliamboswell a11f51a
fixup
lukewilliamboswell ec8f6e8
clippy fix
Anton-4 251e1ed
misc improvements
Anton-4 ef87653
migrate cli test combine-tasks.roc off basic-cli
lukewilliamboswell c6a67c9
remove basic-cli tests from roc_cli
lukewilliamboswell 5dfcdae
migrate inspect-logging.roc into cli tests and use effects platform
lukewilliamboswell 73846ed
add test for module_params pass_task.roc
lukewilliamboswell beb2dcb
remove unneeded basic-cli reference in formatting test
lukewilliamboswell bb57c4a
remove unneded basic-cli reference in test_reporting
lukewilliamboswell dc138b8
remove last usage of basic-cli platform from the tests
lukewilliamboswell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,26 42,50 @@ pub fn link( | |
} | ||
} | ||
|
||
/// Same format as the precompiled host filename, except with a file extension like ".o" or ".obj" | ||
pub fn legacy_host_file(target: Target, platform_main_roc: &Path) -> PathBuf { | ||
let lib_ext = target.static_library_file_ext(); | ||
/// Search for a prebuilt surgical host in the platform main directory. | ||
pub fn find_surgical_host(target: Target, platform_main_roc: &Path) -> Result<PathBuf, String> { | ||
let surgical_host_path = platform_main_roc.with_file_name(target.prebuilt_surgical_host()); | ||
|
||
let file_name = roc_linker::preprocessed_host_filename(target) | ||
.replace(roc_linker::PRECOMPILED_HOST_EXT, lib_ext); | ||
let generic_host_path: PathBuf = platform_main_roc.with_file_name("host.rh"); | ||
|
||
let lib_path = platform_main_roc.with_file_name(file_name); | ||
if generic_host_path.exists() { | ||
Ok(generic_host_path) | ||
} else if surgical_host_path.exists() { | ||
Ok(surgical_host_path) | ||
} else { | ||
Err(format!( | ||
"\n {}\n {}", | ||
surgical_host_path.display(), | ||
generic_host_path.display(), | ||
) | ||
.to_string()) | ||
} | ||
} | ||
|
||
let default_host_path: PathBuf = platform_main_roc | ||
.with_file_name("libhost") | ||
.with_extension(lib_ext); | ||
/// Search for a prebuilt legacy host in the platform main directory. | ||
pub fn find_legacy_host(target: Target, platform_main_roc: &Path) -> Result<PathBuf, String> { | ||
let static_library_path = platform_main_roc.with_file_name(target.prebuilt_static_library()); | ||
|
||
let static_object_path = platform_main_roc.with_file_name(target.prebuilt_static_object()); | ||
|
||
if lib_path.exists() { | ||
lib_path | ||
} else if default_host_path.exists() { | ||
default_host_path | ||
let generic_host_path: PathBuf = platform_main_roc | ||
.with_file_name("libhost") | ||
.with_extension(target.static_library_file_ext()); | ||
|
||
if static_library_path.exists() { | ||
Ok(static_library_path) | ||
} else if generic_host_path.exists() { | ||
Ok(generic_host_path) | ||
} else if static_object_path.exists() { | ||
Ok(static_object_path) | ||
} else { | ||
let obj_ext = target.object_file_ext(); | ||
lib_path.with_extension(obj_ext) | ||
Err(format!( | ||
"\n {}\n {}\n {}", | ||
static_library_path.display(), | ||
static_object_path.display(), | ||
generic_host_path.display(), | ||
) | ||
.to_string()) | ||
} | ||
} | ||
|
||
|
@@ -457,6 481,7 @@ pub fn rebuild_host( | |
}; | ||
|
||
let host_dest = if matches!(target.architecture(), Architecture::Wasm32) { | ||
// TODO verify this is corect, how do we do get here with OptLevel::Development | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO -- investigate |
||
if matches!(opt_level, OptLevel::Development) { | ||
platform_main_roc.with_extension("o") | ||
} else { | ||
|
@@ -467,7 492,7 @@ pub fn rebuild_host( | |
.with_file_name("dynhost") | ||
.with_extension(executable_extension) | ||
} else { | ||
legacy_host_file(target, platform_main_roc) | ||
platform_main_roc.with_file_name(target.prebuilt_static_object()) | ||
}; | ||
|
||
let env_path = env::var("PATH").unwrap_or_else(|_| "".to_string()); | ||
|
@@ -1330,9 1355,9 @@ pub fn llvm_module_to_dylib( | |
unsafe { Library::new(path) } | ||
} | ||
|
||
pub fn preprocess_host_wasm32(host_input_path: &Path, preprocessed_host_path: &Path) { | ||
pub fn preprocess_host_wasm32(host_input_path: &Path, host_output_path: &Path) { | ||
let host_input = host_input_path.to_str().unwrap(); | ||
let output_file = preprocessed_host_path.to_str().unwrap(); | ||
let output_file = host_output_path.to_str().unwrap(); | ||
|
||
/* | ||
Notes: | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some big changes here. The primary thrust is to remove layers of abstraction, and reduce the number of ways we do things to just one. There were various places where we would do the same thing multiple different ways, and also calling layers of different functions abstracted away what was actually being done in each tests.
You can now see at a glance what is being done for each test, without digging through multiple function calls. The code is still fairly DRY as common behaviour is rolled up into the
Run
builder API for calling roc.The other major change, is moving tests with a common platform into the same module, and using a
Once
variable to build the platform host once per test run.