Skip to content
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

System.ex monotonic_time/1 system_time/1 #1279

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

petermm
Copy link
Contributor

@petermm petermm commented Sep 22, 2024

Carbon copy from elixir with :native time unit removed, as it's not supported by current erlang implementation.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@petermm
Copy link
Contributor Author

petermm commented Sep 23, 2024

this is failing in interesting ways...

Copy link
Collaborator

@pguyot pguyot left a comment

Choose a reason for hiding this comment

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

Unfortunately, the build system requires that the module works through the compilation process. So we might need native unit. I had a similar issue with the elixir_config module that is used by mix. This is quite a mess. I wonder if we can use some bootstrapping options when compiling Elixir code....

@petermm petermm marked this pull request as draft September 23, 2024 20:49
Carbon copy from elixir with :native time unit removed, as it's not supported by current erlang implementation.

Signed-off-by: Peter M <[email protected]>
@petermm
Copy link
Contributor Author

petermm commented Sep 24, 2024

adding @compile {:autoload, false} makes compilation succeed, but let me verify it actually works..

petermm added a commit to petermm/ExAtomVM that referenced this pull request Sep 25, 2024
@petermm petermm marked this pull request as ready for review September 25, 2024 09:02
@petermm
Copy link
Contributor Author

petermm commented Sep 25, 2024

this is now ready.

important lesson in using @compile {:autoload, false} as it would otherwise fail doing compilation.

eg: https://github.com/petermm/AtomVM/actions/runs/10983957069/job/30493963932

[ 82%] Compiling System.ex
** (UndefinedFunctionError) function System.convert_time_unit/3 is undefined or private
    (elixir 1.17.3) System.convert_time_unit(138870005, :native, :millisecond)
    (elixir 1.17.3) lib/kernel/parallel_compiler.ex:786: Kernel.ParallelCompiler.maybe_warn_long_compilation/2
    (elixir 1.17.3) lib/kernel/parallel_compiler.ex:809: Kernel.ParallelCompiler.maybe_log_file_profile/2
    (elixir 1.17.3) lib/kernel/parallel_compiler.ex:706: Kernel.ParallelCompiler.wait_for_messages/8
    (elixir 1.17.3) lib/kernel/parallel_compiler.ex:292: Kernel.ParallelCompiler.spawn_workers/5
    (elixir 1.17.3) lib/kernel/parallel_compiler.ex:247: Kernel.ParallelCompiler.spawn_workers/3
    (elixir 1.17.3) lib/kernel/cli.ex:512: anonymous fn/2 in Kernel.CLI.process_command/2
Runtime terminating during boot ({undef,[{'Elixir.System',halt,[1],[]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
make[2]: *** [libs/exavmlib/lib/CMakeFiles/exavmlib_beams.dir/build.make:328: libs/exavmlib/lib/beams/Elixir.System.beam] Error 1
make[1]: *** [CMakeFiles/Makefile2:2139: libs/exavmlib/lib/CMakeFiles/exavmlib_beams.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

@bettio bettio merged commit 71988d3 into atomvm:release-0.6 Sep 25, 2024
65 of 70 checks passed
@petermm petermm deleted the system.ex branch October 1, 2024 07:47
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.

3 participants