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

Added version compatibility check #332

Merged
merged 4 commits into from
Aug 22, 2023
Merged

Added version compatibility check #332

merged 4 commits into from
Aug 22, 2023

Conversation

scohen
Copy link
Collaborator

@scohen scohen commented Aug 14, 2023

Lexical now outputs the erlang and elixir versions of the VM that was used to create them. It now checks the build and packaging directories for these versioning files and emits an error message if the vm starts with beam files that won't work.

Fixes #328 and #324

@scohen scohen requested a review from scottming August 14, 2023 22:30
@scohen scohen force-pushed the tagged_artifacts branch 2 times, most recently from 6586ce5 to 85a7aa7 Compare August 14, 2023 22:59
Lexical now outputs the erlang and elixir versions of the VM that was
used to create them. It now checks the build and packaging directories
for these versioning files and emits an error message if the vm starts
with beam files that won't work.
Another belt to wear with the suspenders. When we build a package that
overwrites another package, if the version has changed, we delete the
old compiled code and the old package and start compilation from
scratch. This definitely prevents old beam files from ending up in the
new package.
@scottming
Copy link
Collaborator

scottming commented Aug 17, 2023

After mix package, then run iex -S mix will encounter this error.

~/Co/lexical tagged_artifacts *1 ❯ iex -S mix                                                    46s  25.3.2.4  1.15.4-otp-25
Erlang/OTP 25 [erts-13.2.2.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

** (Mix) Could not start application server: exited in: Lexical.Server.Application.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: :error
            (server 0.1.0) lib/lexical/server/application.ex:33: Lexical.Server.Application.check_version/0
            (server 0.1.0) lib/lexical/server/application.ex:16: Lexical.Server.Application.start/2
            (kernel 8.5.4.1) application_master.erl:293: :application_master.start_it_old/4

@scohen
Copy link
Collaborator Author

scohen commented Aug 21, 2023

@scottming you must be using an old version, there is no line 33 in server/application.ex any more. I also don't understand how or why mix package can affect iex -S mix.

I tried the following, and it worked for me:

> mix clean
> mix package
> iex -S mix

@scottming
Copy link
Collaborator

@scohen yeah, you're right, I tried mix clean first, then everything works good.

@scohen scohen merged commit 2a298eb into v0.3.0 Aug 22, 2023
@scohen scohen deleted the tagged_artifacts branch August 22, 2023 00:51
scohen added a commit that referenced this pull request Aug 23, 2023
* Bumped versions to 0.3.0

* Added version compatibility check (#332)

* Added version compatibility check

Lexical now outputs the erlang and elixir versions of the VM that was
used to create them. It now checks the build and packaging directories
for these versioning files and emits an error message if the vm starts
with beam files that won't work.

* Detected version change on call to package

Another belt to wear with the suspenders. When we build a package that
overwrites another package, if the version has changed, we delete the
old compiled code and the old package and start compilation from
scratch. This definitely prevents old beam files from ending up in the
new package.

* Fixed dialyzer error

halt/1 always raises which irritates dialyzer. Added an ignore to it.

* Improved launcher script (#339)

* Improved launcher script

Seems ERL_LIBS wasn't picked up universally across versions, so I
swapped that out for the -pa flag

* silenced errors, used command -v to check for asdf / rtx

* Evalled output from rtx env

* fixed typo

* Update bin/start_lexical.sh

Co-authored-by: Étienne Lévesque <[email protected]>

---------

Co-authored-by: Étienne Lévesque <[email protected]>

* fix: update Nix derivation to use new build (#344)

* fix: update Nix derivation to use new build

---------

Co-authored-by: Steve Cohen <[email protected]>

---------

Co-authored-by: Étienne Lévesque <[email protected]>
Co-authored-by: Łukasz Jan Niemier <[email protected]>
scohen added a commit that referenced this pull request Aug 23, 2023
* Added version compatibility check

Lexical now outputs the erlang and elixir versions of the VM that was
used to create them. It now checks the build and packaging directories
for these versioning files and emits an error message if the vm starts
with beam files that won't work.

* Detected version change on call to package

Another belt to wear with the suspenders. When we build a package that
overwrites another package, if the version has changed, we delete the
old compiled code and the old package and start compilation from
scratch. This definitely prevents old beam files from ending up in the
new package.
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.

Tag build artifacts
2 participants